Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/esp32: build the SDK bootloader from source #17457

Closed

Conversation

gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Dec 31, 2021

Contribution description

As follow-up to PR #17043 this PR provides the ESP32 bootloader as module which is compiled from SDK sources.

Up to now, there were four precompiled versions of bootloaders (bootloader.bin) for different settings of logging and colored logging but with a fix size of flash and a fix UART baudrate. To change these parameters, the bootloader has to be recompiled. However there are more settings that affect the bootloader build that might be relevant to the app or final board that uses this bootloader.

This PR builds the bootloader.bin file from the ESP32 SDK sourc as a module esp_bootloader. It doesn't generate any object code for the application and only produces a bootloader.bin file set to the BOOTLOADER_BIN make variable for the esptool.inc.mk to flash.

This PR includes #17455 for the moment to be compilable (commits fded044 b639123 8a84085 3b4c5e9 0c56a2d).

Testing procedure

Use command

USEMODULE='esp_log_startup esp_log_colored' BAUD=57600  RIOT_TERMINAL=picocom \
BOARD=esp32-wroom-32 make -C tests/shell flash term 

and press RESET. The second-stage output should be seen in color. The first-stage bootloader and the application output is seen as garbage since they use a 115200 as baudrate.

Issues/PRs references

Depends on PR #17455
Follow-up to PR #17043

@github-actions github-actions bot added Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration Area: pkg Area: External package ports Area: tools Area: Supplementary tools Platform: ESP Platform: This PR/issue effects ESP-based platforms labels Dec 31, 2021
@gschorcht gschorcht added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: run tests If set, CI server will run tests on hardware for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Dec 31, 2021
@gschorcht gschorcht force-pushed the cpu/esp32/sdk-compile-bootloader branch from 6f9946f to f6c8102 Compare December 31, 2021 15:09
@gschorcht gschorcht added State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet and removed CI: run tests If set, CI server will run tests on hardware for the labeled PR labels Dec 31, 2021
@gschorcht gschorcht force-pushed the cpu/esp32/sdk-compile-bootloader branch 5 times, most recently from 783f1aa to dcbd1fd Compare January 1, 2022 16:34
@github-actions github-actions bot added the Area: CI Area: Continuous Integration of RIOT components label Jan 1, 2022
@gschorcht gschorcht force-pushed the cpu/esp32/sdk-compile-bootloader branch from dcbd1fd to ad745cc Compare January 1, 2022 16:55
@gschorcht gschorcht added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: full build disable CI build filter and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: full build disable CI build filter labels Jan 1, 2022
@gschorcht gschorcht force-pushed the cpu/esp32/sdk-compile-bootloader branch 2 times, most recently from 8b10670 to 08df5cc Compare January 2, 2022 06:32
@gschorcht gschorcht removed the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label Jan 2, 2022
@gschorcht gschorcht force-pushed the cpu/esp32/sdk-compile-bootloader branch from 08df5cc to bf770fa Compare January 4, 2022 15:02
@github-actions github-actions bot added Area: arduino API Area: Arduino wrapper API Area: boards Area: Board ports Area: sys Area: System labels Jan 4, 2022
@gschorcht gschorcht force-pushed the cpu/esp32/sdk-compile-bootloader branch from bf770fa to acc093a Compare January 4, 2022 15:38
@github-actions github-actions bot removed Area: boards Area: Board ports Area: sys Area: System Area: arduino API Area: Arduino wrapper API labels Jan 4, 2022
@gschorcht gschorcht force-pushed the cpu/esp32/sdk-compile-bootloader branch from acc093a to 045c551 Compare January 7, 2022 05:02
Only formatting issues solved, no content changes.
Up to now, there were four versions of prebuilt bootloaders for the ESP32 with different settings of logging and color logging. These bootloaders were manually built from the SDK and shipped with RIOT-OS source code.
However there are more settings that affect the bootloader build that are relevant to the app or final board that uses this bootloader. This commit builds the `bootloader.bin` file from the ESP32 SDK source
code. It is built as a module `esp_bootloader` which at the moment doesn't generate any object code for the application and only produces a `bootloader.bin` file set to the `BOOTLOADER_BIN` make variable for the `esptool.inc.mk` to flash.
In ESP-IDF archives are generated for all components. The ld script for the bootloader uses archive names of some components to place data and code to the first 64 kByte of IRAM. Since RIOT uses object files instead of archives, the ld script for the bootloader has to modified.
@gschorcht gschorcht force-pushed the cpu/esp32/sdk-compile-bootloader branch from 045c551 to 713343c Compare January 24, 2022 20:25
@benpicco
Copy link
Contributor

benpicco commented Jun 9, 2022

This was now merged as part of #17601 right?

@gschorcht
Copy link
Contributor Author

This was now merged as part of #17601 right?

Yes, merged as part of #17601.

@gschorcht gschorcht closed this Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: CI Area: Continuous Integration of RIOT components Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration Area: pkg Area: External package ports Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants