[SOLVED] Open Flash Loader - error during connect - Error: Algo error: Cannot find struct "FlashDevice"

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

  • [SOLVED] Open Flash Loader - error during connect - Error: Algo error: Cannot find struct "FlashDevice"

    Hi Everyone,

    we are using the brand new STM32L5 and at the moment we try to flash a external NOR flash via QSPI.
    We have created our own open flash loader (OFL) an now we try to connect via J-Link.
    Our OFL is based of our last project where it worked very well.
    We add the device at the begin of the JLinkDevices.xml

    XML Source Code

    1. <Device>
    2. <!-- This entry will overwrite the existing device entry in the J-Link software, so that a custom flash algorithm is used for the internal flash -->
    3. <ChipInfo Vendor="ST" Name="STM32L562QE" Core="JLINK_CORE_CORTEX_M33" />
    4. <FlashBankInfo Name="QSPI Flash" BaseAddr="0x090000000" MaxSize="0x00400000 " Loader="ofl.elf" LoaderType="FLASH_ALGO_TYPE_OPEN" AlwaysPresent="0"/>
    5. </Device>

    But if we try to connect the following error is occur:


    Shell-Script

    1. Connecting to J-Link via USB...O.K.
    2. Firmware: J-Link V10 compiled Mar 21 2019 15:43:57
    3. Hardware version: V10.10
    4. S/N: xxxxxxxxx
    5. License(s): GDB
    6. VTref=1.806V
    7. Type "connect" to establish a target connection, '?' for help
    8. J-Link>connect
    9. Please specify device / core. <Default>: STM32L562QE
    10. Type '?' for selection dialog
    11. Device>
    12. Please specify target interface:
    13. J) JTAG (Default)
    14. S) SWD
    15. T) cJTAG
    16. TIF>J
    17. Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
    18. JTAGConf>
    19. Specify target interface speed [kHz]. <Default>: 4000 kHz
    20. Speed>
    21. ****** Error: Algo error: Cannot find struct "FlashDevice"
    22. No valid device has been selected.
    Display All

    We have created a release version of the OFL without optimization. We can find the struct "FlashDevice" in our map-File.
    Any ideas?
    J-Link version is 6.44h.

    Best regards and thx

    \Simon
  • Hello Simon,

    Thank you for your inquiry.
    The error message indicates that the selected target device name could not be found.
    Could you provide the JLinkDevices.xml for reference? Where is is located? In the same folder as the J-Link commander version you are using for verification?
    If not make sure that they are in the same folder otherwise a JLinkDevices.xml from another version could be referenced.

    When the commend prompts "Device>" make sure you type exactly STM32L562QE. Or write ? to get a selection dialogue should you be using windows.

    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.
  • Hi Nino,

    thanks for your answer.
    I have added the file. But I think this is not the problem.
    Without my device entry in the xml file, jlink is connecting to the internal flash from the MCU very well, so I think the xml file will be found.
    I think the problem is in my created Open Flash Loader application but I can't find the mistake.

    If I tried to change the Open Flash Loader to any application, the error was be changed to

    ****** Error: Algo error: Cannot find "PrgData" section.

    So I think that my Open Flash Loader was loaded.

    With my Open Flash Loader the error will be changed to
    ****** Error: Algo error: Cannot find struct "FlashDevice"

    Or is it necessary to adjust my Linker script?

    Thanks a lot

    Best regards,

    Simon
    Files
    • JLinkDevices.xml

      (155.21 kB, downloaded 881 times, last: )
  • Hello Simon,

    Thank you for providing additional items.
    Could you create a support ticket for this inquiry?
    In my signature you can find out how.
    Please also attach the xml and elf file when creating a ticket so we can try to reproduce the reported behaviour.
    To make sure no information gets lost between mutliple channels this thread will be closed now.

    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.