[ANSWERED] Using breakpoints in external flash

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [ANSWERED] Using breakpoints in external flash


    I am using STM32F103ZE controller in my project. Some portion of code is running from external flash. I am using IAR + Jlink environment for development.

    I can set the breakpoint for the code which is running from internal flash area but unable to set breakpoints for external flash area. Please let me know how can this be achieved?

    Can 'FlashBP' license be used for setting software breakpoints in external flash?

  • Hi Prasad,

    For clarification:
    We can set breakpoints in external flash memory, but only hardware breakpoints.
    This means, that when debugging in external flash on a Cortex-M3 device, you are limited to 6 breakpoints.

    Currently the J-Link DLL does not have support for programming external NOR flash
    and so also flash breakpoints (providing an unlimited number of breakpoints) in external NOR flash are not supported right now.

    Best regards
  • Hello,

    have the J-Link DLL now (2012) support for programming external NOR flash?

    My problem is the same. But Keil / ARM support explain me that a Cortex M3 doesn't support BP above a 1GB adresses (0x4000 0000). Look at

    ARMv7-M Architecture Reference Manual -> Debug Architecture -> Flash Patch and Breakpoint
    unit -> FPB unit operation

    The problem: My controler a NXP LPC 1778 are all addresses for extern memory starts at 0x8000 0000 for chip select 0 end end at 0x9C00 0000 for chip select 3. So there are no Hardware BP available. So I hope for Software BP by J-Link!
    Thank you

  • Hi John,

    The current DLL (V4.52c, segger.com/jlink-software.html) supports direct download into external CFI-NOR flash memory as well as software breakpoints in CFI-NOR flash.
    What needs to be done to use this feature is explained in the J-Link User Guide (UM08001), chapter "Flash breakpoints" section "7.4 Setup & compatibility with various debuggers".

    The flash breakpoints feature can be used free of charge for evaluation purposes.

    Please note that when using this feature you need to make sure that the debugger has already performed the init sequence for the external memory interface of the MCU/CPU,
    since this is debugger's / user's responsibility. The DLL expects the external memory interface to be already initialized when perfoming the CFI detection.

    Best regards
  • Hi Alex,

    I have a J-Trace for ARM Cortex-M3 debugger with software BPs (V4.52c and Keil uVision 4.53). The init-sequence work, so the code that I want is on external NOR-Flash at address 0x8000 0000 and it executes. Single step over this code is no problem. BPs set in the internal flash area is no problem and unlimited. Only if I want set a BP on a external Flash address following message occur:

    This is the only BP in my Project (I checked it with STRG-B and in the J-Link Control panel -> Breakpoints).
    So what is wrong?
  • Hi Alex,

    I think there is a logical problem:
    For download the code to the ext. memory j-link need a Programming Algorithm. This Algorithm need RAM of my controller. This is ok because in the download process the RAM is not used of my code and I can set the address and size in the settings of uVision.

    But if I want later set or clear a softwarebreakpoints in my ext. memory I think j-link need this Algorithm still. But now my program used RAM. How does j-link know which storage area in RAM is unused? Use j-link still the settings of the start address and size of "Flash Donwload" settings of uVision? ?(
    Best Regards

  • Hi John,

    I think some clarification is needed here:
    J-Link does not use and does not care about what is configured as flash algorithm in uVision.
    The whole "software breakpoints in flash" is handled inside the J-Link DLL and debugger independent.

    Yes, some RAM is used to update the software breakpoints in flash memory since the flash programming algorithm uses some.
    BUT: J-Link will automatically handle this and save the RAM contents before programming is performed and restores them as soon as it is done with flash programming.

    Best regards
  • Hi Alex,

    thanks for the explanation. So the RAM "problem" is handeld very nice and seems no problem.
    But with the flash algorithm I understand something wrong or my settings are not correct.
    In the follwing setting windows I have choose the algorithm for my NOR-Flash:

    If I don't do this or I choose a wrong one the flash download will be fail.
    So do you mean another flash programming algorithm or I miss some settings?
    Thanks for support