I have an application which uses SPI to communicate with ADC.
when I don't use SoftDevice and use nrf_drv_timer
to start conversion periodically it works
but when I use SoftDevice and use app_timer
which need the softDevice enabled to work (i'm I mistaken?) I got false conversions
with SoftDevice : when I initialise SPI first and then SoftDevice it doestn work
when I initialsie SoftDevice first and then initialsie SPI at the end, the SPI seems to work (the spi_master_evt_handler is executed after spi_master_send_recv
completed, can see my led toggle) but then I got false ADC conversion so I think there is something wrong with the SPI
I tried to put the spi_master_evt_handler
code in main code and just just put flag on the handler but still not working
now when I try to set spi_instance.SPI_PriorityIRQ = NRF_APP_PRIORITY_HIGH;
according to this link my program freeze (I think spi_master_evt_handler
is not called)
so is spi_instance.SPI_PriorityIRQ = NRF_APP_PRIORITY_HIGH
mandatory when using Softdevice and why it's not working in my case
notice then in my program I just called ble_stack_init
and without setting softdevice_ble_evt_handler_set
(I just enabled soft device (sd_ble_enable
))