NXP MCU 技术论坛
直播中

王越建

7年用户 1442经验值
私信 关注
[问答]

如何使用SPSDK对i.MX RT685EVK进行编程?

我正在尝试使用 SPSDK 将固件映像编程到 i.MX RT685EVK 上,但是 `blhost flash-image` 失败并显示:
响应状态 = 10200 (0x27d8) 内存范围无效。
我一定错过了什么,我应该直接使用 nxpdebugmbox 来对板载闪存进行编程吗?


+ isp_mode=0
+ sdp_port=/dev/ttyAMA0
+ mboot_port=/dev/ttyACM0
+ usb_pidvid=0x1fc9:0x0020
+ spsdk_target=rt6xx
+ blhost_connection=\'-p /dev/ttyACM0\'
+ sdphost_connection=\'-p /dev/ttyAMA0\'
+ elf_path=build/nxp-MIMXRT685EVK-mcuboot-2.13.0-debug.elf
+ bin_path=build/nxp-MIMXRT685EVK-mcuboot-2.13.0-debug.bin
+ image_path=build/nxp-MIMXRT685EVK-mcuboot-2.13.0-debug_mbi.bin
+ readelf.py -l build/nxp-MIMXRT685EVK-mcuboot-2.13.0-debug.elf

Elf file type is EXEC (Executable file)
Entry point is 0x80011ad
There are 4 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x08000000 0x08000000 0x00600 0x00600 R   0x1000
  LOAD           0x001000 0x08001000 0x08001000 0x00130 0x00130 R   0x1000
  LOAD           0x001130 0x08001130 0x08001130 0x0c680 0x0c680 RWE 0x1000
  LOAD           0x00e000 0x20080000 0x0800d7b0 0x02658 0x100c8 RWE 0x1000

Section to Segment mapping:
  Segment Sections...
   00     .flash_config
   01     .interrupts
   02     .text .ARM .init_array .fini_array
   03     .data .bss .heap .stack
+ nxpimage -v utils binary-image convert -i build/nxp-MIMXRT685EVK-mcuboot-2.13.0-debug.elf -f BIN build/nxp-MIMXRT685EVK-mcuboot-2.13.0-debug.bin
WARNING:spsdk.utils.images:Elf file support is experimental. Take that with care. (6647ms since start, images.py:531)
INFO:spsdk.apps.nxpimage:
+==0x0800_0400= nxp-MIMXRT685EVK-mcuboot-2.13.0-debug.elf ==+
|                       Size: 64.0 kB                       |
|     The image loaded from: /home/root/nxp/build/nxp-      |
|          MIMXRT685EVK-mcuboot-2.13.0-debug.elf .          |
|+==0x0800_0400= Segment 0 ================================+|
||                       Size: 512 B                       ||
|+==0x0800_05ff============================================+|
|                        Gap: 2.6 kB                        |
|+==0x0800_1000= Segment 1 ================================+|
||                      Size: 60.9 kB                      ||
|+==0x0800_fe07============================================+|
+==0x0800_fe07==============================================+

Success. (Converted file: /home/root/nxp/build/nxp-MIMXRT685EVK-mcuboot-2.13.0-debug.bin created.)
+ cat mcuboot-mbi.yaml
family: rt6xx
outputImageExecutionAddress: 0x80011ad
outputImageExecutionTarget: RAM
outputImageAuthenticationType: Plain
masterBootOutputFile: build/nxp-MIMXRT685EVK-mcuboot-2.13.0-debug_mbi.bin
inputImageFile: build/nxp-MIMXRT685EVK-mcuboot-2.13.0-debug.bin
enableHwUserModeKeys: false
enableTrustZone: false
+ nxpimage -v mbi export mcuboot-mbi.yaml
Success. (Master Boot Image: /home/root/nxp/build/nxp-MIMXRT685EVK-mcuboot-2.13.0-debug_mbi.bin created.)
+ nxpdebugmbox -i pyocd -v ispmode -m 0
  #   Interface   Id         Description                                    
----------------------------------------------------------------------------
  0   PyOCD       NRAQBQHR   NXP Semiconductors LPC-LINK2 CMSIS-DAP V5.361  
INFO:spsdk.debuggers.debug_probe_pyocd:PyOCD connected via LPC-LINK2 CMSIS-DAP V5.361 probe.
Entering into ISP mode succeeded
+ sleep 1
+ lsusb -d 1fc9:
Bus 001 Device 003: ID 1fc9:0090 NXP Semiconductors LPC-LINK2 CMSIS-DAP V5.361
+ nxpdevscan -v
INFO:libusbsio:Loading SIO library: /usr/lib/python3.11/site-packages/libusbsio/bin/linux_aarch64/libusbsio.so
INFO:libusbsio:HID enumeration[368525893056]: initialized
INFO:libusbsio:HID enumeration[368525893056]: finished, total 5 devices
-------- Connected NXP USB Devices --------

LPC-LINK2 CMSIS-DAP V5.361 - NXP Semiconductors
Vendor ID: 0x1fc9
Product ID: 0x0090
Path: /dev/hidraw0
Path Hash: b3f395f0
Name:
Serial number: NRAQBQHR

LPCSIO - NXP Semiconductors
Vendor ID: 0x1fc9
Product ID: 0x0090
Path: /dev/hidraw2
Path Hash: d068573e
Name:
Serial number: NRAQBQHR

LPC-LINK2 DATA PORT - NXP Semiconductors
Vendor ID: 0x1fc9
Product ID: 0x0090
Path: /dev/hidraw1
Path Hash: 7e1d2ff4
Name:
Serial number: NRAQBQHR

INFO:spsdk.sdp.sdp:TX-CMD: ReadStatus
INFO:spsdk.sdp.sdp:RX-PACKET: Response: 0x04100100
INFO:spsdk.sdp.sdp:RX-PACKET: Response: 0x04100100
-------- Connected NXP UART Devices --------

Port: /dev/ttyACM0
Type: mboot device

Port: /dev/ttyAMA0
Type: SDP device

-------- Connected NXP SIO Devices --------

LIBUSBSIO - NXP Semiconductors, LPCSIO
Vendor ID: 0x1fc9
Product ID: 0x0090
Path: /dev/hidraw2
Path Hash: d068573e
Serial number: NRAQBQHR
Interface number: 3
Release number: 256

+ blhost -p /dev/ttyACM0 -v get-property current-version
INFO:spsdk.mboot.mcuboot:Connect: /dev/ttyACM0
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'CurrentVersion\', index=0)
Response status = 0 (0x0) Success.
Response word 1 = 1258487808 (0x4b030000)
Current Version = K3.0.0
INFO:spsdk.mboot.mcuboot:Closing: /dev/ttyACM0
+ blhost -p /dev/ttyACM0 -v list-memory
INFO:spsdk.mboot.mcuboot:Connect: /dev/ttyACM0
Internal Flash:
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'FlashStartAddress\', index=0)
Internal RAM:
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'RamStartAddress\', index=0)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'RamSize\', index=0)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'RamStartAddress\', index=1)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'RamSize\', index=1)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'RamStartAddress\', index=2)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'RamSize\', index=2)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'RamStartAddress\', index=3)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'RamSize\', index=3)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'RamStartAddress\', index=4)
    Region 0: 0x10000000 - 0x1047FFFF; Total Size: 4.5 MiB
    Region 1: 0x00000000 - 0x0047FFFF; Total Size: 4.5 MiB
    Region 2: 0x20000000 - 0x2047FFFF; Total Size: 4.5 MiB
    Region 3: 0x30000000 - 0x3047FFFF; Total Size: 4.5 MiB
External Memories:
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'CurrentVersion\', index=0)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=1)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=4)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=4)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=8)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=9)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=10)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=16)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=256)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=257)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=272)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=273)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=288)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'ExternalMemoryAttributes\', index=289)
FLEX-SPI-NOR:
  Not Configured
SPI-MEM:
  Not Configured
SD:
  Not Configured
MMC:
  Not Configured
INFO:spsdk.mboot.mcuboot:Closing: /dev/ttyACM0
+ blhost -p /dev/ttyACM0 -v flash-image build/nxp-MIMXRT685EVK-mcuboot-2.13.0-debug_mbi.bin
INFO:spsdk.mboot.mcuboot:Connect: /dev/ttyACM0
INFO:spsdk.mboot.mcuboot:CMD: WriteMemory(address=0x00000000, length=64008, mem_id=0)
INFO:spsdk.mboot.mcuboot:CMD: GetProperty(\'MaxPacketSize\', index=0)
INFO:spsdk.mboot.mcuboot:CMD: Max Packet Size = 512
ERROR:spsdk.mboot.mcuboot:RX: Mboot: Data aborted by sender (1644ms since start, mcuboot.py:230)
Response status = 10200 (0x27d8) Memory Range Invalid.
INFO:spsdk.mboot.mcuboot:Closing: /dev/ttyACM0

更多回帖

发帖
×
20
完善资料,
赚取积分