Add wolfBoot HAL port for RealTek RTL8735B (AmebaPro2)#797
Draft
dgarske wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds initial wolfBoot HAL enablement for the RealTek RTL8735B (AmebaPro2) platform, including build integration and packaging support for producing a flashable image using the vendor SDK tooling.
Changes:
- Introduces a new RTL8735B HAL implementation and linker script for SRAM-staged boot.
- Adds an SDK shim header to avoid pulling FreeRTOS/CMSIS-OS into the wolfBoot build.
- Adds build system wiring (arch.mk), example config, and a packaging script to generate
flash_ntz.bin.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/scripts/amebapro2_package.sh | Adds packaging flow to convert wolfboot.elf into a vendor-style flash image. |
| hal/rtl8735b/sdk-shim/cmsis_os.h | Provides CMSIS-OS opaque typedefs to compile SDK headers without FreeRTOS. |
| hal/rtl8735b/README | Documents the RTL8735B HAL design, backends, and SDK integration approach. |
| hal/rtl8735b.ld | Defines SRAM layout, RAM start-table placement, and partition symbols. |
| hal/rtl8735b.c | Implements RTL8735B HAL + RAM start-table/trampoline + SDK-backed ext flash/cache hooks. |
| config/examples/rtl8735b.config | Provides an example configuration for RTL8735B builds and partition layout. |
| arch.mk | Adds TARGET=rtl8735b build integration and SDK include/define wiring. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5301be9 to
833e5bb
Compare
e1989c6 to
fcce147
Compare
fcce147 to
0e6c1f1
Compare
Comment on lines
+423
to
+442
| int ext_flash_read(uintptr_t address, uint8_t *data, int len) | ||
| { | ||
| if (len <= 0) { | ||
| return -1; | ||
| } | ||
| #ifdef HAL_BACKEND_SDK | ||
| /* flash_stream_read returns 1 on success; propagate a read failure rather | ||
| * than handing potentially-stale data to the verifier. */ | ||
| if (flash_stream_read(&hal_flash_obj, (uint32_t)address, (uint32_t)len, | ||
| data) != 1) { | ||
| return -1; | ||
| } | ||
| return len; | ||
| #else | ||
| /* TODO(bare): implement via direct SPIC / ROM hal_flash_stream_read. */ | ||
| (void)address; | ||
| (void)data; | ||
| return -1; | ||
| #endif | ||
| } |
Comment on lines
+444
to
+462
| int ext_flash_write(uintptr_t address, const uint8_t *data, int len) | ||
| { | ||
| if (len <= 0) { | ||
| return -1; | ||
| } | ||
| #ifdef HAL_BACKEND_SDK | ||
| /* flash_stream_write returns 1 on success; propagate a write failure. */ | ||
| if (flash_stream_write(&hal_flash_obj, (uint32_t)address, (uint32_t)len, | ||
| (uint8_t *)data) != 1) { | ||
| return -1; | ||
| } | ||
| return 0; | ||
| #else | ||
| /* TODO(bare): implement via direct SPIC / ROM hal_flash_burst_write. */ | ||
| (void)address; | ||
| (void)data; | ||
| return -1; | ||
| #endif | ||
| } |
Comment on lines
+390
to
+403
| int hal_flash_write(uint32_t address, const uint8_t *data, int len) | ||
| { | ||
| (void)address; | ||
| (void)data; | ||
| (void)len; | ||
| return 0; | ||
| } | ||
|
|
||
| int hal_flash_erase(uint32_t address, int len) | ||
| { | ||
| (void)address; | ||
| (void)len; | ||
| return 0; | ||
| } |
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.
Adds wolfBoot support for the RealTek RTL8735B (Arm Cortex-M33) as used on the AmebaPro2 EVB. wolfBoot runs as a second-stage verified bootloader and A/B firmware-update engine on top of RealTek's secure-boot ROM -- the non-TrustZone "Model A" integration.
How it boots
RealTek ROM -> boot.bin -> wolfBoot (staged into SRAM via a RealTek RAM start-table) -> verifies the application in external SPI NOR (ECDSA P-256 / SHA-256), applies any pending A/B update, copies the verified image into DDR, and jumps. This reuses wolfBoot's existing RAMBOOT path (
EXT_FLASH+NO_XIP,src/update_ram.c); no new boot assembly is required.What's included
hal/rtl8735b.c/hal/rtl8735b.ld: single-file HAL -- HAL entry points,ext_flash_*over the RealTek SPI NOR, the RAM start-table + trampoline, cache maintenance, a self-containedDEBUG_UARTconsole, and a reset-reason readout. Flash/UART/cache backend selected byHAL_BACKEND(sdk= default/working;bare= scaffold).config/examples/rtl8735b.configand anarch.mktarget block.tools/scripts/rtl8735b_build.sh(compile + SDK-resolved final link) andtools/scripts/amebapro2_package.sh(wrapwolfboot.elfinto a flashableflash_ntz.bin).hal/rtl8735b/test-app/: a minimal DDR test application (also demonstrates servicing the vendor watchdog).docs/Targets.mdsection (build, staging an app, A/B update, watchdog, status/roadmap) andhal/rtl8735b/README.Verified on the AmebaPro2 EVB
DEBUG_UARTconsole and signed boot of an application from the BOOT partition (verify -> copy to DDR -> jump).Follow-ons (not in this PR)
See the "Status and roadmap" list in the
docs/Targets.mdsection: device-bound encrypted updates bound to the Hardware Unique Key (wolfSSL PR #10677), TrustZone-M "Model B", the no-SDK "bare" backend, and measured boot / DICE.