Giter Club home page Giter Club logo

nrf52-bhy2-sensor-api's People

Contributors

bst-github-admin avatar robcazzaro avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

f7patrick

nrf52-bhy2-sensor-api's Issues

Uploading firmware issue: In bhy2_spi_write (common.c), m_tx_buf size should be length + 1

I wasn't able to upload firmware to flash (and uploading to RAM was dependent on MAX_READ_WRITE_LEN value) until I made the following change to the initialization of m_tx_buf:

int8_t bhy2_spi_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t length, void *intf_ptr)
{
    (void)intf_ptr;

    uint8_t m_tx_buf[length + 1];

    volatile uint32_t * p_spim_event_end = (uint32_t *) nrfx_spim_end_event_get(&m_spi);

    // Initialize buffers
    memset(m_tx_buf, 0xff, length + 1);

    m_tx_buf[0] = reg_addr;
    memcpy(m_tx_buf + 1, reg_data, length);

    m_tx_buf[0] = reg_addr;

    nrfx_spim_xfer_desc_t xfer_desc = NRFX_SPIM_XFER_TX(m_tx_buf, length + 1);

    int err_code = nrfx_spim_xfer(&m_spi, &xfer_desc, NRFX_SPIM_FLAG_NO_XFER_EVT_HANDLER);
    APP_ERROR_CHECK(err_code);

    if (err_code == NRF_SUCCESS)
    {
      while (*p_spim_event_end == 0)
                {};
      *p_spim_event_end = 0; 
    }
    // The driver doesn't release the ss_pin
    // So we need to do it ourselves here to tell the chip
    // that this SPI transfer is finished.
    nrf_gpio_pin_set(BSP_MEMS_CS);

    return BHY2_INTF_RET_SUCCESS;
}

bhy2_get_and_process_fifo speed

Hello rob!

I was playing with the BHI and noticed that I'm really slow in processing the FIFO. Have you ever had any problem in that? It seems that when I call get_and_process_fifo (obviously), it spends a lot of time going trough the FIFO, I'm talking about dozens of msec.

My goal is to have just a sample for a couple of virtual sensors whenever I ask for that, but that seems nearly impossible to do. Any advice on that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.