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