IMX1052xxB Custom board + QSPI NOR Flash S25FL512S - Can't debug

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX1052xxB Custom board + QSPI NOR Flash S25FL512S - Can't debug

1,113 Views
moura_fmo
Contributor I

Hi all,

I developed Custom board using IMX1052 and tried use S25FL512S external flash memory in QUAD mode.

I used nor pooling_transfer exemple to understand and study about LUT table.
I changed the example to put my memory in QUAD mode, enable Autoboot function, set region to 

0x6000000 and did functions to read and verify if everything  was written. I had just no have success in one test - page program, I can run single page program but It jumps first byte, in other words, It fails too.

moura_fmo_0-1627345477537.png

 

Now I'm trying run hello word example in external nor flash.

I used AN12183 instructions without success, can you help me to find my fault ?

Env:
last version of MCUpresso and  SDK on Windows 10 or OSX.

JLink Base - (Changed Xml to allow JLink flash QSPI NOR Flash)

Memory detail: 

moura_fmo_1-1627345806561.png

 

XIP detail:

moura_fmo_5-1627345976798.png

 

Path and Symbols

moura_fmo_4-1627345954317.png

After flash I have this behavior:

moura_fmo_6-1627346078512.png

 

Console output:

SEGGER J-Link GDB Server V7.50a Command Line Version

 

JLinkARM.dll V7.50a (DLL compiled Jul  8 2021 18:16:55)

 

Command line: -nosilent -swoport 2334 -select USB=51009823 -jlinkscriptfile /Users/felipemdeo/Documents/MCUXpressoIDE_11.3.1/workspace/.mcuxpressoide_packages_support/MIMXRT1052xxxxB_support/Script/evkbimxrt1050_sdram_init.jlinkscript -telnetport 2335 -singlerun -endian little -noir -speed auto -port 2336 -vd -device MCIMXRT1052 -if SWD -halt -reportuseraction

-----GDB Server start settings-----

GDBInit file:                  none

GDB Server Listening port:     2336

SWO raw output listening port: 2334

Terminal I/O port:             2335

Accept remote connection:      yes

Generate logfile:              off

Verify download:               on

Init regs on start:            off

Silent mode:                   off

Single run mode:               on

Target connection timeout:     0 ms

------J-Link related settings------

J-Link Host interface:         USB

J-Link script:                 /Users/felipemdeo/Documents/MCUXpressoIDE_11.3.1/workspace/.mcuxpressoide_packages_support/MIMXRT1052xxxxB_support/Script/evkbimxrt1050_sdram_init.jlinkscript

J-Link settings file:          none

------Target related settings------

Target device:                 MCIMXRT1052

Target interface:              SWD

Target interface speed:        auto

Target endian:                 little

 

Connecting to J-Link...

J-Link is connected.

Device "MIMXRT1052XXXXA" selected.

Firmware: J-Link V11 compiled Jun 29 2021 16:12:24

Hardware: V11.00

S/N: 51009823

Feature(s): GDB

Checking target voltage...

Target voltage: 3.35 V

Listening on TCP/IP port 2336

Connecting to target...

ConfigTargetSettings() start

Config JTAG Speed to 4000kHz

ConfigTargetSettings() end

Found SW-DP with ID 0x0BD11477

DPIDR: 0x0BD11477

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)

Found Cortex-M7 r1p1, Little endian.

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

CoreSight components:

ROMTbl[0] @ E00FD000

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

ROMTbl[1] @ E00FE000

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

ROMTbl[2] @ E00FF000

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

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

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

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

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

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

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

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

Cache: Separate I- and D-cache.

 

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

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

SetupTarget() start

Enabling i.MXRT SDRAM

FlexRAM configuration is restored

DCDC trim value loaded.

Clock Init Done

SDRAM Init Done

SetupTarget() end

ConfigTargetSettings() start

Config JTAG Speed to 4000kHz

ConfigTargetSettings() end

Found SW-DP with ID 0x0BD11477

DPIDR: 0x0BD11477

AP map detection skipped. Manually configured AP map found.

AP[0]: AHB-AP (IDR: Not set)

AP[0]: Core found

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

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

Found Cortex-M7 r1p1, Little endian.

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

CoreSight components:

ROMTbl[0] @ E00FD000

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

ROMTbl[1] @ E00FE000

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

ROMTbl[2] @ E00FF000

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

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

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

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

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

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

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

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

Cache: Separate I- and D-cache.

 

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

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

SetupTarget() start

Enabling i.MXRT SDRAM

FlexRAM configuration is restored

DCDC trim value loaded.

Clock Init Done

SDRAM Init Done

SetupTarget() end

Connected to target

Waiting for GDB connection...Connected to 127.0.0.1

Reading all registers

Read 4 bytes @ address 0x0020C73E (Data = 0x68602500)

Read 2 bytes @ address 0x0020C73E (Data = 0x2500)

Connected to 127.0.0.1

Reading all registers

Read 4 bytes @ address 0x0020C73E (Data = 0x68602500)

Read 2 bytes @ address 0x0020C73E (Data = 0x2500)

Received monitor command: reset

ResetTarget() start

Core did not halt on reset vector. Assuming faulty image.

Resetting and halting core on image verification value read.

Core did not halt after reset step 1

ResetTarget() end

AfterResetTarget() start

FlexRAM configuration is restored

DCDC trim value loaded.

Clock Init Done

SDRAM Init Done

AfterResetTarget() end

Resetting target

Downloading 8192 bytes @ address 0x60000000 - Verified OK

Downloading 12320 bytes @ address 0x60002000 - Verified OK

Downloading 4 bytes @ address 0x60005020 - Verified OK

 

 

Labels (1)
0 Kudos
3 Replies

1,076 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @moura_fmo 

1. About the command, I checked your S25FL512 , mainly:

erase sector command need to modify from 0XD7 to 0X20,  

enter QPI mode command need to modify from 0x35 to 0x38

/* Erase Sector */
[4 * NOR_CMD_LUT_SEQ_IDX_ERASESECTOR] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x20, kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 0x18),

/* Enter QPI mode */
[4 * NOR_CMD_LUT_SEQ_IDX_ENTERQPI] =
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0x38, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0),

To the program command, you don't need to modify it, it is correct.

 

2. About the code project, do you download to the RAM which I have tell you in the previous email? You can't operate the flash when the code is running in the flash, as your QSPI is not the RWW chip.

When run the flexspi_nor_polling_transfer project, what the printf result, whether erase, write, read are OK? You mentioned program is not correct, in fact, program LUT is correct.

 

Wish it helps you!

Best Regards,

Kerry

 

0 Kudos

1,107 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @moura_fmo ,

  Please run the SDK project:

SDK_2_10_0_EVKB-IMXRT1050\boards\evkbimxrt1050\driver_examples\flexspi\nor\polling_transfer

From the internal RAM, not the external flash.

Can you run code in RAM with your customer board and the JLINK?

kerryzhou_0-1627361675098.png

Your QSPI chip QE is bit 1 of the status register 2.

So you need to modify the QE enable bit data.

#define FLASH_QUAD_ENABLE 0x200

Please let the RAM flexSPI code works at first, then switch to the code debug in FLASH.

Wish it helps you!

Best Regards,

kerry

0 Kudos

1,100 Views
moura_fmo
Contributor I

Hi kerryzhou, tnx for your reply.

 

I can run most part flexspi_nor_polling_transfer.c example. I did some modifications to put QE bit in enable:

moura_fmo_0-1627385929082.png

I defined FLASH_QUAD_ENABLE with 0x200 and change function to send 2 bytes (without it I had problem in sector erase) after write command. It is particularity from S25FL512 -> 

moura_fmo_1-1627386316474.png

moura_fmo_2-1627386424812.png

I did function to read RDCR register and I got correct value:

moura_fmo_3-1627386832593.png

 

Look my output, please:

moura_fmo_4-1627387035418.png

moura_fmo_11-1627389118200.png

 

So, code flow well, but I have error after run "flexspi_nor_flash_page_program" 

For any reason, function finish but data is not written in memory.

Bellow follow my LUT command to Quad Page Program.

moura_fmo_7-1627388534903.png

Bellow the result from "flexspi_nor_flash_page_program.

moura_fmo_9-1627388662853.png

 

moura_fmo_8-1627388573925.png

My definitions in app.h

moura_fmo_10-1627388713088.png

Do you believe that I can try run in external memory or I need fully run this example before it.

If I need fully run this example, you have any tip to me to help understand where my fault?

 

0 Kudos