Copy from flash to SDRAM and run

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Copy from flash to SDRAM and run

347件の閲覧回数
mnagoga
Contributor I

Hello,

I followed the document "I.MX RT - How to Boot to SDRAM" from the i.MX RT Knowledge Base but can't get it working.

Hardware:

Embedded Artists i.MX RT1064 uCOM (SDRAM 32 MB)
Segger JLink Plus


Software:

MCUXpresso 11.9.1_2170

 

What I did:

I linked the Hello World application from the SDK to the SDRAM.
I enabled the DCD header (XIP_BOOT_HEADER_DCD_ENABLE=1).
Looking at the memory map, it seems we have everything we need:

 

.boot_hdr 0x80000000 0x2000

FILL mask 0xff

0x80000000 __boot_hdr_start__ = ABSOLUTE (.)

*(SORT_BY_ALIGNMENT(.boot_hdr.conf))

.boot_hdr.conf

0x80000000 0x200 ./xip/evkmimxrt1064_flexspi_nor_config.o

0x80000000 qspiflash_config

0x00001000 . = 0x1000

*fill* 0x80000200 0xe00 ff

*(SORT_BY_ALIGNMENT(.boot_hdr.ivt))

.boot_hdr.ivt 0x80001000 0x20 ./xip/fsl_flexspi_nor_boot.o

0x80001000 image_vector_table

0x00001020 . = 0x1020

*(SORT_BY_ALIGNMENT(.boot_hdr.boot_data))

.boot_hdr.boot_data

0x80001020 0x10 ./xip/fsl_flexspi_nor_boot.o

0x80001020 g_boot_data

0x00001030 . = 0x1030

*(SORT_BY_ALIGNMENT(.boot_hdr.dcd_data))

.boot_hdr.dcd_data

0x80001030 0x410 ./board/dcd.o

0x80001030 dcd_data

0x80001440 __boot_hdr_end__ = ABSOLUTE (.)

0x00002000 . = 0x2000

*fill* 0x80001440 0xbc0 ff



.text 0x80002000 0x4f68

FILL mask 0xff

0x80002000 __vectors_start__ = ABSOLUTE (.)

*(SORT_BY_ALIGNMENT(.isr_vector))

.isr_vector 0x80002000 0x2b8 ./startup/startup_mimxrt1064.o

0x80002000 __Vectors

0x80002000 g_pfnVectors

0x800022b8 . = ALIGN (0x4)

0x800022b8 __section_table_start = .

0x800022b8 __data_section_table = .

 

 

Finally, I generated a bin file and flashed it to 0x70000000.

 

jlink log:

 

Executing flash operation 'Program' (Program executable into flash eaimxrt1064_hello_world_sdram.bin) - Wed Jun 12 08:55:41 CEST 2024

Checking MCU info...

Scanning for targets...

Executing flash action...

SEGGER J-Link Commander V7.96c (Compiled Apr 2 2024 12:36:46)

DLL version V7.96c, compiled Apr 2 2024 12:36:21

J-Link Command File read successfully.

Processing script file...

J-Link>ExitOnError 1

J-Link Commander will now exit on Error

J-Link>r

J-Link connection not established yet but required for command.

Connecting to J-Link via USB...O.K.

Firmware: J-Link V11 compiled Mar 14 2024 13:16:08

Hardware version: V11.00

J-Link uptime (since boot): 0d 00h 44m 27s

S/N: 851006059

License(s): RDI, FlashBP, FlashDL, JFlash, GDB

USB speed mode: High speed (480 MBit/s)

VTref=3.305V

Target connection not established yet but required for command.

Device "MIMXRT1064XXX6A" selected.

Connecting to target via SWD

InitTarget() start

InitTarget() end - Took 1.14ms

Found SW-DP with ID 0x0BD11477

Failed to power up DAP

InitTarget() start

InitTarget() end - Took 1.27ms

Found SW-DP with ID 0x0BD11477

DPIDR: 0x0BD11477

CoreSight SoC-400 or earlier

Scanning AP map to find all available APs

AP[1]: Stopped AP scan as end of AP map has been reached

AP[0]: AHB-AP (IDR: 0x04770041)

Iterating through AP map to find AHB-AP to use

AP[0]: Core found

AP[0]: AHB-AP ROM base: 0xE00FD000

CPUID register: 0x411FC271. Implementer code: 0x41 (ARM)

Cache: L1 I/D-cache present

Found Cortex-M7 r1p1, Little endian.

FPUnit: 8 code (BP) slots and 0 literal slots

CoreSight components:

ROMTbl[0] @ E00FD000

[0][0]: E00FE000 CID B105100D PID 000BB4C8 ROM Table

ROMTbl[1] @ E00FE000

[1][0]: E00FF000 CID B105100D PID 000BB4C7 ROM Table

ROMTbl[2] @ E00FF000

[2][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7

[2][1]: E0001000 CID B105E00D PID 000BB002 DWT

[2][2]: E0002000 CID B105E00D PID 000BB00E FPB-M7

[2][3]: E0000000 CID B105E00D PID 000BB001 ITM

[1][1]: E0041000 CID B105900D PID 001BB975 ETM-M7

[1][2]: E0042000 CID B105900D PID 004BB906 CTI

[0][1]: E0040000 CID B105900D PID 000BB9A9 TPIU-M7

[0][2]: E0043000 CID B105F00D PID 001BB101 TSG

I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way

D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way

Memory zones:

"Default" Description: Default access mode

Cortex-M7 identified.

Reset delay: 0 ms

Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.

ResetTarget() start

Could not find valid reset vector.

Target halted on flash header read.

ResetTarget() end - Took 124ms

AfterResetTarget() start

AfterResetTarget() end - Took 1.44ms

J-Link>h

PC = 002114C8, CycleCnt = 00000000

R0 = 00000001, R1 = 402A4210, R2 = 5AF05AF0, R3 = 00000004

R4 = 00000001, R5 = 0021B368, R6 = 00000000, R7 = 401F46E0

R8 = 00000000, R9 = 00000000, R10= 41EDA67B, R11= 400F8000

R12= 00000000

SP(R13)= 20200D10, MSP= 20200D10, PSP= 00000000, R14(LR) = 0020F8FF

XPSR = 41000000: APSR = nZcvq, EPSR = 01000000, IPSR = 000 (NoException)

CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00

FPS0 = 00000000, FPS1 = 00000000, FPS2 = 00000000, FPS3 = 00000000

FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000

FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000

FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= FFFFFFFF

FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000

FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000

FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000

FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= FFFFFFFF

FPSCR= 00000000

J-Link>loadfile "/home/mn/Documents/MCUXpresso_11.9.1_2170/workspace/eaimxrt1064_hello_world_sdram/Debug/eaimxrt1064_hello_world_sdram.bin" 0x70000000

'loadfile': Performing implicit reset & halt of MCU.

ResetTarget() start

Could not find valid reset vector.

Target halted on flash header read.

ResetTarget() end - Took 123ms

AfterResetTarget() start

AfterResetTarget() end - Took 2.08ms

Downloading file [/home/mn/Documents/MCUXpresso_11.9.1_2170/workspace/eaimxrt1064_hello_world_sdram/Debug/eaimxrt1064_hello_world_sdram.bin]...

J-Link: Flash download: Bank 0 @ 0x70000000: Skipped. Contents already match

O.K.

J-Link>qc

Script processing completed.

 

 

 

In the tutorial, an s19 file is generated, but I didn't succeed in flashing this file to the flash memory (as it's linked to SDRAM, the JLink tries to flash it to SDRAM, which is not what I want).

After all this, I see that the application doesn't start. Moreover, in the JLink log, you can see "Could not find valid reset vector."

What am I doing wrong?

Thank you,

Michael

ラベル(1)
タグ(3)
0 件の賞賛
返信
1 返信

323件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @mnagoga ,

Hope you are doing well!

I've helped a customer test a related project before. Please refer to this thread which provides detailed instructions.

https://community.nxp.com/t5/i-MX-Processors/Boot-to-SDRAM-MCU-Boot-utility-How-to-Use-download/td-p...

Best regards,
Gavin

0 件の賞賛
返信