hatdfault BLE application on srf52833 with s140 softdevice

Hello,
I'm trying to use BLE on nrf52833. I'm developping with segger embedded studio and I' m usign the BLE peripheral example "ble_app_blinky".
Firstly I erased the flash memory and installed the softdevice:

nrfjprog --eraseall
nrfjprog --program s140_nrf52_7.2.0_softdevice.hex --verify

Then I compiled the application and debugged. When the application go to sd_softdevice_enable, the system go to hardfault!

The linker setup is:
FLASH_PH_START=0x27000
FLASH_PH_SIZE=0x59000
RAM_PH_START=0x20002C00
RAM_NOINIT_SIZE=0x3000
RAM_PH_SIZE=0x1d400
FLASH_START=0x27000
FLASH_SIZE=0xa59000
RAM_START=0x20000000
RAM_SIZE=0x20000
DEFAULT_CONFIG_START=0x27000
DEFAULT_CONFIG_SIZE=0x400
FCONFIG_START=0x28000
FCONFIG_SIZE=0x1000
INIT_START=0x29100

Thank you in advance for support.
Davide

Parents
  • Hi Davide, 

    Can you please enable the serial logs and give us some details of the hardfault on your serial logs. Also make sure you enable 

    HARDFAULT_HANDLER_ENABLED to 1 in your sdk_config.h
    There also an external blog you can use to try to attempt to debug the hardfault to get the context of where the hardfault happens.
  • Another test:

    just the debug call: 

    SVCALL(SD_SOFTDEVICE_ENABLE, uint32_t, sd_softdevice_enable(nrf_clock_lf_cfg_t const * p_clock_lf_cfg, nrf_fault_handler_t fault_handler));

    the debug stop at void vPortSVCHandler( void ) and the register values are there:

    Go forward by 1 step and the debug goes to hardfault handler, and  the register values are there:

    I hope it is usefull to solve the issue.

  • Check that the debugger is set up correctly.

    We had another case some weeks ago where the debugger was set up to run the processor from the application reset vector - which ignores the required softdevice setup that must be run before the application start.

    Hard faulting in the first SD call sounds a lot like such a problem.

    I strongly recommend switching to NRF connect SDK.

  • I Turbo J,

     actually putting in debug, I notice in the Disassembly pane, that the application starts from the 'address 0x26100 instead of 0x000000 where is located the softdevvice. How can do to start the appplication from 0x000000 address? I tried putting in Project options->Debug->Loader->Additional file[0]:s140_nrf52_7.2.0_softdevice.hex, and Additional File Address[0[]=0x000000, but the application alway start from  0x26100.

    Thank you for support,

    Davide

Reply
  • I Turbo J,

     actually putting in debug, I notice in the Disassembly pane, that the application starts from the 'address 0x26100 instead of 0x000000 where is located the softdevvice. How can do to start the appplication from 0x000000 address? I tried putting in Project options->Debug->Loader->Additional file[0]:s140_nrf52_7.2.0_softdevice.hex, and Additional File Address[0[]=0x000000, but the application alway start from  0x26100.

    Thank you for support,

    Davide

Children
No Data
Related