task: Implement IAPL/Userapp structure for STM32 (MAX 6958 emulation) firmware#32
Merged
task: Implement IAPL/Userapp structure for STM32 (MAX 6958 emulation) firmware#32
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements a dual-stage bootloader structure for STM32G031 firmware, dividing flash memory into two independent components: IAPL (In-App Preloader) and UAPP (User Application). The preloader validates and launches the user application, with both components containing tombstone metadata for version tracking and CRC validation.
Key changes:
- Implemented IAPL/UAPP firmware architecture with tombstone metadata
- Added CRC-based validation for both firmware components
- Created shared bootloader functionality and build system
- Removed old build configuration files and example code
Reviewed changes
Copilot reviewed 92 out of 1225 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| firmware/userapp/Core/Src/system_stm32g0xx.c | Enabled vector table relocation and configured offset for user application |
| firmware/userapp/Core/Src/stm32g0xx_hal_msp.c | Added CRC peripheral initialization functions |
| firmware/userapp/Core/Src/slave.c | Refactored function names to use consistent naming convention |
| firmware/userapp/Core/Src/postcodes.c | New file implementing POST code reading and segment name resolution |
| firmware/userapp/Core/Src/main.c | Added tombstone structure, CRC initialization, and updated includes |
| firmware/userapp/Core/Src/display.c | New display driver with u8g2 library integration and firmware version display |
| firmware/userapp/Core/Src/button.c | New button handling implementation |
| firmware/userapp/Core/Inc/stm32g0xx_hal_conf.h | Enabled CRC module |
| firmware/userapp/Core/Inc/slave.h | New header defining slave I2C interface |
| firmware/userapp/Core/Inc/postcodes.h | New header defining POST code enums and functions |
| firmware/userapp/Core/Inc/main.h | Added stdbool.h include |
| firmware/userapp/Core/Inc/display.h | New header defining display interface |
| firmware/userapp/Core/Inc/button.h | New header defining button interface |
| firmware/scripts/fix_size_crc.py | Python script to patch tombstone size/CRC fields in binaries |
| firmware/preloader/startup.s | Assembly startup code for preloader |
| firmware/preloader/src/main.c | Preloader main implementing validation and jump logic |
| firmware/preloader/linker.ld | Linker script for preloader with tombstone section |
| firmware/preloader/include/gpio.h | GPIO configuration enums for preloader |
| firmware/preloader/Makefile | Build configuration for preloader |
| firmware/common/linker_common.ld | Shared memory layout definitions |
| firmware/common/bootloader.h | Shared bootloader interface and tombstone structure |
| firmware/common/bootloader.c | Bootloader validation and jump implementation |
| firmware/Makefile | Top-level build orchestration for both components |
| firmware/README.md | Updated documentation explaining firmware architecture |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.