Skip to content

franc0r/frankly_bootloader

Repository files navigation

FRANCOR's - Frankly Bootloader

License

BSD 3-Clause License see LICENSE

Overview

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.

Features

  • 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

Architecture

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

Quick Start

Examples Repository

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

Integration

  1. Include the bootloader headers in your embedded project:
#include <francor/franklyboot/handler.h>
#include <francor/franklyboot/msg.h>
  1. Implement the hardware interface functions in franklyboot::hwi namespace
  2. 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;
  1. Process incoming messages:
auto message = convertBytesToMsg(received_data);
bootloader.processRequest(message);
auto response = bootloader.getResponse();
// Send response via your communication interface

Building

mkdir build && cd build
cmake ..
make

Testing

The project includes comprehensive test suites:

cd build
ctest

Documentation

Comprehensive documentation is available in the docs/ directory:

Project Structure

├── 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

Hardware Interface Requirements

To integrate this bootloader, you must implement the following hardware interface functions:

  • resetDevice() - Perform system reset
  • getVendorID(), getProductID(), getProductionDate() - Device identification
  • getUniqueIDWord(idx) - 128-bit unique ID access
  • calculateCRC() - CRC calculation over memory regions
  • eraseFlashPage(), writeDataBufferToFlash() - Flash memory operations
  • readByteFromFlash() - Flash memory reading
  • startApp() - Application startup

Contributing

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

About

FRANCORs frankly easy bootloader for embedde devices

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published