[ABANDONED] Flash does not work with ozone while works with JLinkExe

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

  • [ABANDONED] Flash does not work with ozone while works with JLinkExe

    Hello,

    On Linux 22.04.2 LTS. I'm trying to flash a board with ozone 3.30 with J-Trace Pro ARM Cortex-M.

    I must say that this worked in the past with this board (in the past, I was using an older version of ozone. I don't remember
    which but not very old. BTW I switched to 3.3 AFTER the bug occurs so it's not 3.30 specific.).

    Today flash fails in ozone 3.30 with this log:

    Brainfuck Source Code

    1. Debug.Start();
    2. Device "STM32L471RG" selected.
    3. InitTarget() start
    4. SWD selected. Executing JTAG -> SWD switching sequence.
    5. DAP initialized successfully.
    6. InitTarget() end - Took 4.68ms
    7. Found SW-DP with ID 0x2BA01477
    8. DPIDR: 0x2BA01477
    9. CoreSight SoC-400 or earlier
    10. Scanning AP map to find all available APs
    11. AP[1]: Stopped AP scan as end of AP map has been reached
    12. AP[0]: AHB-AP (IDR: 0x24770011)
    13. Iterating through AP map to find AHB-AP to use
    14. AP[0]: Core found
    15. AP[0]: AHB-AP ROM base: 0xE00FF000
    16. CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    17. Found Cortex-M4 r0p1, Little endian.
    18. FPUnit: 6 code (BP) slots and 2 literal slots
    19. CoreSight components:
    20. ROMTbl[0] @ E00FF000
    21. [0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    22. [0][1]: E0001000 CID B105E00D PID 003BB002 DWT
    23. [0][2]: E0002000 CID B105E00D PID 002BB003 FPB
    24. [0][3]: E0000000 CID B105E00D PID 003BB001 ITM
    25. [0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
    26. [0][5]: E0041000 CID B105900D PID 000BB925 ETM
    27. Connected to target device.
    28. Reset: Halt core after reset via DEMCR.VC_CORERESET.
    29. Reset: Reset device via AIRCR.SYSRESETREQ.
    30. ------------------------------------------- _SetupTarget
    31. Elf.GetBaseAddr(); // returns 0x8041000
    32. Target.ReadU32 (0x08041000); // returns 0x4, data is 0x20018000
    33. Target.SetReg ("SP", 0x20018000);
    34. Elf.GetEntryPointPC(); // returns 0x804C404
    35. Target.SetReg ("PC", 0x804C404);
    36. J-Link: Flash download: Bank 0 @ 0x08000000: 1 range affected (96256 bytes)
    37. J-Link: Flash download: Total: 1.588s (Prepare: 0.071s, Compare: 0.066s, Erase: 1.037s, Program: 0.321s, Verify: 0.032s, Restore: 0.059s)
    38. J-Link: Flash download: Program speed: 292 KB/s
    39. Verification failed @ address 0x08041000
    40. Download failed: error during verification phase
    41. ------------------------------------------- _SetupTarget
    42. Elf.GetBaseAddr(); // returns 0x8041000
    43. Target.ReadU32 (0x08041000); // returns 0x4, data is 0x20018000
    44. Target.SetReg ("SP", 0x20018000);
    45. Elf.GetEntryPointPC(); // returns 0x804C404
    46. Target.SetReg ("PC", 0x804C404);
    Display All



    If I switch to command line, It works as expected:

    Source Code

    1. SEGGER J-Link Commander V7.84b (Compiled Jan 11 2023 16:43:08)
    2. DLL version V7.84b, compiled Jan 11 2023 16:42:38
    3. Connecting to J-Link via USB...O.K.
    4. Firmware: J-Trace PRO V2 Cortex-M compiled Jun 6 2023 10:51:16
    5. Hardware version: V2.00
    6. J-Link uptime (since boot): 0d 00h 06m 27s
    7. S/N: 752000945
    8. License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    9. USB speed mode: High speed (480 MBit/s)
    10. IP-Addr: DHCP (no addr. received yet)
    11. Emulator has RAWTRACE capability
    12. VTref=3.329V
    13. Type "connect" to establish a target connection, '?' for help
    14. J-Link>connect
    15. Please specify device / core. <Default>: STM32L471RG
    16. Type '?' for selection dialog
    17. Device>
    18. Please specify target interface:
    19. J) JTAG (Default)
    20. S) SWD
    21. T) cJTAG
    22. TIF>S
    23. Specify target interface speed [kHz]. <Default>: 4000 kHz
    24. Speed>
    25. Device "STM32L471RG" selected.
    26. Connecting to target via SWD
    27. InitTarget() start
    28. InitTarget() end
    29. Found SW-DP with ID 0x2BA01477
    30. DPIDR: 0x2BA01477
    31. CoreSight SoC-400 or earlier
    32. Scanning AP map to find all available APs
    33. AP[1]: Stopped AP scan as end of AP map has been reached
    34. AP[0]: AHB-AP (IDR: 0x24770011)
    35. Iterating through AP map to find AHB-AP to use
    36. AP[0]: Core found
    37. AP[0]: AHB-AP ROM base: 0xE00FF000
    38. CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    39. Found Cortex-M4 r0p1, Little endian.
    40. FPUnit: 6 code (BP) slots and 2 literal slots
    41. CoreSight components:
    42. ROMTbl[0] @ E00FF000
    43. [0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    44. [0][1]: E0001000 CID B105E00D PID 003BB002 DWT
    45. [0][2]: E0002000 CID B105E00D PID 002BB003 FPB
    46. [0][3]: E0000000 CID B105E00D PID 003BB001 ITM
    47. [0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
    48. [0][5]: E0041000 CID B105900D PID 000BB925 ETM
    49. Memory zones:
    50. Zone: Default Description: Default access mode
    51. Cortex-M4 identified.
    52. J-Link>loadfile /home/ju/dev/XXXXXXXXXXXXXXXXXXXXXXXXXXXX/_build/split_v1/bin-gcc/split-dbg.elf
    53. 'loadfile': Performing implicit reset & halt of MCU.
    54. Reset: Halt core after reset via DEMCR.VC_CORERESET.
    55. Reset: Reset device via AIRCR.SYSRESETREQ.
    56. Downloading file [/home/ju/dev/XXXXXXXXXXXXXXXXXXXXXXXXXXXX/_build/split_v1/bin-gcc/split-dbg.elf]...
    57. J-Link: Flash download: Bank 0 @ 0x08000000: 4 ranges affected (24576 bytes)
    58. J-Link: Flash download: Total: 0.776s (Prepare: 0.073s, Compare: 0.080s, Erase: 0.323s, Program & Verify: 0.274s, Restore: 0.024s)
    59. J-Link: Flash download: Program & Verify speed: 87 KB/s
    60. O.K.
    61. J-Link>OnDisconnectTarget() start
    62. OnDisconnectTarget() end
    Display All

    Now, switch back to ozone. It checks that firmware is the same and runs:

    Brainfuck Source Code

    1. Debug.Start();
    2. Device "STM32L471RG" selected.
    3. InitTarget() start
    4. SWD selected. Executing JTAG -> SWD switching sequence.
    5. DAP initialized successfully.
    6. InitTarget() end - Took 4.61ms
    7. Found SW-DP with ID 0x2BA01477
    8. DPIDR: 0x2BA01477
    9. CoreSight SoC-400 or earlier
    10. Scanning AP map to find all available APs
    11. AP[1]: Stopped AP scan as end of AP map has been reached
    12. AP[0]: AHB-AP (IDR: 0x24770011)
    13. Iterating through AP map to find AHB-AP to use
    14. AP[0]: Core found
    15. AP[0]: AHB-AP ROM base: 0xE00FF000
    16. CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    17. Found Cortex-M4 r0p1, Little endian.
    18. FPUnit: 6 code (BP) slots and 2 literal slots
    19. CoreSight components:
    20. ROMTbl[0] @ E00FF000
    21. [0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    22. [0][1]: E0001000 CID B105E00D PID 003BB002 DWT
    23. [0][2]: E0002000 CID B105E00D PID 002BB003 FPB
    24. [0][3]: E0000000 CID B105E00D PID 003BB001 ITM
    25. [0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
    26. [0][5]: E0041000 CID B105900D PID 000BB925 ETM
    27. Connected to target device.
    28. Reset: Halt core after reset via DEMCR.VC_CORERESET.
    29. Reset: Reset device via AIRCR.SYSRESETREQ.
    30. ------------------------------------------- _SetupTarget
    31. Elf.GetBaseAddr(); // returns 0x8041000
    32. Target.ReadU32 (0x08041000); // returns 0x4, data is 0x20018000
    33. Target.SetReg ("SP", 0x20018000);
    34. Elf.GetEntryPointPC(); // returns 0x804C404
    35. Target.SetReg ("PC", 0x804C404);
    36. J-Link: Flash download: Bank 0 @ 0x08000000: Skipped. Contents already match
    37. ------------------------------------------- _SetupTarget
    38. Elf.GetBaseAddr(); // returns 0x8041000
    39. Target.ReadU32 (0x08041000); // returns 0x4, data is 0x20018000
    40. Target.SetReg ("SP", 0x20018000);
    41. Elf.GetEntryPointPC(); // returns 0x804C404
    42. Target.SetReg ("PC", 0x804C404);
    Display All

    What could it be?

    Thanks
    Julien
  • Hello Julien,

    Thank you for your inquiry.
    Could you try the latest version of Ozone V3.30a?
    Do you see the same behaviour there?

    If yes, could you provide a J-Link log of the failing session?
    wiki.segger.com/Enable_J-Link_log_file

    Is the issue reproducible on an eval board?

    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.