Laczen commented on code in PR #18195:
URL: https://github.com/apache/nuttx/pull/18195#discussion_r2731836224


##########
arch/xtensa/src/common/espressif/esp_loader.c:
##########
@@ -50,6 +50,10 @@
 #  include "esp_rom_uart.h"
 #  include "esp_rom_sys.h"
 #  include "esp_app_format.h"
+#  ifndef CONFIG_ESPRESSIF_SIMPLE_BOOT_IMAGE_OFFSET
+#    define CONFIG_ESPRESSIF_SIMPLE_BOOT_IMAGE_OFFSET \
+            CONFIG_BOOTLOADER_OFFSET_IN_FLASH
+#  endif

Review Comment:
   This change allows the generation of images in the simpleboot format to be 
placed at other locations then `CONFIG_BOOTLOADER_OFFSET_IN_FLASH`.
   The simpleboot image format consists of 2 things:
   1. Add the irom/drom mappings to a routine that is placed in ram so that it 
can be done during the start of the application. This makes the image only 
booteable when it is placed at a specific location because this is added to the 
irom/drom mapping.
   2. Make the image booteable by the ROM bootloader by placing the iram/dram 
segments at the beginning of the image and hide the rom segments.
   
   By the above definition it is possible to limit the definition of the 
simpleboot format to only item 1, while maintaining compatibility with the 
present use. To generate the image for a different location a kconfig 
`ESPRESSIF_SIMPLE_BOOT_IMAGE_OFFSET` can be defined and set to a different 
location. A custom bootloader would step over the segments, copy the ram parts, 
ignore the rom segments and transfers the control to the ram placed `__start`. 
The thus generated image can make full use of the space savings implemented in 
esptool.py (placing the ram parts after the irom/drom and reduce padding).   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to