[ABANDONED] Can I mask some memory range as read-only to make J-Link always use hardware breakpoint at this memory range?

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

  • [ABANDONED] Can I mask some memory range as read-only to make J-Link always use hardware breakpoint at this memory range?

    We use a chip support XIP in SPI Flash(If SPI Flash controller is enabled, we can access SPI Flash by memory mapping).
    After reset, the SPI Flash controller is disabled in default, and it is enabled in bootloader.
    After the SPI Flash controller is enalbed, we can set a breakpoint in SPI Flash address space. But If we quit debug state without disable or delete breakpoints, and enter debug state again, J-Link will try to set breakpoints before bootloader run, and this make CPU crash.

    Because Cortex-M only has a few hardware breakpoints. It is said that If we set a breakpoint, J-Link will try to set software breakpoint first, if fails, then J-Link uses hardware breakpoints.
    I found there are some configure options in JLinkSettings.ini, can I use JLinkSettings.ini to make J-Link always uses hardware breakpoint in SPI Flash address space?

    [BREAKPOINTS]
    ForceImpTypeAny = 0
    ShowInfoWin = 1
    EnableFlashBP = 2
    BPDuringExecution = 0
    ......
    [MEM]
    RdOverrideOrMask = 0x00
    RdOverrideAndMask = 0xFFFFFFFF
    RdOverrideAddr = 0xFFFFFFFF
    WrOverrideOrMask = 0x00
    WrOverrideAndMask = 0xFFFFFFFF
    WrOverrideAddr = 0xFFFFFFFF
    我愛工作,工作使我快樂!

    C Source Code

    1. #include <stdio.h>
    2. int main(int argc, char **argv)
    3. {
    4. printf("hello world\n");
    5. return 0;
    6. }
  • Hi,

    It is said that If we set a breakpoint, J-Link will try to set software breakpoint first, if fails, then J-Link uses hardware breakpoints.

    If a breakpoint is requested for a (SPI)Flash address, J-Link will try to set a hardware breakpoint, and only set a software breakpoint if all hardware breakpoints are already in use.

    Could you please provide me with the following information?:
    Which device do you use?
    At which address range is the SPI-Flash located?

    Best regards,
    Niklas
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • SEGGER - Niklas wrote:

    Hi,

    It is said that If we set a breakpoint, J-Link will try to set software breakpoint first, if fails, then J-Link uses hardware breakpoints.

    If a breakpoint is requested for a (SPI)Flash address, J-Link will try to set a hardware breakpoint, and only set a software breakpoint if all hardware breakpoints are already in use.

    Could you please provide me with the following information?:
    Which device dou you use?
    At which address range is the SPI-Flash located?

    Best regards,
    Niklas
    Dear Niklas,

    Thanks for your reply!
    The device is under developmenting, and it hasn't a offical IC device name. Because it is based on ARM Cortex-M4, so we select 'Unspecfied Cortex-M4' to use it.
    The address of SPI-Flash is 0x800000~0x1000000.
    我愛工作,工作使我快樂!

    C Source Code

    1. #include <stdio.h>
    2. int main(int argc, char **argv)
    3. {
    4. printf("hello world\n");
    5. return 0;
    6. }
  • Hi,

    this sounds a little bit weird to us - as J-Link does not support this device yet, J-Link should not be able to set any software Breakpoints in Flash (because J-Link does not know how to program the Flash memory of this device).
    Could you please provide us with a J-Link logfile of 1) J-Link setting breakpoints into SPI-Flash and 2) " But If we quit debug state without disable or delete breakpoints, and enter debug state again, J-Link will try to set breakpoints before bootloader run, and this make CPU crash." ?

    Log output can be enabled like as follows:
    • Open a connection to J-Link, e.g start J-Link Commander
    • In J-Link Control Panel: (Click the J-Link symbol located in the notification / tray area in order to open J-Link Control panel)
    • Open the tab "Settings"
    • Next to the field "Log file" check "Override" and click "..." in order to choose a log file path.

    This is also described in UM8001 Chapter 5 "Working with J-Link and J-Trace", Section 5.7 "J-Link control panel" .

    Best regards,
    Niklas
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.