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

Send data from mobile app via ble_uart and send the data to another nrf52 via spi

I have two nrf52 chips connected to each other via SPI

I send data from my Nordic Uart app to my nrf52 chip 1 and I want to send the data that I receive from Mobile app to another Nrf52 chip 2 that is connected via SPI and it is in slave mode.

I completed merging two examples ble_app_uart and spin.

When i call the function to transfer a static data via spi in main  the data is transferred to another.

When I receive the data in ble_nus and I try to send the data the data is not transferred.


This is the function that transfers the initiates the spi transfer process "send_data_to_biboA();"

  • I suspect it is an interrupt priority issue, for instance that nus_data_handler() have equal or higher priority than spi_event_handler(), this will cause the spi_event_handler() to not be able to update the spi_xfer_done flag. You can try to change SPI_DEFAULT_CONFIG_IRQ_PRIORITY to 3 to see if that solves it.

    Best regards,
    Kenneth

  • No this did not solve the problem and the Bluetooth advertising is stopped as soon as this function is called send_data_to_biboA(); and the whole process is stopped

  • Edit:

    But you have really long delays in send_data_to_biboA(), what interrupt priority does nus_data_handler() run? Have you tried to remove the delays?

    Can you comment out the init of logging (or move it to main())?

    //APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    //NRF_LOG_DEFAULT_BACKENDS_INIT();

    Have you checked if you have an assert (run to app_error_fault_handler())?

    Kenneth

  • I tried commenting them but the BLE service stops

  • I am able to transfer the data to another nrf but after the spi transfer my board goes to deadlock the able stops.

1 2