@web-font-path: "roboto-debian.css";
Loading...
Searching...
No Matches
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#define UF2_FLAG_EXTENSION_FLAGS_PRESENT 0x00008000u
28
29#define RP2040_FAMILY_ID 0xe48bff56u
30#define ABSOLUTE_FAMILY_ID 0xe48bff57u
31#define DATA_FAMILY_ID 0xe48bff58u
32#define RP2350_ARM_S_FAMILY_ID 0xe48bff59u
33#define RP2350_RISCV_FAMILY_ID 0xe48bff5au
34#define RP2350_ARM_NS_FAMILY_ID 0xe48bff5bu
35#define FAMILY_ID_MAX 0xe48bff5bu
36
37// 04 e3 57 99
38#define UF2_EXTENSION_RP2_IGNORE_BLOCK 0x9957e304
39
40struct uf2_block {
41 // 32 byte header
42 uint32_t magic_start0;
43 uint32_t magic_start1;
44 uint32_t flags;
45 uint32_t target_addr;
46 uint32_t payload_size;
47 uint32_t block_no;
48 uint32_t num_blocks;
49 uint32_t file_size; // or familyID;
50 uint8_t data[476];
51 uint32_t magic_end;
52};
53
54static_assert(sizeof(struct uf2_block) == 512, "uf2_block not sector sized");
55
56#endif
Definition uf2.h:40