[SOLVED] Microsemi A2F500M3G CPU Programming Failure: The flash loader program reported an error

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

  • [SOLVED] Microsemi A2F500M3G CPU Programming Failure: The flash loader program reported an error

    Hello,
    I've been using IAR EWARM and J-Link Plus to program a Microsemi PSoC chip (A2F500M3G-FGG256) for a few years and have recently run into a problem on one of my boards. I attempted to upload some new code to the CPU and ran into an error: "The floash loader program reported an error."

    The IAR-EWARM debug log outputs the following:
    Mon Aug 07, 2017 13:31:16: JLINK command: ProjectFile = C:\###REDACTED###.jlink, return = 0
    Mon Aug 07, 2017 13:31:16: Device "A2F500M3G" selected.
    Mon Aug 07, 2017 13:31:16: DLL version: V6.18
    Mon Aug 07, 2017 13:31:16: Firmware: J-Link V9 compiled Jul 24 2017 17:37:57
    Mon Aug 07, 2017 13:31:16: Selecting SWD as current target interface.
    Mon Aug 07, 2017 13:31:16: JTAG speed is initially set to: 1000 kHz
    Mon Aug 07, 2017 13:31:16: Found SW-DP with ID 0x1BA01477
    Mon Aug 07, 2017 13:31:16: Scanning AP map to find all available APs
    Mon Aug 07, 2017 13:31:16: AP[1]: Stopped AP scan as end of AP map has been reached
    Mon Aug 07, 2017 13:31:16: AP[0]: AHB-AP (IDR: 0x14770011)
    Mon Aug 07, 2017 13:31:16: Iterating through AP map to find AHB-AP to use
    Mon Aug 07, 2017 13:31:16: AP[0]: Core found
    Mon Aug 07, 2017 13:31:16: AP[0]: AHB-AP ROM base: 0xE00FF000
    Mon Aug 07, 2017 13:31:16: CPUID register: 0x411FC231. Implementer code: 0x41 (ARM)
    Mon Aug 07, 2017 13:31:16: Found Cortex-M3 r1p1, Little endian.
    Mon Aug 07, 2017 13:31:16: FPUnit: 6 code (BP) slots and 2 literal slots
    Mon Aug 07, 2017 13:31:16: CoreSight components:
    Mon Aug 07, 2017 13:31:16: ROMTbl[0] @ E00FF000
    Mon Aug 07, 2017 13:31:16: ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 001BB000 SCS
    Mon Aug 07, 2017 13:31:16: ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 001BB002 DWT
    Mon Aug 07, 2017 13:31:16: ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB003 FPB
    Mon Aug 07, 2017 13:31:16: ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 001BB001 ITM
    Mon Aug 07, 2017 13:31:16: ROMTbl[0][4]: E0040000, CID: B105900D, PID: 001BB923 TPIU-Lite
    Mon Aug 07, 2017 13:31:16: Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Mon Aug 07, 2017 13:31:16: Reset: Reset device via AIRCR.VECTRESET.
    Mon Aug 07, 2017 13:31:16: Hardware reset with strategy 1 was performed
    Mon Aug 07, 2017 13:31:16: Initial reset was performed
    Mon Aug 07, 2017 13:31:16: 1224 bytes downloaded (25.99 Kbytes/sec)
    Mon Aug 07, 2017 13:31:16: Loaded debugee: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\config\flashloader\Microsemi\FlashA2FxxxM3F.out
    Mon Aug 07, 2017 13:31:16: Target reset
    Mon Aug 07, 2017 13:31:16: The flash loader program reported an error.

    I also noticed that the MSS_RESET_N line is pulsing low for about 7 ms every 250 ms. The PSoC is configured to keep the MSS_RESET_N line held low for 250 ms during initial power-on which makes me think the chip is going through its power-on reset routine over and over.

    If I disable the flash loader in my Project Settings -> Debugger -> Download tab I am able to attach the debugger to the CPU. The code immediately jumps to the hardfault in this case. One thing I noticed here is that while I am in this mode, the FPGA fabric portion of the PSoC operates normally. I can confirm this via a blinking test LED which is driven by the FPGA fabric's clock and reset lines. Once I disconnect from the chip, the FPGA goes back into a hung state.

    Please excuse any ill assumptions I've made in my problem description. I'm usually not this deep in the weeds with this device so I may be short in my understanding. If there's anything else I can add to aid in describing the problem more accurately, just let me know and I'll be more than happy to provide that information.

    Thanks for your help

    The post was edited 2 times, last by L3EDD ().

  • Attempted to erase the flash (unsuccessfully)

    I also tried to erase the flash using J-Link Commander in an attempt to get it back into an operating state. I ran into another error here as well. Here is the output from the session:

    SEGGER J-Link Commander V5.12h (Compiled Jun 29 2016 17:47:46)
    DLL version V5.12h, compiled Jun 29 2016 17:47:05
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V9 compiled Jul 24 2017 17:37:57
    Hardware version: V9.30
    S/N: 609301610
    License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    VTref = 0.333V

    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Please specify device / core. <Default>: A2F500M3G
    Type '?' for selection dialog
    Device>
    Please specify target interface:
    J) JTAG (Default)
    S) SWD
    TIF>
    Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
    JTAGConf>
    Specify target interface speed [kHz]. <Default>: 4000 kHz
    Speed>
    Device "A2F500M3G" selected.

    TotalIRLen = 4, IRPrint = 0x01
    Found Cortex-M3 r1p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl 0 @ E00FF000
    ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 001BB000 SCS
    ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 001BB002 DWT
    ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 000BB003 FPB
    ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 001BB001 ITM
    ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 001BB923 TPIU-Lite
    Found 1 JTAG device, Total IRLen = 4:
    #0 Id: 0x3BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
    Cortex-M3 identified.
    J-Link>erase
    Erasing device (A2F500M3G)...
    ****** Error: Failed to erase sectors 0 @ address 0x60000000 (program error)
    J-Link: Flash download: Total time needed: 1.855s (Prepare: 0.058s, Compare: 0.0
    00s, Erase: 0.075s, Program: 0.000s, Verify: 0.000s, Restore: 1.721s)
    ERROR: Erase returned with error code -5.
    J-Link>
  • Hi,

    for a few years and have recently run into a problem on one of my boards.

    This sound like a hardware issue.

    VTref = 0.333V

    Could you please check if the voltage is correct?
    What is the voltage of a working board in J-Link Commander?


    Best regards,
    Niklas
    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.
  • Hello Niklas,

    Thank you for the assistance.

    Yes, you are correct. Looks like the 3.3v rail wasn't up when I connected to it at first. A working board has a VTref of 3.3v

    I reconnected to the problem board and got the correct VTref of 3.3v -- unfortunately still without the ability to erase the chip:

    SEGGER J-Link Commander V5.12h (Compiled Jun 29 2016 17:47:46)
    DLL version V5.12h, compiled Jun 29 2016 17:47:05
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V9 compiled Jul 24 2017 17:37:57
    Hardware version: V9.30
    S/N: 609301610
    License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    VTref = 3.308V

    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Please specify device / core. <Default>: A2F500M3G
    Type '?' for selection dialog
    Device>
    Please specify target interface:
    J) JTAG (Default)
    S) SWD
    TIF>
    Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
    JTAGConf>
    Specify target interface speed [kHz]. <Default>: 4000 kHz
    Speed>
    Device "A2F500M3G" selected.

    TotalIRLen = 4, IRPrint = 0x01
    Found Cortex-M3 r1p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl 0 @ E00FF000
    ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 001BB000 SCS
    ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 001BB002 DWT
    ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 000BB003 FPB
    ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 001BB001 ITM
    ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 001BB923 TPIU-Lite
    Found 1 JTAG device, Total IRLen = 4:
    #0 Id: 0x3BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
    Cortex-M3 identified.
    J-Link>erase
    Erasing device (A2F500M3G)...
    ****** Error: Failed to erase sectors 0 @ address 0x60000000 (program error)
    J-Link: Flash download: Total time needed: 1.855s (Prepare: 0.056s, Compare: 0.0
    00s, Erase: 0.075s, Program: 0.000s, Verify: 0.000s, Restore: 1.723s)
    ERROR: Erase returned with error code -5.
    J-Link>
  • Hi,


    do I understand you correctly that both issues (1. Does not work in IAR 2. Erase in J-Link Commander does not work) only occur with this one board,
    and all other boards continue to work fine?

    If yes, this seems to be an hardware issue of the specific board. (Could also be an issue of the target application under certain circumstances).
    If no, I will give it a try on a similar board and see if I can reproduce the issue.


    Best regards,
    Niklas
    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.
  • Yes, you are correct. This issue is only found on one board. I've since spoken with an FAE from Microsemi and they've determined the issue is as you suspected: hardware failure. Thank you for your assistance.
  • Hi,


    thanks for updating the thread!
    Good to hear that you could confirm the cause of this issue.

    Best regards,
    Niklas
    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.