esp-idf/examples/custom_bootloader/bootloader_override
Djordje Nedic facab8c5a7 tools: Increase the minimal supported CMake version to 3.16
This updates the minimal supported version of CMake to 3.16, which in turn enables us to use more CMake features and have a cleaner build system.
This is the version that provides most new features and also the one we use in our latest docker image for CI.
2022-06-01 06:35:02 +00:00
..
bootloader_components/main
main
CMakeLists.txt tools: Increase the minimal supported CMake version to 3.16 2022-06-01 06:35:02 +00:00
README.md
pytest_custom_bootloader_override.py

README.md

Bootloader override

(See the README.md file in the upper level for more information about bootloader examples.)

The purpose of this example is to show how to override the second stage bootloader from a regular project.

NOTE: Overriding the bootloader is not supported with Makefile build system, it is only available with CMake.

How to use example

Simply compile it:

idf.py build

And flash it with the following commands:

idf.py flash

This custom bootloader does not do more than the older bootloader, it only prints an extra message on start up:

[boot] Custom bootloader has been initialized correctly.

Organisation of this example

This project contains an application, in the main directory that represents a user program. It also contains a bootloader_components directory that, as it name states, contains a component that will override the current bootloader implementation.

Below is a short explanation of files in the project folder.

├── CMakeLists.txt
├── main
│   ├── CMakeLists.txt
│   └── main.c                 User application
├── bootloader_components
│   └── main
│       ├── component.mk          
│       ├── CMakeLists.txt   
│       ├── ld/
│       │   └── ...
│       └── bootloader_start.c Implementation of the second stage bootloader
└── README.md                  This is the file you are currently reading

As stated in the README.md file in the upper level, when the bootloader components is named main, it overrides the whole second stage bootloader code.