Problem with recent JLinkARM.dll with IAR EWARM 5.20

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

  • Problem with recent JLinkARM.dll with IAR EWARM 5.20

    When using JlinkARM.dll versions between 4.54c and 4.56a (inclusive) to flash my device for debugging, the image ends up with one 2KB page of flash remaining erased in the middle of the image.

    When I look at the information in the binary produced by IAR (including an Intel HEX format file of the image), it looks like the correct data is produced by the compiler & linker for that page. The page is incorrectly flashed/left erased and no problem is indicated after the verification pass of the flashing process.

    The device we're programming is an ST Micro STM32F103ZE; the page the has the problem is 0x08062800 but that will change according to the base address of where the image is loaded (which I did to see if the problem page stayed at the same address or not if the load address was changed).

    If I rollback the JLinkARM.dll driver to version 4.34d, the problem goes away.

    I have no versions between 4.34d and 4.54c to check where the problem first shows up.

    This problem reproduces 100% for my project, but I have no idea what the factor in the project is that causes this problem (other than the version of the JLinkARM.dll). Please let me know if you need more information.
  • Hi,

    Can you provide a sample project which runs on an eval board and allows reproduction here?
    If reproducible, we can check what is going wrong here.


    Best regards
    Alex
    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.
  • Alex:

    I can't dig up an eval board here that has enough flash to hold the image (I've got a STM32-SK, but it only has 128KB of flash). I can pretty easily configure the project for a 256KB board and send you the *.out and *.sim files files generated by IAR, I can also send the image as an Intel hex formatted file.

    I won't be able to send the whole project, but all that needs to happen is for the image to be flashed - you don't need to build the project. The page that has been left erased is always the same, so it's easy to verify the problem happening with the new JLink driver (and not happening with the older one). Sould I send a link to the package to download to info@segger.com?
  • Hi,

    Please send it to segger.com/support/technical-support/
    We will check what is going wrong there but we are not aware of any problems with the current version.


    Best regards
    Alex
    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.
  • OK, I've sent an email with a link to an IAR project that should reproduce the problem. In preparing the project I've found more information:

    While preparing this repro case, I've determined the settings that seem to trigger the problem. The reproduce the problem, you must:

    • use a relatively new JLinkARM.dll (I have reproduced the problem with versions 4.54c through 4.56a)
    • have at least one breakpoint set.
    • have the following IAR project setting enabled/checked:

    Source Code

    1. Debugger | Download | "Use flash loader(s)"


    I noticed the following difference in the Debug log output between JLinkARM.dll v4.34d (which does not have the problem) and JLinkARM.dll v4.56a. I've marked the lines of interest with ">>>":

    Source Code

    1. JLinkARM.dll v4.34d (no problem)
    2. ================================
    3. ...
    4. Thu Nov 08 12:32:16 2012: DLL version: V4.34d, compiled Sep 13 2011 17:28:37
    5. Thu Nov 08 12:32:16 2012: Firmware: J-Link ARM V8 compiled Sep 20 2012 13:27:01
    6. ...
    7. Thu Nov 08 12:32:33 2012: Loaded debugee: C:\temp\segger.test\Debug\Exe\CourseEng.out
    8. Thu Nov 08 12:32:33 2012: TotalIRLen = 9, IRPrint = 0x0011
    9. Thu Nov 08 12:32:33 2012: Found Cortex-M3 r1p1, Little endian.
    10. Thu Nov 08 12:32:33 2012: TPIU fitted.
    11. Thu Nov 08 12:32:33 2012: ETM fitted.
    12. Thu Nov 08 12:32:33 2012: FPUnit: 6 code (BP) slots and 2 literal slots
    13. Thu Nov 08 12:32:33 2012: Software reset was performed
    14. Thu Nov 08 12:32:33 2012: Target reset
    15. >>> Thu Nov 08 12:32:33 2012: Program size too small. Flash download skipped.
    16. Thu Nov 08 12:32:35 2012: Update all software breakpoints was performed
    17. JLinkARM.dll v4.56a
    18. ================================
    19. ...
    20. Thu Nov 08 12:35:52 2012: DLL version: V4.56a, compiled Nov 5 2012 21:29:58
    21. Thu Nov 08 12:35:52 2012: Firmware: J-Link ARM V8 compiled Sep 20 2012 13:27:01
    22. ...
    23. Thu Nov 08 12:36:09 2012: Loaded debugee: C:\temp\segger.test\Debug\Exe\CourseEng.out
    24. Thu Nov 08 12:36:09 2012: Found Cortex-M3 r1p1, Little endian.
    25. Thu Nov 08 12:36:09 2012: TPIU fitted.
    26. Thu Nov 08 12:36:09 2012: ETM fitted.
    27. Thu Nov 08 12:36:09 2012: FPUnit: 6 code (BP) slots and 2 literal slots
    28. Thu Nov 08 12:36:09 2012: Software reset was performed
    29. Thu Nov 08 12:36:09 2012: Target reset
    30. >>> Thu Nov 08 12:36:10 2012: J-Link: Flash download: Flash programming performed for 1 range (2048 bytes)
    31. >>> Thu Nov 08 12:36:10 2012: J-Link: Flash download: Total time needed: 0.318s (Prepare: 0.117s, Compare: 0.017s, Program: 0.127s, Verify: 0.018s, Restore: 0.037s)
    32. Thu Nov 08 12:36:11 2012: Update all software breakpoints was performed
    Display All

    The post was edited 1 time, last by mwb1100 ().

  • Hi,

    Thanks for providing the project.
    Not sure if it is really a problem on the J-Link side or if it just worked with luck before.

    Possible workaround for now:
    Does it work correctly when just disabling the "Use flash loader(s)" option?
    This will cause the IAR flashloader to be disabled, so the J-Link DLL internal flashloader performs the download.


    Best regards
    Alex
    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,

    We checked this and the problem is that IAR V5.20 has a couple of problems with Cortex-M since it does not use the J-Link API correctly.
    So it is not a problem on the J-Link side.
    There are multiple problems that come together here but mainly it is because EWARM does not use the J-Link API correctly, so breakpoints, unlimited flash breakpoints and the flashloader interfere with each other.
    It worked with the older version of the DLL since this had a flash download limitation that has been lifted in the meanwhile, so it was kind of luck that it worked before...

    For you the easiest workaround when using EWARM V5.20 would be to disable the J-Link flashloader and unlimited flash breakpoints for this project:
    To do so:
    - Start debug session
    - Open J-Link control panel (click tray icon in the lower right corner)
    - Configure as shown in the attached screenshot
    - Restart debug session


    Best regards
    Alex
    Images
    • DisableJLinkFlashloader.gif

      11.46 kB, 566×381, viewed 1,036 times
    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.
  • Thanks for looking into this.

    Would it work just as well to uncheck the "Debugger | Download | "Use flash loader(s)" option in the IAR project? Or do we need to do *both* things (uncheck the IAR project option *and* perform the JLink configuration you described?).

    I have sometimes wondered about the "Use flash loader(s)" option in the IAR project - I seem to recall that it was turned on way back when because of problems we ran into when it wasn't checked. But that could be my memory playing tricks on me (this is a pretty mature project, so the 'decisions' made for those settings would have been done more than 3 years ago). I've never felt comfortable that I really understood what effect that option had.

    --
    Mike B
  • Hi,

    What you need to do for EWARM V5.20:
    - Disable J-Link flashloader and unlimited flash breakpoints (as indicated by the screenshot in my previous post)
    - Have "Use flash loader(s)" in EWARM selected.

    For later versions of EWARM this is not necessary since they use the J-Link API correctly.


    Best regards
    Alex
    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.