Post Go back to editing

Error "The flash loader program reported an error"

Hi support team, 

I use IAR, and i got many board ( all exactly the same ) with sensors control by an ADUCM3029. All cards work very well, but two of them give me an error when i want to flash the code on the board :

"The flash loader program reported an error"

"A fatal error has occurred, the debugger will terminate"

I use a J-Link debugger, and i checked on J-link commander software ( and also manualy)  the voltage of different pin, and the supply  voltage, and all is correct, and the device is identified correctly.

I also tried to erase flash memory, but i didn't solve the problem.

The following line are my error message on IAR worspace :

Tue Aug 01, 2017 16:36:01: Loaded macro file: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.2\arm\config\flashloader\AnalogDevices\FlashADUCM3029.mac  Tue Aug 01, 2017 16:36:01: JLINK command: ProjectFile = C:\Users\avouaill\Desktop\workspace\Puck_project_debug_Beacon_Juillet_2017\Puck_project\settings\second_test_Debug.jlink, return = 0  Tue Aug 01, 2017 16:36:01: Device "ADUCM3029" selected.  Tue Aug 01, 2017 16:36:01: DLL version: V6.10c, compiled Sep 28 2016 18:45:15  Tue Aug 01, 2017 16:36:01: Firmware: J-Link Lite-ADI Rev.1 compiled Jan  7 2013 17:58:04  Tue Aug 01, 2017 16:36:01: Selecting SWD as current target interface.  Tue Aug 01, 2017 16:36:01: JTAG speed is initially set to: 1000 kHz  Tue Aug 01, 2017 16:36:01: Found SWD-DP with ID 0x2BA01477  Tue Aug 01, 2017 16:36:01: AP-IDR: 0x24770011, Type: AHB-AP  Tue Aug 01, 2017 16:36:01: Found Cortex-M3 r2p1, Little endian.  Tue Aug 01, 2017 16:36:01: FPUnit: 2 code (BP) slots and 0 literal slots  Tue Aug 01, 2017 16:36:01: CoreSight components:  Tue Aug 01, 2017 16:36:01: ROMTbl 0 @ E00FF000  Tue Aug 01, 2017 16:36:01: ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB000 SCS  Tue Aug 01, 2017 16:36:01: ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT  Tue Aug 01, 2017 16:36:01: ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB  Tue Aug 01, 2017 16:36:01: Hardware reset with strategy 3 was performed  Tue Aug 01, 2017 16:36:01: Initial reset was performed  Tue Aug 01, 2017 16:36:02: -I- execUserFlashInit!  Tue Aug 01, 2017 16:36:02: 904 bytes downloaded (18.78 Kbytes/sec)  Tue Aug 01, 2017 16:36:02: Loaded debugee: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.2\arm\config\flashloader\AnalogDevices\FlashADUCM3029.out  Tue Aug 01, 2017 16:36:02: Target reset  Tue Aug 01, 2017 16:36:02: Unloaded macro file: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.2\arm\config\flashloader\AnalogDevices\FlashADUCM3029.mac  Tue Aug 01, 2017 16:36:02: The flash loader program reported an error. 

Any idea let me know,

Best regards,

Florent

Top Replies

Parents
  • Hi ,

    if you erased the flash memory, do you get the same error when you try to program? Have you done a power cycle after erasing?

    PC address is 0x1..., this is not Flash, it's instruction SRAM. I assume you don't want to execute from SRAM but from Flash, doesn't it?. The error when you read 0x800 is consistent with the previous screenshot: you can't read from Flash. The flash memory is locked somehow. Now, we know what's the problem and we have to discover why. This typically can occurs due to a CRC error.

    I think it should work after erasing and power cycling, maybe you can try to program a while(1) after that. If it continues showing the flash error when programming, we can try this from the command line:

    1. we can read the Flash controller status register (figure 8-21 http://www.analog.com/media/en/dsp-documentation/processor-manuals/ADuCM302x-mixed-signal-control-processor-hardware-reference.pdf , address 0x40018000), Signature (0x4001802C) and ECC status (0x40018048). The way to do that is the same as before: mem32 0x400180.., 1.
    2. Read the position of the CRC for the user code (mem32 0x7FC, 1). It should match to the IAR generated checksum after linking (see build tab in IAR after rebuilding).
    3. I hope this could give us a clue: if there is some command fail, it's sleeping, a ECC error, a sign error, etc. and taking some actions.
    4. And if we don't know how to continue, we could try a mass erase (page 8-26)
      1. Write the USERKEY in FLCC_KEY (0x40018020).
      2. Write 7 in FLCC_CMD to erase the flash memory.
      3. Read status again to check the operation it's ok.
      4. Reset.

    Best regards.

Reply
  • Hi ,

    if you erased the flash memory, do you get the same error when you try to program? Have you done a power cycle after erasing?

    PC address is 0x1..., this is not Flash, it's instruction SRAM. I assume you don't want to execute from SRAM but from Flash, doesn't it?. The error when you read 0x800 is consistent with the previous screenshot: you can't read from Flash. The flash memory is locked somehow. Now, we know what's the problem and we have to discover why. This typically can occurs due to a CRC error.

    I think it should work after erasing and power cycling, maybe you can try to program a while(1) after that. If it continues showing the flash error when programming, we can try this from the command line:

    1. we can read the Flash controller status register (figure 8-21 http://www.analog.com/media/en/dsp-documentation/processor-manuals/ADuCM302x-mixed-signal-control-processor-hardware-reference.pdf , address 0x40018000), Signature (0x4001802C) and ECC status (0x40018048). The way to do that is the same as before: mem32 0x400180.., 1.
    2. Read the position of the CRC for the user code (mem32 0x7FC, 1). It should match to the IAR generated checksum after linking (see build tab in IAR after rebuilding).
    3. I hope this could give us a clue: if there is some command fail, it's sleeping, a ECC error, a sign error, etc. and taking some actions.
    4. And if we don't know how to continue, we could try a mass erase (page 8-26)
      1. Write the USERKEY in FLCC_KEY (0x40018020).
      2. Write 7 in FLCC_CMD to erase the flash memory.
      3. Read status again to check the operation it's ok.
      4. Reset.

    Best regards.

Children