GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - JiChiRen/Quilla.ZP: Quilla QBOOT secure bootloader + Zephyr appliance on GD32F502VE (Cortex-M33). Boot and APP share no code, only a binary flash contract.

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
doc
doc
 
 
tools
tools
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
README.zh-CN.md
README.zh-CN.md
 
 

Repository files navigation

Quilla.ZP

中文

A minimal reference design showing Quilla QBOOT booting a Zephyr RTOS appliance on a GD32F502VE (Cortex-M33) instead of Quilla's own Contiki-based APP.

This is the Zephyr counterpart of Quilla.FR. The point of the demo is the boundary between the two images: they share no header and no source file, only a binary flash contract.

Layout

Path Contents
quilla/ Independent clone of github.com/JiChiRen/Quilla (branch develop). Not tracked here; pull/merge upstream at any time.
appliance/ Independent clone of github.com/GD32-MCU-IOT/gd32_zephyr (branch main), a Zephyr 4.4 downstream tree with GD32 support. Its directory structure is kept intact so upstream can be merged. Not tracked here.
app/ The out-of-tree Zephyr application owned by this repository. Every Quilla-side capability is added through Zephyr's own registration mechanisms; no upstream Zephyr file is modified.
doc/ Architecture, registration points, QBOOT adaptation, and build/upgrade guides (EN / zh-CN).
tools/ check_contract.py (binary-contract checker) and qboot_image.py (factory image packer).

Both upstream clones are deliberately excluded by .gitignore. Recreate them with the commands in doc/build-and-upgrade.md.

GitHub language statistics: tools/*.py is excluded via .gitattributes because those files are host-side helpers, not firmware. The repository is classified by its C product code; most of that C lives in the untracked upstream clones above and does not appear in the language bar.

The contract

Item Value
QBOOT 0x08000000, 24 KiB
META 0x08006000, 4 KiB (two 2 KiB slots, 256 B records)
APP 0x08007000 .. 0x0807FFFF (484 KiB)
QAV1 record 0x08007400 (APP start + 0x400), 8 bytes, inside the signed image
Console USART0 / PB6 TX / PB7 RX / AF0 / 115200 8N1, DMA0 CH4 in QBOOT
Core clock 160 MHz (8 MHz HXTAL + PLL), set by QBOOT and declared in the board DTS

QBOOT sets SCB->VTOR = APP_START, loads MSP and the reset handler from the first two words of the APP image, and jumps. The Zephyr image must therefore start with its vector table at 0x08007000 with no image header.

Registration points

All appliance-side behaviour is registered with Zephyr, never pasted into an unrelated Zephyr file:

Capability Zephyr mechanism File
part / version / swqboot commands SHELL_CMD_REGISTER app/src/quilla_shell.c
[QAPP] boot banner SYS_INIT app/src/quilla_shell.c
LED heart-beat K_THREAD_DEFINE + led0 devicetree alias app/src/led.c
META flag commit Zephyr flash driver API, DT_CHOSEN(zephyr_flash_controller) app/src/quilla_meta.c
QAV1 record section attribute + zephyr_linker_sources(ROM_START ...) app/src/quilla_secver.c, app/linker/quilla-secver.ld
Console and flash layout out-of-tree board (BOARD_ROOT) + devicetree chosen/overlay app/boards/gd/gd32f502ve_quilla/, app/app.overlay
Version, geometry, partition Kconfig app/Kconfig, app/prj.conf

See doc/zephyr-integration.md for the rationale of each choice.

Verification status

Compiles: verified. On-target: full QIAP upgrade passed on hardware (2026-11-09). A full clean west build -b gd32f502ve_quilla was executed on native Windows with Zephyr 4.4 (ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb, GNU Arm Embedded 13.2) and completes with zero warnings:

  • FLASH 42 004 B / 484 KB (8.48 %), RAM 9 112 B / 64 KB (13.9 %)
  • the quilla_secver (QAV1) section lands exactly at 0x08007400, verified in zephyr.bin (QAV1 + security version at offset 0x400)
  • CONFIG_FLASH_LOAD_OFFSET=0x7000, CONFIG_FLASH_LOAD_SIZE=0x79000

Verified on real hardware (GD32F502VE, QBOOT V0.11.0002 in SEC mode):

  • upgrade from the previous APP via swqboot -> QBOOT -> QIAP: 42 004 B written in 5.2 s, SIGN verified (ACK_SIGN 0x84), anti-rollback accepted secver=1
  • after the jump the banner [QAPP] Quilla.ZP V1.0.0001 arrives as one clean line (160 MHz clock handover and baud rate derivation correct); repeated cold boots behave identically
  • the Zephyr shell works; help lists part / version / swqboot etc.
  • the appliance's own swqboot (META flag write through the Zephyr flash driver under XIP + cold reboot) returns to the [BOOT] banner without a META commit failure
  • a second full QIAP upgrade initiated from the ZP APP (same image, secver=1) passes with ACK_SIGN 0x84 again; META dual-slot records and anti-rollback behave correctly across repeated upgrades

Windows notes: a workspace path containing a space breaks both CMake/Ninja and GCC (__FILE__ ends up inside unquoted assembler section names). Place the project under a space-free path and none of this applies; if the path cannot be changed, one workaround is to use 8.3 short paths everywhere after configuration.

python tools/check_contract.py passes 22/22 checks against the two clones. It compares partition geometry, META record layout, flag values, secver magic, console wiring and the CRC reference vector. Run it after every upstream pull.

For porting to another MCU, tools/qboot_image.py hard-codes the GD32F502VE geometry (512 KiB Flash / 64 KiB SRAM). See doc/mcu-porting.md for the constant table and the synchronisation checklist.

License

The appliance-owned files are BSD-3 (see LICENSE). The two upstream clones keep their own licenses (Quilla BSD-3, Zephyr Apache-2.0) and are not redistributed by this repository.

About

Quilla QBOOT secure bootloader + Zephyr appliance on GD32F502VE (Cortex-M33). Boot and APP share no code, only a binary flash contract.

Topics

anti-rollbackarmbootloadercortex-m33ed25519embeddedfirmwaregd32gd32v502otartossecure-bootzephyr

Resources

Readme
BSD-3-Clause license
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.