Skip to content

ELF scatter-loading fixes and TC3xx support#569

Merged
dgarske merged 2 commits intowolfSSL:masterfrom
bigbrett:update-flash-elf-tc3xx-integration
May 12, 2025
Merged

ELF scatter-loading fixes and TC3xx support#569
dgarske merged 2 commits intowolfSSL:masterfrom
bigbrett:update-flash-elf-tc3xx-integration

Conversation

@bigbrett
Copy link
Copy Markdown
Contributor

@bigbrett bigbrett commented Apr 30, 2025

Major modifications to flash elf loading to properly support external flash and TC3xx.

  • Modifies elf scatter loading and hash checking to fully support external flash (buffered reading)
  • Updates AURIX HAL erase to support arbitrary (non-sector size/aligned) erases
  • ELF file preprocessing via new tool: squashelf
  • ELF loading added to AURIX TC3xx HAL and demos, including wbaurixtool.sh
  • Doc updates

Other:

@bigbrett bigbrett requested a review from Copilot April 30, 2025 21:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for ELF scatter-loading on external flash and integrates TC3xx support into the wolfBoot bootloader, while also adding DEBUG_UART functionality and updating related documentation.

  • Refactors preprocessor macros for flash scatter-loading and adjusts flash writing logic in the TC3xx HAL.
  • Adds buffered flash write and erase improvements along with DEBUG_UART support, including UART initialization and transmission.
  • Updates firmware update and IDE documentation to reflect new ELF loading procedures and configuration changes.

Reviewed Changes

Copilot reviewed 26 out of 42 changed files in this pull request and generated no comments.

File Description
hal/sim.c Renamed the preprocessor macro from WOLFBOOT_ELF_SCATTERED to WOLFBOOT_ELF_FLASH_SCATTER.
hal/aurix_tc3xx.c Enhances flash write logic with sector-based buffering and adds DEBUG_UART support functions.
docs/firmware_update.md Expands documentation on ELF loading, including RAM and flash approaches and dual-layer verification.
IDE/AURIX/README.md Updates build instructions and usage notes to support both standard and ELF file-based images.
Files not reviewed (16)
  • IDE/AURIX/test-app-wolfHSM/.cproject: Language not supported
  • IDE/AURIX/test-app-wolfHSM/Lcf_Gnuc_Tricore_Tc.lsl.in: Language not supported
  • IDE/AURIX/test-app/.cproject: Language not supported
  • IDE/AURIX/test-app/.settings/language.settings.xml: Language not supported
  • IDE/AURIX/test-app/Lcf_Gnuc_Tricore_Tc.lsl.in: Language not supported
  • IDE/AURIX/wolfBoot-tc3xx-wolfHSM/.cproject: Language not supported
  • IDE/AURIX/wolfBoot-tc3xx-wolfHSM/Lcf_Gnuc_Tricore_Tc.lsl: Language not supported
  • IDE/AURIX/wolfBoot-tc3xx-wolfHSM/wolfBoot_macros.in: Language not supported
  • IDE/AURIX/wolfBoot-tc3xx/.cproject: Language not supported
  • IDE/AURIX/wolfBoot-tc3xx/.settings/language.settings.xml: Language not supported
  • IDE/AURIX/wolfBoot-tc3xx/Lcf_Gnuc_Tricore_Tc.lsl: Language not supported
  • IDE/AURIX/wolfBoot-tc3xx/wolfBoot_macros.in: Language not supported
  • Makefile: Language not supported
  • arch.mk: Language not supported
  • config/examples/sim-elf-scattered.config: Language not supported
  • config/examples/sim32-elf-scattered.config: Language not supported

@bigbrett bigbrett marked this pull request as ready for review April 30, 2025 22:19
@danielinux danielinux added the Later It won't be fixed in the upcoming release label Apr 30, 2025
@dgarske dgarske removed their request for review May 5, 2025 19:38
@danielinux danielinux removed the Later It won't be fixed in the upcoming release label May 6, 2025
danielinux
danielinux previously approved these changes May 8, 2025
Copy link
Copy Markdown
Member

@danielinux danielinux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor of the elf scattering OK, as discussed. Both the feature and the squashelf tools are well documented. Squashelf tool compiles and works fine.

Did not review the TC3xx specific code / IDE / debugging scripts

@danielinux danielinux assigned bigbrett and unassigned danielinux May 8, 2025
@danielinux
Copy link
Copy Markdown
Member

@bigbrett please rebase to latest master to resolve conflicts, then assign to @billphipps for a final review on HW-specific components.

- Support ELF scatter-loading on TC3xx
- Modify TC3xx HAL flash erase to support arbitrary offsets and sizes
- Realign partition size and addresses to support more efficient sector mass erase on update
billphipps
billphipps previously approved these changes May 8, 2025
Copy link
Copy Markdown
Contributor

@billphipps billphipps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Minor comments and I didn't get a chance to test it out locally. Consider some tests for squashelf?

Copy link
Copy Markdown
Contributor

@billphipps billphipps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@bigbrett
Copy link
Copy Markdown
Contributor Author

@dgarske this has been approved by both @danielinux and @billphipps , if you could pls do the honors...

@dgarske dgarske merged commit 2b996f8 into wolfSSL:master May 12, 2025
258 of 259 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants