Sysprogs forums › Forums › VisualGDB › Nordic nrf51xxx Hardfault on SystemInit()
- This topic has 5 replies, 2 voices, and was last updated 9 years, 10 months ago by
support.
-
AuthorPosts
-
December 2, 2015 at 11:24 #7280
m.kunz@greisinger.de
ParticipantHello,
I purchased a new noridc PCA10028 development board. In Visual GDB I selected “nRF51422_XXAC” “S110” or “S130, Newlib-nano, Bluetooth Heartrate Device or Bluetooth UART.
When starting to debug, when calling SystemInit() the HeartFault-Handler is hit.
It happens after returning from is_manual_peripheral_setup_needed() or is_disabled_in_debug_needed(). I tried to uncomment both but then after SystemInit(); __libc_init_Array() is called and it also jumps into Hardfault-Handler. After also uncommenting __libc_init_Array(); Hardfault-Handler is hit in main() on timers_init();
Nordic Board: PCA10028 V1.1.0 2015.44
VisualGDB Linux Edition Version 5.0 Support period expires on 2016-02-25
Any suggestions?
December 3, 2015 at 04:31 #7281support
KeymasterHi,
That usually happens when the stack pointer points to an invalid location. Please double-check your MCU type. You can also try using the Memory window to edit the memory at the $sp address to see if the memory there is writable. If you find out that it’s not writable, please change the MCU type to a one with a smaller RAM.
December 3, 2015 at 10:53 #7284m.kunz@greisinger.de
ParticipantHello,
I checked again, on the PCA10028 normally a NRF51422 xxAC is used. That’s also what is on top of the IC-case N51422-OCAC1-1515AK, SEGGER J-Link Control Panel also Displays NRF51422_XXAC as connected device.
I tried the AA-Version with lower RAM, but here also right after returning from any called function the core jumps to the HardFault Handler. I also tried different Settings for “C Library Type”, “Reduce sice of C++ Binaries” and “Provide Default stubs for system calls” I also tried S130 or S110 as Softdevice with both HeartRatePeripheral and UART, but all behave the same.
When using mbed I can Flash the Chip via Bootloader-Device, the code runs. But J-Link ODB is lost after that. It needs to be reflashed with the Nordic J-Link ODB Firmware to get J-Link functionality again.
December 3, 2015 at 20:14 #7291support
KeymasterHi,
Do you have the “Reset device after programming” flag enabled in the Debug Settings as described in the tutorial?
December 7, 2015 at 08:22 #7307m.kunz@greisinger.de
ParticipantHello,
no, that was the case, I didn’t set the flag…
After setting it all worked just perfectly, thank you
December 9, 2015 at 19:58 #7316support
KeymasterHi,
No problem. BTW, we have released an update to the Segger J-Link package that will set the flag automatically for new Nordic projects. Feel free to update it via Tools->Embedded Tools Manager.
-
AuthorPosts
- You must be logged in to reply to this topic.