ArteryTek AT32F413 - Failed to erase/program

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

    • ArteryTek AT32F413 - Failed to erase/program

      Hi,

      I'm using Artery AT32F413 with J-Link, and it seems erase and downloading fails on this chip. Here's what I experienced.

      1. After initiated connection, J-Link complains about secured part and prompted to unlock. After unlocking the chip, reading from flash memory works fine.

      2. Use erase command (with or without arguments) to initiate a mass-erase or sector erase, then I got the following error indicating there was a issue in RAMCode:

      Source Code

      1. J-Link>erase
      2. No address range specified, 'Erase Chip' will be executed
      3. 'erase': Performing implicit reset & halt of MCU.
      4. Reset type: NORMAL (https://wiki.segger.com/J-Link_Reset_Strategies)
      5. Reset: Halt core after reset via DEMCR.VC_CORERESET.
      6. Reset: Reset device via AIRCR.SYSRESETREQ.
      7. Erasing device...
      8. J-Link: Flash download: Only internal flash banks will be erased.
      9. To enable erasing of other flash banks like QSPI or CFI, it needs to be enabled via "exec EnableEraseAllFlashBanks"
      10. ****** Error: Timeout while preparing target, RAMCode did not respond in time!
      11. Failed to perform RAMCode-sided Prepare()
      12. ERROR: Erase returned with error code -1.
      13. J-Link>
      Display All

      3. Disconnect and connect using JLinkExe again, I still got the same secured part prompt with or without a power cycle to the target board. Still, reading protection status gives 0x5AA5 (not secured).

      Source Code

      1. J-Link>Mem32 0x1ffff800 1
      2. 1FFFF800 = FFFF5AA5
      4. Using J-Flash on this device gives similar output, readback/erase always fails no matter the target RAM usage settings. (default 64k, however Artery only has 32k available by default).

      5. Using CMSIS-DAP mode with vendor supplied flash algorithm (CMSIS-Pack) worked fine. Tried using ISP mode to unlock and unsecure device, the unlock was a success, can erase device using CMSIS-DAP mode, still no luck with J-Link software.

      Thanks & Best Regards,
      Yilin Sun