[ABANDONED] Unlock readout protection in Atollic GDB startup script

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

  • [ABANDONED] Unlock readout protection in Atollic GDB startup script

    Hi,

    every now and then we have the problem that when the debugger is started, it does not jump into the main routine and stops there. Together with this problem, the error message that the readout protection is activated, comes up every now and then. We don't know why the readout protection should be activated. We don't use this feature.

    For a first test we want to disable the readout protection in the GDB startup script. This is the actual startup script.

    Source Code

    1. # Default GDB command file (FLASH) for SEGGER J-LINK and STMicroelectronics STM32F091RC microcontroller.
    2. # Set character encoding
    3. set host-charset CP1252
    4. set target-charset CP1252
    5. # Set JTAG speed to 30 kHz
    6. monitor speed 30
    7. # Set GDBServer to little endian
    8. monitor endian little
    9. # Reset the chip to get to a known state.
    10. monitor reset
    11. # Set auto JTAG speed
    12. monitor speed auto
    13. # Setup GDB FOR FASTER DOWNLOADS
    14. set remote memory-write-packet-size 1024
    15. set remote memory-write-packet-size fixed
    16. # Enable flash download
    17. monitor flash download = 1
    18. # Load the program executable
    19. load
    20. # Reset the chip to get to a known state. Remove "monitor reset" command
    21. # if the code is not located at default address and does not run by reset.
    22. monitor reset
    23. # Set a breakpoint at main().
    24. tbreak main
    25. # Run to the breakpoint.
    26. continue
    Display All



    How can I unlock the readout protection in the GDB startup script? In the software we have to do this with these commands.

    Source Code

    1. FLASH_OB_Unlock();
    2. FLASH_OB_RDPConfig( OB_RDP_Level_0 );
    What are the corresponding commands in the debug script?

    OS: Windows 7
    IDE: Atollic V9.3.0.
    Micro: ST32F091RC
    Debugger: Segger J-LINK Ultra+

    Thanks for your help.
  • Hi,
    sorry for the delay in response.

    The J-Link reads the Option byte registers to check if a read and/or write protection is set.
    In case a different value than AA is read for RDP, the device is unsecured.

    Either RDP/WRP is set or the data read from the option bytes area returns some garbage value.
    Does it work when issuing an additional reset before loading the application?

    Best regards,
    Fabian
    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.