尝试在 STM32H743VITx 设备上加载调试目标时收到错误
:WARNING:builder:Chip erase used when flash address 0x8020000 is not the same as flash start 0x8000000
。这会在调试会话期间覆盖引导加载程序并使固件崩溃。
。我在 custom_target json 中设置了正确的 mbed_rom_start ,并且构建和加载发布版本确实会正确闪烁,但之后会在某个地方崩溃。这就是我尝试运行设备上调试器的原因。问题是 pyocd 闪存擦除使用 0x80000 作为闪存地址,而不是 0x8020000。
"bootloader_supported": true,
"mbed_rom_start": "0x8020000",
"mbed_ram_size": "0x100000",
"mbed_size": "0x200000",
"mbed_ram_start": "0x20000000",
是否有办法配置调试目标以使用正确的地址?我还做错了什么吗?我尝试将基地址添加到调试标志,但启动服务器时出错。
--target STM32H743VITx --erase=chip --frequency 1800000 --pack '/Library/Application Support/Mbed Studio/mbed-studio-tools/cmsis-packs/Keil.STM32H7xx_DFP.2.7.0-small.pack' -O connect_mode=under-reset
我还尝试使用
更新
STM32H743VITx
中的
./mbed-os/tools/arm_pack_manager/index.json
目标
"algorithms": [
{
"default": true,
"file_name": "CMSIS/Flash/STM32H7x_2048.FLM",
"ram_size": 1048576,
"ram_start": 536870912,
"size": 2097152,
"start": 134348800
}
==================
Selected port 50000 for debugging
0000452:INFO:board:Target type is stm32h743vitx
0000527:INFO:coresight_target:Asserting reset prior to connect
0000585:INFO:dap:DP IDR = 0x6ba02477 (v2 rev6)
0000639:INFO:ap:AHB-AP#0 IDR = 0x84770001 (AHB-AP var0 rev8)
0000641:INFO:ap:AHB-AP#1 IDR = 0x84770001 (AHB-AP var0 rev8)
0000643:INFO:ap:APB-AP#2 IDR = 0x54770002 (APB-AP var0 rev5)
0000648:INFO:rom_table:AHB-AP#0 Class 0x1 ROM table #0 @ 0xe00fe000 (designer=020 part=483)
0000650:INFO:rom_table:[0]
0000650:INFO:rom_table: AHB-AP#0 Class 0x1 ROM table #1 @ 0xe00ff000 (designer=43b part=4c7)
0000652:INFO:rom_table: [0]
0000653:INFO:rom_table: [1]
0000654:INFO:rom_table: [2]
0000655:INFO:rom_table: [3]
0000656:INFO:rom_table:[1]
0000657:INFO:rom_table:[2]
0000658:INFO:rom_table:APB-AP#2 Class 0x1 ROM table #0 @ 0xe00e0000 (designer=020 part=483)
0000660:INFO:rom_table:[0]
0000661:WARNING:rom_table:Invalid coresight component, cidr=0x0
0000661:INFO:rom_table:[2]
0000662:ERROR:rom_table:Error attempting to probe CoreSight component referenced by ROM table entry #5: Memory transfer fault (read) @ 0xe00f0fbc-0xe00f1043
Traceback (most recent call last):
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/coresight/rom_table.py", line 358, in _read_table
self._handle_table_entry(entry, entryNumber)
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/coresight/rom_table.py", line 408, in _handle_table_entry
cmpid.read_id_registers()
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/coresight/rom_table.py", line 113, in read_id_registers
regs = self.ap.read_memory_block32(self.top_address + self.IDR_READ_START, self.IDR_READ_COUNT)
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/probe/stlink_probe.py", line 271, in read_memory_block32
return self._read_mem(addr, size, Commands.JTAG_READMEM_32BIT, self.MAXIMUM_TRANSFER_SIZE, apsel)
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/probe/stlink/stlink.py", line 343, in _read_mem
raise exc
pyocd.core.exceptions.TransferFaultError: Memory transfer fault (read) @ 0xe00f0fbc-0xe00f1043
0000664:INFO:cortex_m:CPU core #0 is Cortex-M7 r1p2
0000666:INFO:cortex_m:FPU present: FPv5-D16-M
0000668:INFO:dwt:4 hardware watchpoints
0000671:INFO:fpb:8 hardware breakpoints, 1 literal comparators
0000678:INFO:coresight_target:Deasserting reset post connect
0000683:INFO:server:Semihost server started on port 4444 (core 0)
0000693:INFO:gdbserver:GDB server started on port 50000 (core 0)
Reading symbols from /Users/seanmccully/Sources/CNC/Remora/Firmware/FirmwareSource/Remora-OS6/BUILD/SKRV3/ARMC6/firmware_application.elf...
warning:
Loadable section "RW_IRAM1" outside of ELF segments
(no debugging symbols found)...done.
0000803:INFO:gdbserver:Client connected to port 50000!
warning: Loadable section "RW_IRAM1" outside of ELF segments
0x080002c2 in ?? ()
0000896:INFO:gdbserver:Attempting to load argon
0000896:INFO:gdbserver:Attempting to load freertos
0000896:INFO:gdbserver:Attempting to load rtx5
0000896:INFO:gdbserver:Attempting to load threadx
0000896:INFO:gdbserver:Attempting to load zephyr
Resetting target with halt
Successfully halted device on reset
Attached to debugger on port 50000
0001539:WARNING:builder:Chip erase used when flash address 0x8020000 is not the same as flash start 0x8000000
0018000:INFO:loader:Erased chip, programmed 201728 bytes (197 pages), skipped 60416 bytes (59 pages) at 15.00 kB/s
Resetting target with halt
Successfully halted device on reset
Image loaded: /Users/seanmccully/Sources/CNC/Remora/Firmware/FirmwareSource/Remora-OS6/BUILD/SKRV3/ARMC6/firmware_application.elf
Note: automatically using hardware breakpoints for read-only addresses.
Program
received signal SIGSEGV, Segmentation fault.
0xfffffffe in ?? ()
0036510:INFO:gdbserver:Client detached
0036510:INFO:gdbserver:Client disconnected from port 50000!
MBED 网站上对此进行了记录,对于带有引导加载程序的设备,需要使用
erase=sector
而不是芯片。