v2.0.0
uf2.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _BOOT_UF2_H
8#define _BOOT_UF2_H
9
10#include <stdint.h>
11#include <assert.h>
12
19#define UF2_MAGIC_START0 0x0A324655u
20#define UF2_MAGIC_START1 0x9E5D5157u
21#define UF2_MAGIC_END 0x0AB16F30u
22
23#define UF2_FLAG_NOT_MAIN_FLASH 0x00000001u
24#define UF2_FLAG_FILE_CONTAINER 0x00001000u
25#define UF2_FLAG_FAMILY_ID_PRESENT 0x00002000u
26#define UF2_FLAG_MD5_PRESENT 0x00004000u
27
28#define RP2040_FAMILY_ID 0xe48bff56u
29#define ABSOLUTE_FAMILY_ID 0xe48bff57u
30#define DATA_FAMILY_ID 0xe48bff58u
31#define RP2350_ARM_S_FAMILY_ID 0xe48bff59u
32#define RP2350_RISCV_FAMILY_ID 0xe48bff5au
33#define RP2350_ARM_NS_FAMILY_ID 0xe48bff5bu
34#define FAMILY_ID_MAX 0xe48bff5bu
35
36
37 struct uf2_block {
38 // 32 byte header
39 uint32_t magic_start0;
40 uint32_t magic_start1;
41 uint32_t flags;
42 uint32_t target_addr;
43 uint32_t payload_size;
44 uint32_t block_no;
45 uint32_t num_blocks;
46 uint32_t file_size; // or familyID;
47 uint8_t data[476];
48 uint32_t magic_end;
49};
50
51static_assert(sizeof(struct uf2_block) == 512, "uf2_block not sector sized");
52
53#endif
uf2_block
Definition: uf2.h:37