I’m trying to override 2nd stage bootlaoder. For that, i simply create a new IDF project, and load the sample “custom_bootloader”-“bootloader_override”.
Now, i correctly build the project and download it. As said here the 2nd stage bootloader should be resides at offset 0x1000 in flash, but flash_args file says:
–flash_mode dio –flash_freq 80m –flash_size 2MB
0x0 bootloader/bootloader.bin
0x10000 IAMBOOT.bin
0x8000 partition_table/partition-table.bin
This means that in location 0x0 (don’t should be 0x1000?) he’s install default bootloader, and IAMBOOT.bin (IAMBOOT is the name of the bootloader project) resides at location 0x10000, that is the location of the factory app, in according with the partition table.
Actually in the app_main there is only a printf, and in debug it outputs the string on the console as expected. Routine “app_main” is called from the scheduler initialized in “start_cpu0_default” function.
I tried to manually flash IAMBOOT.bin at address 0x1000 with the flash download tool but don’t work. I tried also to flash it at address 0x0, but the result is the same.
Also, app_main function has address 0x420074c0, so it doesn’t resides in the 2nd stage bootloader area (that should be, for default, from 0x1000 and 0x8000 or where partition table is allocated).
How can i define that the project must override default 2nd stage bootloader?