nrf52, nordic soft device and riot-os

Hi,

I’m currently trying to use RIOT-OS with the Nordic SDK Softdevice S132.

I have been able to follow Kaspar’s example where he integrated the IOT sdk as a pkg, and have integrated the nordic sdk as a pkg as well.

Code is linked and flashed at the correct address(es). My code runs, and can even confirm that ISR’s trigger correctly. (Some of my test code uses a driver that triggers interrupts. The output is visible on an led.)

Unfortunately, when trying to use the shell, the moment that I type anything into the shell and hit ‘enter’, I get a hard fault. Seen here:

Hi Robert,

I'm currently trying to use RIOT-OS with the Nordic SDK Softdevice S132.

I assume you're not targeting the nrf52dk?

Unfortunately, when trying to use the shell, the moment that I type anything into the shell and hit 'enter', I get a hard fault. Seen here:

Does it work in the examples (e.g., gnrc_networking)?

If I do not hit "enter" in the shell, the application / test code continues to run (albeit most of the code is sitting idle except for the isr that is manipulating the led).

Are you using pyterm? (pyterm buffers serial input until enter is pressed). If yes, please try another terminal emulator and confirm that the first serial input character leads to the crash.

I'm looking for suggestions on what else to check. Help is appreciated.

How I love debugging blobs. :wink:

Kaspar

Hi Kaspar,

Thank you for the quick response. Your suggestions were very useful.

I'm currently trying to use RIOT-OS with the Nordic SDK Softdevice S132.

I assume you're not targeting the nrf52dk?

[RH] I am targeting the nrf52dk.

Unfortunately, when trying to use the shell, the moment that I type anything into the shell and hit 'enter', I get a hard fault. Seen here:

Does it work in the examples (e.g., gnrc_networking)?

[RH]I used the hello-world example, imported the shell module, and new nordic sdk package. I was able to get the example running, but only with the compiler optimizer on (ie, -Os). With the gcc optimizer off ( ie, -O0 ), the hello world example still runs into the same problem. To be clear, aside from initializing the softdevice handler (in cpu.c), there is no code in main that interacts with the softdevice.

If I do not hit "enter" in the shell, the application / test code continues to run (albeit most of the code is sitting idle except for the isr that is manipulating the led).

Are you using pyterm? (pyterm buffers serial input until enter is pressed). If yes, please try another terminal emulator and confirm that the first serial input character leads to the crash.

[RH] Using minicom, I confirmed that the first serial input character led to the crash. (but only with optimizer off)

I'm looking for suggestions on what else to check. Help is appreciated.

How I love debugging blobs. :wink:

[RH] Apologies if the first email was a bit vague.

[RH] I had the optimizer off so that I could use the debugger effectively. The optimizer was disabled by overriding the CFLAGS_OPT variable in the example Makefile. I'm using ARM GCC (arm-none-eabi-gcc) 4.9.3 .

Is there some part of the build / OS that assumes/requires optimization to be turned on? Or do you suppose this is simply a 'size' issue relating to larger code size with the optimizer off?

Regards,

Robert