Hey everyone,
I'm getting a really weird error. I'm using two dev boards for my application: a PCA10001 board (MBED enabled) and a PCA20006 beacon board with Segger's j-link debugger.
I program the MBED board by compiling my code with make, merging it with the softdevice, and dragging the resulting hex file to the MBED mass storage device.
I program the beacon board by using the exact same makefile (only changing the board define from -DBOARD_PCA10001 to -DPCA20006), afterwards I run a small flashing script.
BOARD = -DBOARD_PCA20006
#BOARD = -DBOARD_PCA10001
_
CFLAGS += $(BOARD)
_
#commands
echo "loadbin $SoftDevice 0 #flash softdevice" > $tmpScriptName
echo "loadbin $Program 0x16000 #flash program" >> $tmpScriptName
echo "r" >> $tmpScriptName #reset
echo "g" >> $tmpScriptName #go (run)
echo "exit" >> $tmpScriptName
$JLinkExe -device nrf51822 -speed 1000 -if swd $tmpScriptName
rm $tmpScriptName
echo "Finished"
My problem is, I'm getting different behaviours with different boards. In the MBED board my code runs as is expected, in the beacon board I get a hardfault at strtok.
Any ideas on why this could be happening?