hi 大神们:
用的MCU是AC7801FDLA, SRAM为20K, IAR工程文件和flashloader是官网下载的,在用IAR调试运行时出现非常诡异的问题。
当我的程序用的SRAM超过8K时,第一次通过IAR能download并运行,但是第二次再download就不行了弹出如下错误:
IAR Debug log窗口有如下log:
Thu Nov 11, 2021 12:05:02: IAR Embedded Workbench 8.22.2 (C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\arm\bin\armproc.dll)
Thu Nov 11, 2021 12:05:02: Loaded macro file: Z:\IAR_Workspace\AC7801X_APP\flashloader\FlashAC7801x.mac
Thu Nov 11, 2021 12:05:02: Device "CORTEX-M0+" selected.
Thu Nov 11, 2021 12:05:02: JLINK command: ProjectFile = Z:\IAR_Workspace\AC7801X_APP\settings\AC7801X_Debug.jlink, return = 0
Thu Nov 11, 2021 12:05:02: Device "CORTEX-M0+" selected.
Thu Nov 11, 2021 12:05:02: Selecting SWD as current target interface.
Thu Nov 11, 2021 12:05:02: JTAG speed is initially set to: 1000 kHz
Thu Nov 11, 2021 12:05:02: Found SW-DP with ID 0x0BC11477
Thu Nov 11, 2021 12:05:02: Scanning AP map to find all available APs
Thu Nov 11, 2021 12:05:02: AP[1]: Stopped AP scan as end of AP map has been reached
Thu Nov 11, 2021 12:05:02: AP[0]: AHB-AP (IDR: 0x04770031)
Thu Nov 11, 2021 12:05:02: Iterating through AP map to find AHB-AP to use
Thu Nov 11, 2021 12:05:02: AP[0]: Core found
Thu Nov 11, 2021 12:05:02: AP[0]: AHB-AP ROM base: 0xE00FF000
Thu Nov 11, 2021 12:05:02: CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
Thu Nov 11, 2021 12:05:02: Found Cortex-M0 r0p1, Little endian.
Thu Nov 11, 2021 12:05:03: FPUnit: 4 code (BP) slots and 0 literal slots
Thu Nov 11, 2021 12:05:03: CoreSight components:
Thu Nov 11, 2021 12:05:03: ROMTbl[0] @ E00FF000
Thu Nov 11, 2021 12:05:03: ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
Thu Nov 11, 2021 12:05:03: ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
Thu Nov 11, 2021 12:05:03: ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
Thu Nov 11, 2021 12:05:03: Reset: Halt core after reset via DEMCR.VC_CORERESET.
Thu Nov 11, 2021 12:05:03: Reset: Reset device via AIRCR.SYSRESETREQ.
Thu Nov 11, 2021 12:05:03: Hardware reset with strategy 0 was performed
Thu Nov 11, 2021 12:05:03: Initial reset was performed
Thu Nov 11, 2021 12:05:03: #####execUserFlashInit
Thu Nov 11, 2021 12:05:03: 1652 bytes downloaded (12.91 Kbytes/sec)
Thu Nov 11, 2021 12:05:03: Loaded debugee: Z:\IAR_Workspace\AC7801X_APP\flashloader\FlashAC7801xRAM16K.out
Thu Nov 11, 2021 12:05:03: Target reset
Thu Nov 11, 2021 12:05:04: Unloaded macro file: Z:\IAR_Workspace\AC7801X_APP\flashloader\FlashAC7801x.mac
Thu Nov 11, 2021 12:05:04: The flash loader program reported an error.
Thu Nov 11, 2021 12:06:02: IAR Embedded Workbench 8.22.2 (C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\arm\bin\armproc.dll)
但是只要我的程序把数组改小,使用的SRAM小于8K就可以多次调试了。
怀疑是flashloader的问题,因为flashloader目录下有“FlashAC7801xRAM8K.out”文件,猜测是针对SRAM为8K的MCU制作的,
于是我又去官网下载了flashloader的工程,修改了FlashAC7801xRAM8K.icf文件中RAM的范围为16K(0X20000040~0X20003FFF),自己编译了一个
FlashAC7801xRAM16K.out。
用这个.out替换原来flashloader目录下的,但是还是不行,当程序的SRAM超过8K还是弹出一样的错误。
无奈只能这里求救了。。。。
谢谢
|