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

Parents
  • Hi zhong.

    For the issue with Restricted Memory Range, please read this.

    For adjustment of RAM, please read this tutorial and look at chapter 8 or 9.

    Best regards,

    Andreas

  • Hi AndreasF,

    I try the chapter 8 or 9 in this tutorial,but there a problem occurs,

    1.In chapter 8

    First,I set the RAM like this in configuration debug,like this image.(sdk15.3.0,softdevice6.1.1)

    and then I change the define in sdk_config.h which are shown in chapter 8.after I cancel all the breakpoint and click "go" in option "debug",but it's nothing in debug terminal,like the image.

    Finally I click "go" once more,it shows"stopped by vector catch"

    2.in chapter 9

    In this way ,I set a breakpoint in line" ret_code_t ret_code = sd_ble_enable(p_app_ram_start);" shown in chapter 9, and then I click "go" in option"debug" once time ,the result like this image:

    and then I click"go" once more,The debug never jump into the breakpoint which I set and it was blocked wtih"stopped by vector catch",like the image:

    So what should I do?and if there are some tutorial which can tell me how to allocate RAM when I want to add a new service in a example(add dfu_buttonless service is better),Look forward to your help,thanks!

    best regards,

    zhong

  • Hi Zhong,

    I see. Since you are able to transfer the image, you have successfully entered DFU mode in the bootloader. Therefor this issue is not related to the DFU service.

    Can you test with a debug bootloader, and upload the RTT log to this case? The bootloader has extensive logging, so the log should hopefully tell us more about what is going on.

  • Hi,Einar,

    I tested with a debug bootloader,it's named DfuTarg,but the same situation occured,it's always in 100% and then back to the orignal service(dfuTarg), and now i'm using the macos and I don't know how to get the RTT log. could you please tell me how to get the RTT log and I will update it quickly.

    best regards,

    zhong

  • Hi,

    The debug bootlaoder use RTT logging by default, so you just need to connect a J-link debugger (unless you use the DK, which has one onboard) and start the J-Link RTT Viewer. This should have allready been installed on your computer, assuming you use Windows and have installed nRF5 Command Line Tools.

  • Hi Einar,

    ok,so I can do it in mac os? I will do it, by the way,maybe my update-zip.file is incorrecct.It's my process:

    1.get the output file.hex in example hrs.and named "app_new.hex"

    2.use command:

    nrfutil pkg generate --application app_new.hex --application-version 1 --application-version-string "1.0.0" --hw-version 52 --sd-req 0xB6 --sd-id 0xB6 --softdevice s140_nrf52_6.1.1_softdevice.hex --key-file priv.pem FW.zip

    and I download the zipfile and use it.

    Is there any problem?looking forward to your reply.

    best regards,

    zhong

  • Hi,

    Yes, you can use RTT logging on Mac as well, but it is a bit less user friendly. You can follow the same basic instructions as for Linux, for instance from this post.

    Your nrfutil command looks mostly OK. However, you should increase the application-version, as the bootloader will prevent you to upgrade to the same or lower version number (unless NRF_DFU_APP_DOWNGRADE_PREVENTION is set to 0 in the bootloaders sdk_config.h).

Reply
  • Hi,

    Yes, you can use RTT logging on Mac as well, but it is a bit less user friendly. You can follow the same basic instructions as for Linux, for instance from this post.

    Your nrfutil command looks mostly OK. However, you should increase the application-version, as the bootloader will prevent you to upgrade to the same or lower version number (unless NRF_DFU_APP_DOWNGRADE_PREVENTION is set to 0 in the bootloaders sdk_config.h).

Children
  • Hi,

    I try this and I get these things:

    JLinkRTTClient

    ###RTT Client: ************************************************************

    ###RTT Client: *               SEGGER Microcontroller GmbH                *

    ###RTT Client: *   Solutions for real time microcontroller applications   *

    ###RTT Client: ************************************************************

    ###RTT Client: *                                                          *

    ###RTT Client: *       (c) 2012 - 2016  SEGGER Microcontroller GmbH       *

    ###RTT Client: *                                                          *

    ###RTT Client: *     www.segger.com     Support: [email protected]       *

    ###RTT Client: *                                                          *

    ###RTT Client: ************************************************************

    ###RTT Client: *                                                          *

    ###RTT Client: * SEGGER J-Link RTT Client   Compiled Mar 22 2019 17:28:45 *

    ###RTT Client: *                                                          *

    ###RTT Client: ************************************************************

    ###RTT Client: -----------------------------------------------

    ###RTT Client: Connecting to J-Link RTT Server via localhost:19021  Connected.

    SEGGER J-Link V6.44c - Real time terminal output

    J-Link OB-SAM3U128-V2-NordicSemi compiled Jan  7 2019 14:07:15 V1.0, SN=683732423

    Process: JLinkExe

    Where can I find the exact file?and I try to change the application-version at 2,The same situation occured ,and I simply use the DfuTarg,It failed too.What should I do next?

    best regards,

    zhong

Related