Im using GCC + Eclipse with the S110 SoftDevice and the HRS example code. Everything is working well except for printf (which I've added a call to via app_trace
). I've set the ENABLE_DEBUG_LOG_SUPPORT
#define. I've also called app_trace_init()
.
I get a Hard_Fault when I call app_trace
. Stepping through the assembly:
printf
is entered.printf
attempts to dereference_impure_ptr
(part of the thread support forerrno
in newlib), but_impure_ptr
points to0x8000222
, which I believe is in the region of the SoftDevice and not readable.- At this point, a Hard_Fault occurs.
Does newlib need to be initialized (i.e. do I need to call _init
or _fini
somewhere)? Has anyone else used printf
with GCC + newlib?
I'm using the gcc_nrf51_s110_xxac.ld
linker script that comes with the SDK--so my memory and flash regions should be correct.