circuitpython: SPI + Bluetooth crash nRF52840
Calling the write()
method of an SPI object while Bluetooth is active crashes the firmware.
Here is a minimal code that reproduces the issue:
import board
import busio
from ubluepy import Peripheral
p = Peripheral()
p.advertise()
spi = busio.SPI(board.P0_22, MOSI=board.P1_00)
while not spi.try_lock():
pass
spi.write(bytes([0xff]))
If you comment out the last line (the call to spi.write()
), then it doesn’t crash anymore. Tested on the nRF52840 USB Dongle.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (3 by maintainers)
I disabled SPIM3 in nrfx_config.h and the problem seems to have been resolved. I can now run a blue advertise and then mount my SPI SD Card
This BLE + SPIM crash sounds quite similar to this issue: https://devzone.nordicsemi.com/f/nordic-q-a/33982/sdk-15-software-crash-during-spi-session/130572. I’m inquiring.
Since it does not occur on the nrf52832, It could be related to the s140 SD or something in the nrf52840 code. Both are differences.