This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF51 Uart Overrun

Hi,

I use a GPS Modul to send data via uart to the NRF 51 and then I send the string via SPI and fatfs to the SD CArd.

I see the LED4 blinking and during the debugging I can see the Uart has an overrun event. The Uart has no flow control and a baud rate from 9600.

The overrun is calling during the fatfs. So I expect losing data by writing to the SD CArd, but all data is written without any failure.

I use  normal libary, no softdevice and calling the fatfs from the main loop,

What means the LED 4, if it blinking and why i have an uart overrun event but nothing happen with the data?

Parents
  • It may be hard to spot with the naked eye, but you should get at least a failed checksum.

    In case your code silently drops NMEA sentences with a wrong check sum, the result will look and also likely work quite acceptable.

    Note: The reason you get UART overruns is that the SD card can take quite some time to write a sector. Expected worst case timing is in the 300ms to 1second range, and *much* longer if the card was badly fragmented.

  • You can see this behaviour in the example fafts sdk12.3, too.

    The Blinking LED 4 comes from this pieces of code, app_sdcard.c

    __STATIC_INLINE void sdc_spi_transfer(uint8_t const * const p_txb,
                                          uint8_t tx_len,
                                          uint8_t * const p_rxb,
                                          uint8_t rx_len)
    {
        SDC_CS_ASSERT();
        ret_code_t err_code = nrf_drv_spi_transfer(&m_spi, p_txb, tx_len, p_rxb, rx_len);
        APP_ERROR_CHECK(err_code);
    }

    with SDC_CS_ASSERT() you call from nrf_gpio.h

    nrf_gpio_port_out_clear(reg, 1UL << pin_number);

    It is possible after calling nrf_drv_spi_transfer to return  back to main.c, without waiting? Maybe with a spi eventhandler?

    Because i think it is running in blocking mode.

Reply
  • You can see this behaviour in the example fafts sdk12.3, too.

    The Blinking LED 4 comes from this pieces of code, app_sdcard.c

    __STATIC_INLINE void sdc_spi_transfer(uint8_t const * const p_txb,
                                          uint8_t tx_len,
                                          uint8_t * const p_rxb,
                                          uint8_t rx_len)
    {
        SDC_CS_ASSERT();
        ret_code_t err_code = nrf_drv_spi_transfer(&m_spi, p_txb, tx_len, p_rxb, rx_len);
        APP_ERROR_CHECK(err_code);
    }

    with SDC_CS_ASSERT() you call from nrf_gpio.h

    nrf_gpio_port_out_clear(reg, 1UL << pin_number);

    It is possible after calling nrf_drv_spi_transfer to return  back to main.c, without waiting? Maybe with a spi eventhandler?

    Because i think it is running in blocking mode.

Children
Related