ZYNQ开发日记:CPU1无法下载程序Memory write error at 0x200A0000. AP transaction timeout

开发ZYNQ的双核程序,在做修改后突然发现Run模式运行会出现第一个核心可以下载程序并启动,但第二个核心会出现问题无法下载程序,具体的错误提示如下:
Memory write error at 0x200A0000. AP transaction timeout
Cannot reset APU. APB AP transaction error, DAP status 0xF0000021

XSDB Console日志如下

Info: ARM Cortex-A9 MPCore #0 (target 2) Stopped at 0x0 (Vector Catch)
Downloading Program -- /home/fang/workspace/zynq7015/25_ov5640_lcd/vitisnew/hello_world/build/hello_world.elf
        section, .text: 0x00100000 - 0x001194eb
        section, .init: 0x001194ec - 0x001194f7
        section, .fini: 0x001194f8 - 0x00119503
        section, .rodata: 0x00119508 - 0x0011a7e2
        section, .data: 0x0011a7e8 - 0x0011aed7
        section, .mmu_tbl: 0x0011c000 - 0x0011ffff
        section, .ARM.exidx: 0x00120000 - 0x00120007
        section, .init_array: 0x00120008 - 0x0012000f
        section, .fini_array: 0x00120010 - 0x00120013
        section, .drvcfg_sec: 0x00120018 - 0x00120a23
        section, .bss: 0x00120a40 - 0x00123a8f
        section, .heap: 0x00123a90 - 0x04123a8f
        section, .stack: 0x04123a90 - 0x0812528f
100%    0MB   0.3MB/s  00:00    
Setting PC to Program Start Address 0x00100000
Successfully downloaded /home/fang/workspace/zynq7015/25_ov5640_lcd/vitisnew/hello_world/build/hello_world.elf
Info: ARM Cortex-A9 MPCore #0 (target 2) Running
Info: ARM Cortex-A9 MPCore #1 (target 3) Stopped at 0x0 (Vector Catch)
Downloading Program -- /home/fang/workspace/zynq7015/25_ov5640_lcd/vitisnew/cpu1_apriltag/build/cpu1_apriltag.elf
        section, .text: 0x20080000 - 0x200a4d03
        section, .init: 0x200a4d04 - 0x200a4d0f
        section, .fini: 0x200a4d10 - 0x200a4d1b
        section, .rodata: 0x200a4d20 - 0x200a8f6d
        section, .data: 0x200a8f70 - 0x200aa8b3
        section, .mmu_tbl: 0x200ac000 - 0x200affff
        section, .ARM.exidx: 0x200b0000 - 0x200b0007
        section, .init_array: 0x200b0008 - 0x200b000b
        section, .fini_array: 0x200b000c - 0x200b000f
        section, .drvcfg_sec: 0x200b0010 - 0x200b061b
        section, .bss: 0x200b0620 - 0x201af21b
        section, .heap: 0x201af21c - 0x241af21f
        section, .stack: 0x241af220 - 0x281b0a1f
aborting, 1 pending requests... 
Failed to download /home/fang/workspace/zynq7015/25_ov5640_lcd/vitisnew/cpu1_apriltag/build/cpu1_apriltag.elf
Info: ARM Cortex-A9 MPCore #1 (target 3) Running (APB AP transaction error, DAP status 0xF0000021)

后来经过观察,发现下载完第一个核心,程序立刻启动,然后才下载第二个核心的程序并启动,怀疑可能是第一个程序内部的问题。

经过排查发现,只要CPU0启动,但CPU1没有启动时,向内存写入数据,并执行Xil_DCacheFlush会导致第二个核心无法启动

((u8 *)(XPAR_PS7_DDR_0_BASEADDRESS+0x1000000))[(800)*3] =0;
Xil_DCacheFlush();

posted on 2025-11-24 16:55  一想到  阅读(1)  评论(0)    收藏  举报