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)
- Step3, building as below log, the flash size(16801200 B) is over 16MB.
- 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.

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