[SOLVED] Ozone debugger 3.20e debugging self-modified code problem

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

  • [SOLVED] Ozone debugger 3.20e debugging self-modified code problem

    Hi Segger,

    1. Thanks to the great Ozone debug, it helped a lot in development

    2. I want to report some problem about self-modified code. The application looks like this
    - My application implemented some check-sum against STM32's UUID
    - I added some code (store in 0x08008000) to calculate the checksum, and store result to somewhere in Flash
    - The code to calculate checksum is only executed one time. Once the check-sum is written to Flash, I used STM32 API to erase the code in 0x08008000
    - Assume FW will be read-out eventually, the approach adds some protection more or less

    3. I was using OZone debugger to debug the application. I opened a memory windows in 0x08008000
    After manipulating the registers to erase Flash, I expect to see the memory content becomes 0xFFFFFFFF. However, the values still kept in the window
    I even manipulate the FLASH control registers directly to *try* many PM regions
    With many many times trial, finally I disconnect the target and re-attach, the memory become 0xFFFFFFFF (erased status)

    4. I think this might relate to OZone implementation: you probably don't expect that users would "erase" the PM (or this is NOT common behavior)
    Therefore, the memory window content doesn't refresh. (need disconnect, re-attach, and the Ozone will re-read the memory)
    I'm just wondering, whether it's possible to force OZone to re-read the memory unconditionally to make such debug easier

    Thanks :)

    Regards,
    Lihgong
  • Hello Lihgong,

    Thank you for your inquiry.
    This behaviour is expected as J-Link will cache Flash contents to speed things up.
    You can disable Flash caching with command strings:
    wiki.segger.com/J-Link_Command_Strings#SetAllowFlashCache

    How to use them in Ozone is explained here:
    wiki.segger.com/J-Link_Command…ng_J-Link_Command_Strings


    Best regards,

    Nino
    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.