Hi,
I have an application which scans for BLE advertisements and pushes some information about it over UART.
I run this on a nRF52840 DK card using softdevice s140 6.1.1 and SDK 15.3.0. Compiled using arm-none-eabi-gcc (Arch Repository) 8.3.0
Thing is, when I call 'nrfx_uarte_tx', I get a HardFault from vPortStartFirstTask in FreeRTOS. It looks like the offending line is
73 #ifdef SOFTDEVICE_PRESENT
74 ::"i"(configKERNEL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
75 #endif
Having no idea about the internals of FreeRTOS, I don't know how to proceed.
Removing the line 'nrfx_uarte_tx' from my code makes everything work fine. My current thought is that the interrupt from UART is incompatible with SD+FreeRTOS, but not sure how to verify it. If I remove the code from the interrupt handler it still does not work, so the critical section seems to be between calling nrfx_uarte_tx and receiving the interrupt from sending.
All my interrupt priorities are unchanged from the example I started with, usbd_ble_uart_freertos.
I will see if I can make a simpler project to demonstrate the problem if it helps.