X5 BootLoader

来源:互联网 发布:excel表数据递增 编辑:程序博客网 时间:2024/05/16 19:22



一、X5 BootLoader的编译

      # cd  bootloader/libopencm3; make

      #cd bootloader;make


二、flash划分:

     /* flash parameters that we should not really know */
static struct {
    uint32_t    sector_number;
    uint32_t    size;
} flash_sectors[] = {
    /* flash sector zero reserved for bootloader */
        {0x01, 16 * 1024},
        {0x02, 16 * 1024},
        {0x03, 16 * 1024},
        {0x04, 64 * 1024},
        {0x05, 128 * 1024},
        {0x06, 128 * 1024},
        {0x07, 128 * 1024},
        {0x08, 128 * 1024},
        {0x09, 128 * 1024},
        {0x0a, 128 * 1024},
        {0x0b, 128 * 1024},
        /* flash sectors only in 2MiB devices */
        {0x10, 16 * 1024},
        {0x11, 16 * 1024},
        {0x12, 16 * 1024},
        {0x13, 16 * 1024},
        {0x14, 64 * 1024},
        {0x15, 128 * 1024},
        {0x16, 128 * 1024},
        {0x17, 128 * 1024},
        {0x18, 128 * 1024},
        {0x19, 128 * 1024},
        {0x1a, 128 * 1024},
        {0x1b, 128 * 1024},
};
#define BOOTLOADER_RESERVATION_SIZE    (16 * 1024)

#define OTP_BASE            0x1fff7800
#define OTP_SIZE            512
#define UDID_START                0x1FFF7A10

/* add by alva.mo 20160518, the last sector(128K) for user space */

#define USER_SPACE_SIZE            (128 * 1024)    
//#define APP_SIZE_MAX            (BOARD_FLASH_SIZE - BOOTLOADER_RESERVATION_SIZE)
#define APP_SIZE_MAX            (BOARD_FLASH_SIZE - BOOTLOADER_RESERVATION_SIZE - USER_SPACE_SIZE)

0 0