How erdemefe90/avr-secure-bootloader works
This is an AVR secure-firmware update system: a firmware image is packaged and encrypted, inspected and sent by a desktop flasher, then authenticated, decrypted, and written by the device bootloader before execution passes to the application. The graph preserves the distinct packaging, host-side image handling, serial protocol, device validation/programming, and application stages. README documentation describes capabilities whose implementation was not sampled; those are represented only where the tree supports a source path, and uncertain internal wiring is omitted.
Main entry points: bootloader.c Bootloader Core · main.py Flasher Controller · app_main.c Application Runtime · encrypt_image.py Image Encryption
Components 20
Firmware Packaging
- Image Encryption
Tools/encrypt_image.py - Image Decryption Tool
Tools/decrypt_image.py
Host Flasher
- Flasher Interface
Tools/Flasher/Flasher_GUI.py - Flasher Controller
Tools/Flasher/main.py - Image Extraction
Tools/Flasher/image_extract.py - Flasher Utilities
Tools/Flasher/utils.py
Device Bootloader
- Boot Entry
Bootloader/boot_main.c - Bootloader Core
Bootloader/bootloader.c - Boot UART Protocol
Bootloader/uart.c - CRC16-CCITT
Common/crc.c - AES Implementation
Bootloader/tiny-AES-c
Application Runtime
- Application Image
App/app_main.c - Image Metadata
Common/image.h - Shared Boot State
Common/image.h - Application Runtime
App/app_main.c - Application UART
App/uart.c - UART Buffers
App/circular_buffer.c
Other components
- Firmware Operator
- Serial Port
- AVR Device
Connections 23
- Firmware Operator → Image Encryption: selects firmware
- Application Image → Image Encryption: packages image
- Image Metadata → Image Encryption: defines header
- Image Encryption → Flasher Controller: produces update file
- Firmware Operator → Flasher Interface: operates
- Flasher Interface → Flasher Controller: dispatches actions
- Flasher Controller → Image Extraction: requests image parsing
- Image Extraction → Flasher Utilities: checks CRC
- Image Extraction → Flasher Controller: returns update data
- Image Decryption Tool → Image Metadata: reads image metadata
- Flasher Controller → Serial Port: exchanges packets
- Serial Port → Boot UART Protocol: transfers packets
- Boot Entry → Bootloader Core: checks and processes
- Bootloader Core → Boot UART Protocol: reads and transmits
- Boot UART Protocol → CRC16-CCITT: validates packet CRC
- Bootloader Core → AES Implementation: decrypts payload
- Bootloader Core → Shared Boot State: reads and updates
- Bootloader Core → AVR Device: writes flash or jumps
- AVR Device → Application Runtime: runs application
- Application Runtime → Image Metadata: defines image header
- Application Runtime → Shared Boot State: updates boot state
- Application Runtime → Application UART: initializes and uses
- Application UART → UART Buffers: buffers serial data