"RT1170_SFDP_FlexSPI1_A_QSPI detected ( (16MB = 256*64K at 0x30000000))" apply large code space?

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

"RT1170_SFDP_FlexSPI1_A_QSPI detected ( (16MB = 256*64K at 0x30000000))" apply large code space?

Jump to solution
278 Views
pupu_ji
Contributor II

Hi all,

When download the program with rt1170 demo board, I notice log print :

 

 

Opening flash driver MIMXRT1170_SFDP_QSPI.cfx
Sending VECTRESET to run flash driver
Flash variant 'iMXRT1170_SFDP_FlexSPI1_A_QSPI Dec 12 2023 17:27:24' detected (16MB = 256*64K at 0x30000000)

 

 

 Does this mean that the code download size is only 16MB?

But my executable file exceeds 16MB,I can't download the program. 

pupu_ji_0-1716371633351.png

 

 

MCUXpresso IDE RedlinkMulti Driver v11.9 (Dec 11 2023 18:02:10 - crt_emu_cm_redlink build 2)
Found chip XML file in E:/4_workplace_test/14_testqt/MIMXRT1176_Project/Debug\MIMXRT1176xxxxx.xml
(  5) Remote configuration complete
Reconnected to existing LinkServer process.
============= SCRIPT: RT1170_connect_M7_wake_M4.scp =============
RT1170 Connect M7 and Wake M4 Script
DpID = 6BA02477
APID = 0x84770001
Setting M4 spin code
Setting M4 clock
Resetting M4 core
View cores on the DAP AP
DpID = 6BA02477
TAP 0: 6BA02477 Core 0: M7  APID: 84770001 ROM Table: E00FD003*
TAP 0: 6BA02477 Core 1: M4  APID: 24770011 ROM Table: E00FF003
============= END SCRIPT ========================================
Probe Firmware: CMSIS-DAP (ARM)
Serial Number:  02440000352e1b8600000000000000000000000097969905
VID:PID:  0D28:0204
USB Path: \\?\hid#vid_0d28&pid_0204&mi_03#8&1af57743&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Using memory from core 0 after searching for a good core
debug interface type      = CoreSight DP (DAP DP ID 6BA02477) over SWD TAP 0
processor type            = Cortex-M7 (CPU ID 00000C27) on DAP AP 0
number of h/w breakpoints = 8
number of flash patches   = 0
number of h/w watchpoints = 4
Probe(0): Connected&Reset. DpID: 6BA02477. CpuID: 00000C27. Info: <None>
Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Content of CoreSight Debug ROM(s):
RBASE E00FD000: CID B105100D PID 000008E88C ROM (type 0x1)
ROM 1 E00FE000: CID B105100D PID 04000BB4C8 ROM (type 0x1)
ROM 2 E00FF000: CID B105100D PID 04000BB4C7 ROM (type 0x1)
ROM 3 E000E000: CID B105E00D PID 04000BB00C Gen SCS (type 0x0)
ROM 3 E0001000: CID B105E00D PID 04000BB002 Gen DWT (type 0x0)
ROM 3 E0002000: CID B105E00D PID 04000BB00E Gen (type 0x0)
ROM 3 E0000000: CID B105E00D PID 04000BB001 Gen ITM (type 0x0)
ROM 2 E0041000: CID B105900D PID 04001BB975 CSt ARM ETMv4.0 type 0x13 Trace Source - Core
ROM 2 E0042000: CID B105900D PID 04004BB906 CSt type 0x14 Debug Control - Trigger, e.g. ECT
ROM 1 E0043000: CID B105900D PID 04001BB908 CSt CSTF type 0x12 Trace Link - Trace funnel/router
NXP: MIMXRT1176xxxxx
DAP stride is 1024 bytes (256 words)
Inspected v.2 External Flash Device on SPI using SFDP JEDEC ID MIMXRT1170_SFDP_QSPI.cfx
Image 'iMXRT1170_SFDP_FlexSPI1_A_QSPI Dec 12 2023 17:27:24'
Opening flash driver MIMXRT1170_SFDP_QSPI.cfx
Sending VECTRESET to run flash driver
Flash variant 'iMXRT1170_SFDP_FlexSPI1_A_QSPI Dec 12 2023 17:27:24' detected (16MB = 256*64K at 0x30000000)
Closing flash driver MIMXRT1170_SFDP_QSPI.cfx
Connected: was_reset=false. was_stopped=false
Awaiting telnet connection to port 3330 ...
GDB nonstop mode enabled
FreeRTOS stack backtrace is disabled
GDB stub (E:\2_workapp\NXP_MIMXRT1170\LinkServer_1.4.85\binaries\crt_emu_cm_redlink) terminating - GDB protocol problem: Pipe has been closed by GDB.

Do I have to modify this parameter in the flashdriver?

And how can i change it?

thank you 

Labels (1)
0 Kudos
1 Solution
202 Views
Sam_Gao
NXP Employee
NXP Employee

TL, DR

Plz see the attchment for more details.

 

Hi @pupu_ji 

I will try to give a concise comments and hope this help you more, please correct me if my understanding is wrong.

Through the default download algorithm(16MB), we can successfully download binary files smaller than 16MB, but how about the size of binary over the defalut 16MB? The key point is how to support flash upgrade when it exceeds current bianry size.

 

Q1: It still failed after you modfied the flash driver and used the updated flash loader algo (from 16MB to 100MB).

iMXRT117x_FlexSPI_SFDP\iMXRT117x_FlexSPI_SFDP\flashdriver\FlashDev.c)
default is 0x1000 0000 = 16MB (H/W define)
// 0x6400 0000 modified,  0x6400 000 = 100MB
// 0X2000 0000, 32MB

Sam: Plz check the h/w flash on the EVB firstly, you can see Desgin Files to find h/w schematic (SPFxxxx.pdf, page 12) to check default QSPI Flash IC (IS25WP128-JBLE, 16M bytes) on the RT1170 EVK board (Backup is Octual Flash, MX25UM51345GXDI00), so the stroge is only 16MB. the log " (16MB = 256 *64K)" is detected from actual h/w, it seems right if you didn't modify the flash IC on the EVK board.

Flash variant 'iMXRT1170_SFDP_FlexSPI1_A_QSPI May 23 2024 11:13:26' detected (16MB = 256*64K at 0x30000000)

 

Q2: How to make a new flashload algo by enlarging the size, and check it is workable after h/w is ready? it seems it is your real need:)

Sam: plz see the below steps to check them base the limited h/w (e.g. RT1170 EVKB).

  • Step1: Mocking a oversize binary(e.g, the origin default maximum size is 16MB because of current h/w), I modified example code(gpio_led_output) as below (4 lines added)
// evkmimxrt1170_igpio_led_output_cm7, source/gpio_led_output.c

/*!
 * @brief Main function
 */
+ const char largeArray[16 * 1024 * 1024] = {0x01};
int main(void)
{
    /* Define the init structure for the output LED pin*/
    gpio_pin_config_t led_config = {kGPIO_DigitalOutput, 0, kGPIO_NoIntmode};

    /* Board pin, clock, debug console init */
    BOARD_ConfigMPU();
    BOARD_InitPins();
    BOARD_BootClockRUN();
    BOARD_InitDebugConsole();
+   volatile uint32_t sum = 0;
+   for (int i = 0; i < sizeof(largeArray); i++){
+   	sum += largeArray[i];
+   }
    /* Print a note to terminal. */
    PRINTF("\r\n GPIO Driver example\r\n");
    PRINTF("\r\n The LED is blinking.\r\n");
    ...

 

  • Step2, use the new upgrade flashloader and enlarge flash size(e.g 32MB)

Sam_Gao_7-1716457392929.png

 

  • Step3, building as below log, the flash size(16801200 B) is over 16MB.
Sam_Gao_8-1716457470307.png

 

  • Step4, Flashing the binary via debuger(e.g CMSIS-DAP), the writing Flash successfully in front of 16MB(1048576 bytes * 16 times = 16,777,216B ), the left size is 23984 B(16801200 - 16777216) failed ( 0x3100 0000 which is over the actual h/w flash size 16MB), But the new flashloader works well.
Sam_Gao_10-1716457522354.pngSam_Gao_11-1716457553165.png

 

References from attchment.

  • flashloader algo: MIMXRT1170_Sam32M_QSPI.cfx
  • example of oversize binary: evkmimxrt1170_igpio_led_output_cm7.axf
  • build.log
  • flash.log

 

Have a nice day!

Sam

View solution in original post

3 Replies
203 Views
Sam_Gao
NXP Employee
NXP Employee

TL, DR

Plz see the attchment for more details.

 

Hi @pupu_ji 

I will try to give a concise comments and hope this help you more, please correct me if my understanding is wrong.

Through the default download algorithm(16MB), we can successfully download binary files smaller than 16MB, but how about the size of binary over the defalut 16MB? The key point is how to support flash upgrade when it exceeds current bianry size.

 

Q1: It still failed after you modfied the flash driver and used the updated flash loader algo (from 16MB to 100MB).

iMXRT117x_FlexSPI_SFDP\iMXRT117x_FlexSPI_SFDP\flashdriver\FlashDev.c)
default is 0x1000 0000 = 16MB (H/W define)
// 0x6400 0000 modified,  0x6400 000 = 100MB
// 0X2000 0000, 32MB

Sam: Plz check the h/w flash on the EVB firstly, you can see Desgin Files to find h/w schematic (SPFxxxx.pdf, page 12) to check default QSPI Flash IC (IS25WP128-JBLE, 16M bytes) on the RT1170 EVK board (Backup is Octual Flash, MX25UM51345GXDI00), so the stroge is only 16MB. the log " (16MB = 256 *64K)" is detected from actual h/w, it seems right if you didn't modify the flash IC on the EVK board.

Flash variant 'iMXRT1170_SFDP_FlexSPI1_A_QSPI May 23 2024 11:13:26' detected (16MB = 256*64K at 0x30000000)

 

Q2: How to make a new flashload algo by enlarging the size, and check it is workable after h/w is ready? it seems it is your real need:)

Sam: plz see the below steps to check them base the limited h/w (e.g. RT1170 EVKB).

  • Step1: Mocking a oversize binary(e.g, the origin default maximum size is 16MB because of current h/w), I modified example code(gpio_led_output) as below (4 lines added)
// evkmimxrt1170_igpio_led_output_cm7, source/gpio_led_output.c

/*!
 * @brief Main function
 */
+ const char largeArray[16 * 1024 * 1024] = {0x01};
int main(void)
{
    /* Define the init structure for the output LED pin*/
    gpio_pin_config_t led_config = {kGPIO_DigitalOutput, 0, kGPIO_NoIntmode};

    /* Board pin, clock, debug console init */
    BOARD_ConfigMPU();
    BOARD_InitPins();
    BOARD_BootClockRUN();
    BOARD_InitDebugConsole();
+   volatile uint32_t sum = 0;
+   for (int i = 0; i < sizeof(largeArray); i++){
+   	sum += largeArray[i];
+   }
    /* Print a note to terminal. */
    PRINTF("\r\n GPIO Driver example\r\n");
    PRINTF("\r\n The LED is blinking.\r\n");
    ...

 

  • Step2, use the new upgrade flashloader and enlarge flash size(e.g 32MB)

Sam_Gao_7-1716457392929.png

 

  • Step3, building as below log, the flash size(16801200 B) is over 16MB.
Sam_Gao_8-1716457470307.png

 

  • Step4, Flashing the binary via debuger(e.g CMSIS-DAP), the writing Flash successfully in front of 16MB(1048576 bytes * 16 times = 16,777,216B ), the left size is 23984 B(16801200 - 16777216) failed ( 0x3100 0000 which is over the actual h/w flash size 16MB), But the new flashloader works well.
Sam_Gao_10-1716457522354.pngSam_Gao_11-1716457553165.png

 

References from attchment.

  • flashloader algo: MIMXRT1170_Sam32M_QSPI.cfx
  • example of oversize binary: evkmimxrt1170_igpio_led_output_cm7.axf
  • build.log
  • flash.log

 

Have a nice day!

Sam

239 Views
Sam_Gao
NXP Employee
NXP Employee

Hi @pupu_ji 

Thanks for your question, please see my comments below:

Q1: "Does this mean that the code download size is only 16MB? If my executable file exceeds 16MB, may be 86MB,do I have to modify this parameter in the flashdriver?"

Sam: Yes, it depens on the flash algo, flash driver and h/w flash type.

 

Q2: And how can i change it?

Sam: You have to upgrade it, the flash algo project is open source(C:\nxp\MCUXpressoIDE_11.9.1_2170\ide\LinkServer\Examples\Flashdrivers\NXP\iMXRT\xxx.zip), please unzip and copy to dedicated folder, then build binary after modify this key parameter(iMXRT117x_FlexSPI_SFDP\iMXRT117x_FlexSPI_SFDP\flashdriver\FlashDev.c) as below

0x1000000, // Device Size ** Will be updated by call to Init() **

which means: 0x1000 000 1024 1024 = 16MB.

 

   EXTSPIJ,    // Device Type
   0,          // Device Start Address ** Will be updated by call to Init() **
   0x1000000,  // Device Size ** Will be updated by call to Init() **
   0x100,      // Programming Page Size ** Will be updated by call to Init() **
   0,          // Reserved, must be 0
   0xFF,       // Initial Content of Erased Memory
   3000,       // Program Page Timeout
   6000,       // Erase Sector Timeout
   // Specify Size and Address of Sectors
   {{0x10000, 0},   // Sector sizes ** Will be updated by call to Init() **
   {SECTOR_END}}
};

 

You need to updated the flash algo(xxxx.cfx), please see this reference link for more details:  https://www.cnblogs.com/henjay724/p/14190485.html

 

Have a nice day!

Sam

0 Kudos
221 Views
pupu_ji
Contributor II

Thank you for your reply.

I also tried to compile .CXF according to this method 

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/How-to-create-a-new-Flash-driver-of-the-MCUXPres...

pupu_ji_2-1716429748351.png

 

 

It realy has modifications in the file

pupu_ji_0-1716429473447.png

 

but seems still 16MB... 

pupu_ji_1-1716429651038.png

Is there something wrong with my operation?

thank you

Tags (1)
0 Kudos