Hi Robert, > For flashing the board I'm using *esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 write_flash 0x1000 arch/xtensa/src/esp32/bootloader/esp-nuttx-bootloader/out/bootloader-esp32.bin 0x8000 ../esp-bins/partition-table-esp32.bin 0x10000 nuttx.bin *and it seems to be working fine.
It shouldn't work fine, I suspect that there are some leftovers from previous attempts. Try performing a mass erase of the external flash with "*esptool.py* *erase_flash* *--chip esp32 --port /dev/ttyUSB0"* and most probably it will now fail to boot. By default, the NuttX User image should be flashed to the *0x90000* offset of the external flash. This value may be changed via the " *ESP32_USER_IMAGE_OFFSET*" configuration. NuttX provides the "*make flash*" helper command for flashing ESP32 binaries, which properly handles both Flat and Protected modes. Please refer to the *Flashing* documentation section for more detailed information: https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#flashing > My confusion comes from this nuttx_user.bin binary file. What is its purpose and why is my board capable of running nsh_main without flashing nuttx_user.bin as well? When you build NuttX with Protected Mode support, it creates two binary images. The "nuttx_user.bin" binary is the Userspace image. You may find more information about the Protected Mode on the link below: https://cwiki.apache.org/confluence/display/NUTTX/NuttX+Protected+Build Best regards, Gustavo. On Sun, Oct 30, 2022 at 7:07 AM Robert Alexa <robertalexa2...@gmail.com> wrote: > Hi Gustavo, > > Thank you for your help with running NuttX in protected mode. I did manage > to get it working after manually compiling the bootloader. > > However, I have a few more questions. After compiling the NuttX kernel, we > obtain two different binaries, nuttx.bin and nuttx_user.bin. For flashing > the board I'm using *esptool.py --chip esp32 --port /dev/ttyUSB0 --baud > 921600 write_flash 0x1000 > arch/xtensa/src/esp32/bootloader/esp-nuttx-bootloader/out/bootloader-esp32.bin > 0x8000 ../esp-bins/partition-table-esp32.bin 0x10000 nuttx.bin *and it > seems to be working fine. > > My confusion comes from this nuttx_user.bin binary file. What is its > purpose and why is my board capable of running nsh_main without flashing > nuttx_user.bin as well? > > I would be really grateful if you could answer my questions. > > Best regards, > Robert > -- Gustavo Henrique Nihei