Add a production-ready, educational bootloader extension for STM32 MCUs. Core features: - Custom binary protocol with CRC16/CRC32 verification - AES-256 encryption for firmware security - Dual-bank firmware management with rollback support - Version management and firmware validation - Modular architecture with BSP abstraction layer Project structure: - include/: Header files (bootloader.h, bsp_flash.h, bsp_uart.h) - src/: Core implementation (bootloader, protocol, crypto, firmware manager) - port/: MCU-specific adaptation layer (STM32F4xx) - docs/: Documentation (integration guide, porting guide) Supported platforms: - STM32F4xx (primary) - STM32F1xx (via porting) Quick start: 1. Copy extension module to project 2. Configure bootloader_config.h 3. Modify linker script for APP_BASE_ADDR 4. Build and flash bootloader to 0x08000000 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
20 lines
619 B
C
20 lines
619 B
C
#ifndef BSP_UART_H
|
|
#define BSP_UART_H
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
typedef struct {
|
|
int (*init)(uint32_t baudrate);
|
|
int (*send)(const uint8_t *data, uint32_t length);
|
|
int (*recv)(uint8_t *buffer, uint32_t length, uint32_t timeout_ms);
|
|
void (*deinit)(void);
|
|
} bsp_uart_ops_t;
|
|
|
|
void bsp_uart_register(const bsp_uart_ops_t *ops);
|
|
int bsp_uart_init(uint32_t baudrate);
|
|
int bsp_uart_send(const uint8_t *data, uint32_t length);
|
|
int bsp_uart_recv(uint8_t *buffer, uint32_t length, uint32_t timeout_ms);
|
|
int bsp_uart_recv_byte(uint8_t *byte, uint32_t timeout_ms);
|
|
void bsp_uart_deinit(void);
|
|
|
|
#endif
|