[ABANDONED] Flashloader of each OS

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

  • [ABANDONED] Flashloader of each OS

    Suppose that the flashloader is for all OS as Windows/Linux/MacOS, does it?
    I got strange result when loadbin for specific address with my flashloader on MacOS but it works well on Linux and Windows with JLinkExe of v7.82a
    I found from log, the sectors was analyzed differently for the same bin file and the same address to program.

    Operating on Linux:

    Source Code

    1. Looking for J-Link GUI Server exe at: /opt/SEGGER/JLink_V782a/JLinkGUIServerExe
    2. T8672F740 005:137.204 Forking J-Link GUI Server: /opt/SEGGER/JLink_V782a/JLinkGUIServerExe
    3. T8672F740 005:464.821 Failed to connect to J-Link GUI Server.
    4. T8672F740 005:464.898 -- CPU speed could not be measured.
    5. T8672F740 005:464.960 -- Start of comparing flash
    6. T8672F740 005:464.986 -- Flash algorithm supports a native verify function which is used to compare the flash content.
    7. T8672F740 005:465.013 -- Comparing range 0x10038000 - 0x1003FFFF (8 Sectors, 32 KB), using verify function of the RAMCode
    8. T8672F740 005:465.041 -- Recalculating RAMUsage for optimal performance during programming
    9. T8672F740 005:465.073 --
    10. T8672F740 005:465.092 -- Recalculating RAMUsage for optimal performance during programming
    11. T8672F740 005:465.116 --
    12. T8672F740 005:477.577 -- Data does not match for sectors 56-63
    13. T8672F740 005:477.660 -- End of comparing flash
    14. T8672F740 005:477.691 -- Start of erasing sectors
    15. T8672F740 005:477.722 -- Erasing range 0x10038000 - 0x1003FFFF ( 8 Sectors, 32 KB)
    16. T8672F740 005:477.750 -- Recalculating RAMUsage for optimal performance during programming
    17. T8672F740 005:477.776 --
    18. T8672F740 005:477.795 -- Initializing RAMCode (InitType: 1 = Erase)
    19. T8672F740 005:477.821 --
    20. T8672F740 005:477.870 -- Executing UnInit()
    21. T8672F740 005:477.896 --
    22. T8672F740 005:480.769 -- Executing Init(1)
    23. T8672F740 005:480.823 --
    24. T8672F740 005:835.376 -- End of erasing sectors
    25. T8672F740 005:835.429 -- Start of flash programming
    26. T8672F740 005:835.451 -- Programming range 0x10038000 - 0x1003FFFF ( 8 Sectors, 32 KB)
    27. T8672F740 005:835.472 -- Recalculating RAMUsage for optimal performance during programming
    28. T8672F740 005:835.483 --
    29. T8672F740 005:835.507 -- Initializing RAMCode (InitType: 2 = Program)
    30. T8672F740 005:835.525 --
    31. T8672F740 005:835.539 -- Executing UnInit()
    Display All

    Operating on MacOS:

    Brainfuck Source Code

    1. T14132C0 001:702.373 Looking for J-Link GUI Server exe at: /Applications/SEGGER/JLink_V780/JLinkGUIServerExe
    2. T14132C0 001:702.507 Forking J-Link GUI Server: /Applications/SEGGER/JLink_V780/JLinkGUIServerExe
    3. T14132C0 001:706.161 J-Link GUI Server info: "J-Link GUI server V7.82a "
    4. T14132C0 001:711.535 -- CPU speed could not be measured.
    5. T14132C0 001:711.574 -- Start of comparing flash
    6. T14132C0 001:711.597 -- Flash algorithm supports a native verify function which is used to compare the flash content.
    7. T14132C0 001:762.182 -- Comparing range 0x10038000 - 0x10038FFF (1 Sector, 4 KB), using verify function of the RAMCode
    8. T14132C0 001:762.220 -- Recalculating RAMUsage for optimal performance during programming
    9. T14132C0 001:762.230 --
    10. T14132C0 001:762.237 -- Recalculating RAMUsage for optimal performance during programming
    11. T14132C0 001:762.246 --
    12. T14132C0 001:914.218 -- Data does not match for sector 56
    13. T14132C0 001:914.283 -- End of comparing flash
    14. T14132C0 001:914.304 -- Start of erasing sectors
    15. T14132C0 001:914.325 -- Erasing range 0x10038000 - 0x10038FFF ( 1 Sector, 4 KB)
    16. T14132C0 001:914.342 -- Recalculating RAMUsage for optimal performance during programming
    17. T14132C0 001:914.357 --
    18. T14132C0 001:983.192 -- End of erasing sectors
    19. T14132C0 001:983.212 -- Start of flash programming
    20. T14132C0 001:983.224 -- Programming range 0x10038000 - 0x10038FFF ( 1 Sector, 4 KB)
    21. T14132C0 001:985.594 -- Recalculating RAMUsage for optimal performance during programming
    22. T14132C0 001:985.609 --
    23. T14132C0 001:985.617 -- Program page timeout too high. Use default timeout: 10000 [s]
    24. T14132C0 001:985.628 --
    25. T14132C0 012:760.814
    26. ***** Error:
    27. T14132C0 012:760.997
    28. PC of target system has unexpected value after programming sector. (PC = 0x00000000)!
    29. ---------------------------------------------------------------------- Registers -------------------------------------------------------------------------------------
    30. PC = 00000000
    31. Current: R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    32. R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    33. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    34. T14132C0 012:773.215
    35. ***** Error:
    36. T14132C0 012:773.348 Programming failed (error code = -1) for block @ address 0x10038000 (207479589)
    37. T14132C0 012:773.399 -- End of flash programming
    38. T14132C0 012:773.464 -- Start of restoring
    39. T14132C0 012:773.508 -- End of restoring
    40. T14132C0 012:785.750 Restarting due to program error (possibly skipped erasure of half-way erased sector).
    Display All
  • If switch the loadbin procedure to loadbin another file and it works.
    If change the loadbin address to exclue the baseaddress and it works.
    if updated the bin file with padding and it works.

    Is it reasonable for these tree operations?

    Thanks.
  • Without a complete J-Link log file for both cases:
    • good (e.g. Windows/Linux)
    • bad (macOS)
    it is not possible to help here further.
    wiki.segger.com/Enable_J-Link_log_file
    The log file would give more insight if you are actually working with identical settings or you just think you are.

    I assume that you have written your own flash loader.
    Are you 100% sure that you are using the same version of the flash loader on the good and bad platforms?
    Just to make sure that your macOS setup is not using an old version of your flash loader where some of your latest changes where not implemented yet.
    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.