I am trying to configure SPI with BLE using softdevice S130. But SPI is not working properly when I used it with BLE, although it is working fine without BLE
I am trying to configure SPI with BLE using softdevice S130. But SPI is not working properly when I used it with BLE, although it is working fine without BLE
So when you have only SPI, you get the RX and TX with good data and the UART also with good data. When you initialize BLE the RX has always 0xFF and the TX nothing, and the UART writes bad data. Is that what happens? If you initialize the BLE but don't advertise, it stays the same?
If i don't don't advertize in that case sometimes SPI writes and reads successfully and sometimes it does not. I don't understand what is the error. Help me out
Maybe try to debug step by step to see what he does when the SPI works normally and when it doesn't. because from your code is hard to know what you are doing, because they are functions that I don't know what is inside. If you can't find the case where it happens, maybe add code snippets of your functions (if you can).
In spi_test() function I am just writing and reading from a sensor, nothing detailed. I also have gone through it step by step, first I write through api and then read it, sometimes read is successful as write was successful sometimes its not.
And can you see the clock and CS signal with a logic analyzer to see if its working properly and the is only the data that is corrupted.
Also you shouldn't use the nrf_delay_ms function, but replace it with a timer, because the delay blocks the program with nops and the timer just block when the time is achieved.