BSD 3-Clause License see LICENSE
This is the embedded device bootloader developed by the non-profit association FRANCOR - Franconia Open Robotics. The aim is to provide a very basic, expandable bootloader, which is supporting multiple communication devices e.g. (CAN, Serial, ...).
This repository contains the source files, which has to be included to the embedded device. The application to flash the bootloader is developed in another repository.
- Multi-transport Support: Designed to work with CAN, Serial, and other communication protocols
- Template-based Architecture: Configurable flash parameters via C++ templates
- 128-bit Unique Device ID: Full device identification support
- CRC Verification: Built-in application integrity checking
- Page Buffer Management: Efficient flash programming via RAM buffer
- Hardware Abstraction: Clean separation between bootloader logic and hardware interface
The bootloader consists of several key components:
- Handler Template: Core bootloader logic with configurable flash parameters
- Message Protocol: Standardized request/response communication
- Hardware Interface: Abstract layer for hardware-specific operations
- Utility Tools: Device simulation and testing infrastructure
Complete implementation examples for various devices and platforms are available in the Frankly Bootloader Examples repository. This includes:
- STM32 implementations with CAN and UART communication
- Host applications for flashing and device management
- Platform-specific hardware interface implementations
- Real-world integration examples for different microcontrollers
- Include the bootloader headers in your embedded project:
#include <francor/franklyboot/handler.h>
#include <francor/franklyboot/msg.h>- Implement the hardware interface functions in
franklyboot::hwinamespace - Instantiate the Handler template with your flash parameters:
// Example for STM32 with 128KB flash, 2KB pages, app starting at page 32
franklyboot::Handler<0x08000000, 32, 131072, 2048> bootloader;- Process incoming messages:
auto message = convertBytesToMsg(received_data);
bootloader.processRequest(message);
auto response = bootloader.getResponse();
// Send response via your communication interfacemkdir build && cd build
cmake ..
makeThe project includes comprehensive test suites:
cd build
ctestComprehensive documentation is available in the docs/ directory:
- Architecture Overview - System design and component interaction
- Integration Guide - Step-by-step guide for integrating the bootloader into new hardware
- Development Guide - Testing, tools, and development workflow
- Communication Protocol - Message format and protocol specification
- Request Types - Complete reference of all request types
- Result Types - Error codes and response types
- Implementation Examples (External repository)
├── include/francor/franklyboot/ # Public API headers
├── src/francor/franklyboot/ # Implementation files
├── tests/ # Test suites
├── utils/ # Utility tools
│ ├── device_sim_api/ # Device simulator API
│ └── can_network_sim/ # CAN network simulator
└── docs/ # Documentation
To integrate this bootloader, you must implement the following hardware interface functions:
resetDevice()- Perform system resetgetVendorID(),getProductID(),getProductionDate()- Device identificationgetUniqueIDWord(idx)- 128-bit unique ID accesscalculateCRC()- CRC calculation over memory regionseraseFlashPage(),writeDataBufferToFlash()- Flash memory operationsreadByteFromFlash()- Flash memory readingstartApp()- Application startup
We welcome contributions! Please see our coding standards:
- Follow the existing C++17 style
- Use clang-format configuration provided
- Add tests for new features
- Update documentation as needed