This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problem 'stopped by vector catch' in allocating RAM when I added a new ble service" (nrf52840 sdk15.3.0)

Hello,everyone

I want to add dfu service in UART example ,but when I tried to allocate the RAM,Debug terminal shows nothing,Then I set the breakpoint in nrf_sdh_ble.c and debugging,I can't enter the C file,

After I set breakpoint in main.c,I found that when debug goes to "ble_stack_init();",It will be block and I can't do anything,like the images:

1.before  debug "ble_stack_init();"

2.after  debug "ble_stack_init();"

it shows"restricted memory" in Watch,and The window "output" shows"stopped by vector catch",If I start"built and run" directly,It can succeed,but I think it doesn;t make anythings,Finally,I see maybe I can use app_error_handler_bare(), unfortunately I don't know how to use it.could you please give me some help? thanks!

best regards,

zhong

  • hello,AndreasF

    I do the thing in the infocenter guide,I add the code and set 

    NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 1 

    and there are some errors in the image

    which files should I add?

  • Hi zhong.

    Have you added the source files and header files?

    zhong said:

    1.Add source file
    Add a folder nRF_DFU to the project and add the following files:

    <sdk>\components\ble\ble_services\ble_dfu\ble_dfu.c
    <sdk>\components\ble\ble_services\ble_dfu\ble_dfu_bonded.c
    <sdk>\components\ble\ble_services\ble_dfu\ble_dfu_unbonded.c
    <sdk>\components\libraries\bootloader\dfu\nrf_dfu_svci.c

    ../../../../../../components/libraries/bootloader
    ../../../../../../components/libraries/bootloader/ble_dfu
    ../../../../../../components/libraries/bootloader/dfu
    ../../../../../../components/libraries/svc

     Have you defined m_ready_for_reset?

    Best regards,

    Andreas

  • hello,AndreasF,

    I try it,and then I receive the message like this:

     nrf_sdh_ble: Insufficient RAM allocated for the SoftDevice.
    
     nrf_sdh_ble: Change the RAM start location from 0x20002A98 to 0x20002AA8.
    
     nrf_sdh_ble: Maximum RAM size for application is 0x3D558.
    
     nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.
    
     app: ERROR 4 [NRF_ERROR_NO_MEM] at /Users/zz/Desktop/stage5a/heatzy_pilote/BLE_Projects/nRF5_SDK_15.3.0_59ac345/examples/ble_peripheral/ble_app_uart/main.c:508
    
    PC at: 0x0002EC1B
    
    

    so,how to change the section placement marcos?I use the soft6.1.1 and sdk 15.3.0,This is my setting(I set by the tutorial:https://devzone.nordicsemi.com/tutorials/b/getting-started/posts/adjustment-of-ram-and-flash-memory),I don't know the exact mean about FLASH_PH_START and FLASH_PH_SIZE.etc

    FLASH_PH_START=0x0

    FLASH_PH_SIZE=0x100000

    RAM_PH_START=0x20000000

    RAM_PH_SIZE=0x40000

    FLASH_START=0x26000

    FLASH_SIZE=0xda000

    RAM_START=0x20002a98

    RAM_SIZE=0x3d568

    so I just change the RAM_START and RAM_SIZE?or I should also change other things like FLASH_PH_START or FLASH_START. Look forward to your reply.

    best regards,

    zhong

  • hello,AndreasF,

    I changed my section placement marcos by the warning:

    FLASH_PH_START=0x0

    FLASH_PH_SIZE=0x100000

    RAM_PH_START=0x20000000

    RAM_PH_SIZE=0x40000

    FLASH_START=0x26000

    FLASH_SIZE=0xda000

    RAM_START=0x20002aa8

    RAM_SIZE=0x3d558

    and then I "build and run" in order to get the output.hex.After this,I make the setting file and mix the settings.hex,app.hex,softdevice.hex and bootloader.hex by using the code below:

    nrfutil settings generate --family NRF52840 --application app.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 settings.hex
    
    mergehex --merge bootloader.hex s140_nrf52_6.1.1_softdevice.hex --output production_final1.hex
    
    mergehex --merge production_final1.hex app.hex --output production_final2.hex
    
    mergehex --merge production_final2.hex settings.hex --output production_final.hex
    
    nrfjprog --eraseall -f NRF52
    
    nrfjprog -f NRF52 --program "production_final.hex" --verify  
    
    nrfjprog --reset -f NRF52

    finally I can connect the nrf52840 which is named "UART service" by my phone,but I can only find that there is only a service named UART service,I can't find the dfu service, what should I do?

    best regards,

    zhong

  • hello,AndreasF,

    I try it again, and it also only shows the UART service,could you please help me find the solution?Thanks a lot.

    best regrads,

    zhong

Related