Skip to content

arch/risc-v: Clear BSS section for RISC-V-based Espressif SoCs#18941

Merged
linguini1 merged 1 commit into
apache:masterfrom
tmedicci:bugfix/clear_bss_sections
May 22, 2026
Merged

arch/risc-v: Clear BSS section for RISC-V-based Espressif SoCs#18941
linguini1 merged 1 commit into
apache:masterfrom
tmedicci:bugfix/clear_bss_sections

Conversation

@tmedicci
Copy link
Copy Markdown
Contributor

Summary

  • arch/risc-v: Clear BSS section for RISC-V-based Espressif SoCs
    • Always clear the BSS section before calling bootloader_init. This is necessary because, otherwise, bootloader_init may fail even before bootloader_clear_bss_section is called again by that function.

Impact

Impact on user: No.

Impact on build: No.

Impact on hardware: No.

Impact on documentation: No.

Impact on security: No.

Impact on compatibility: No.

Testing

There is no specific test for it. It is just an improvement to ensure the firmware boots up. ostest can be used to test it.

Building

make -j distclean
./tools/configure.sh -S esp32p4-function-ev-board:ostest
make flash ESPTOOL_PORT=/dev/ttyACM0
picocom -b 115200 /dev/ttyUSB1

Running

Just run ostest.

Results

nsh> ostest
stdio_test: write fd=1
stdio_test: Standard I/O Check: printf
stdio_test: write fd=2
...
Final memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena       769a0    769a0
ordblks         2        5
mxordblk    72620    6dd10
uordblks     4328     43b8
fordblks    72678    725e8
user_main: Exiting
ostest_main: Exiting with status 0
nsh> 

Always clear the BSS section before calling `bootloader_init`.
This is necessary because, otherwise, `bootloader_init` may fail
even before `bootloader_clear_bss_section` is called again by that
function.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
@github-actions github-actions Bot added Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: XS The size of the change in this PR is very small labels May 22, 2026
@linguini1 linguini1 merged commit 4047b9f into apache:master May 22, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants