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

  • Hi ,

    Is it the first time that you tried to download the code on these two boards?

    How did you tried to do the mass erase? Via IAR, right?

    Try to open the the J-Link Control Panel by clicking the icon below,. The icon appears when a Jlink session is opened (e.g. from IAR).

    Check that the device and the voltage are properly detected by the JLink as shown 

    If it is not recognized properly, please send us the information on the Log tab of the Control panel, as well as a screenshot with the General tab.

    Another thing that you can try is to download your code using the UART bootloader (instead of using the Serial Wire).

    You can download the flash programmer here CrossCore Serial Flash Programmer | Analog Devices 

    In order to force the kernel to execute the UART bootloader you need:

    1) Press BOOT button (BMODE shall be zero)

    2) Press RESET button

    3) Release RESET button

    4) Release BOOT button

    I hope this helps,

  • Hi, thanks for your answer.

    In fact I have ten cards that are identical, and I flashed my code on the others ( through IAR ) and it worked very well, however two of these cards make me this problem, and yes i have already flash some code on these and it worked, but not now.

    I tried to erase Flash memory through J-Link commander, but i can't unlock Kinetis, so i can't erase flash. 

    I checked the J-link control panel and all is correct ( at least same configuration that the other card, and good supply voltage) : 

    I still believe that it is and hardware problem, but i quickly checked pin's connection solder, and they work.

    Best regards,

    Florent

  • Hi,

    two quick things:

    • is 3.7 the voltage you want?
    • the communication interface should be Serial Wire instead JTAG. You can try to change it from the project options and erase the part again.

    The method @moreseg suggested to erase the memory is a bit different, it doesn't require a jlink device, so maybe if you program a while(1) program through this, the part can be recovered.

    Best regards.

  • Hi, thanks for your help.

    Yes 3.7 is the correct voltage, and i tried with a SW interface connection and i had the same problem. 

    I also tried to program a while(1) program and it doesn't work. I still believe that the problem came from the hardware device, because my method work effectively with the other boards. Nevertheless, i didn't find any mistakes on my board when i checked the different pin's voltage.

    Best regards,

    Florent

  • Hi,

    ok, let's see some things on the hardware side.

    • Can you measure the voltage on pin Vldo_out (pin 12)? at least with two decimal digits of resolution.
    • You also can try to capture with the oscilloscope this voltage in order to see some variations.
    • Can you measure the voltage on pin SYS_HWRST (pin 25)?
    • Could you measure the current consumption of the MCU? try to keep GPIO floating and the JLINK disconnected in all those measures.

    and now from the programmer, connect the JLINK programmer and go to C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.5\arm\bin\jlink.exe. This is a command line interface to the programmer. You have to type (underlined in red in the picture):

    • "connect"
    • select the part, in your case "ADUcM3029"
    • select the interface to the programmer: "S" for Serial Wire
    • and speed, for instance "1000"

    In the core and the programmer interface is ok, the SWD-DP and the core should be identified (marked in blue).

    is this your case?

    Apart from that, did you configure CRC correctly on the linker tab on IAR? You can check it as shown here: IAR CRC configuration 

    When you tried to download the while(1) program, did you use the serial flash programmer?

    Best regards.