Datasheet

Table Of Contents
2.7.4.1. The RPI-RP2 Drive
The RP2040 appears as a standard 128MB flash drive named RPI-RP2 formatted as a single partition with FAT16. There
are only ever two actual files visible on the drive specified.
INFO_UF2.TXT - contains a string description of the UF2 bootloader and version.
INDEX.HTM - redirects to information about the RP2040 device.
Any type of files may be written to the USB drive from the host, however in general these are not stored, and only appear
to be so because of caching on the host side.
When a UF2 file is written to the device however, the special contents are recognized and data is written to specified
locations in RAM or Flash. On the completed download of an entire valid UF2 file, the RP2040 automatically reboots to run
the newly downloaded code.
NOTE
The INDEX.HTM file is currently redirected to https://pico.raspberrypi.org/getting-started
2.7.4.2. UF2 Format Details
There are requirements on a UF2 file to be valid to download to the RP2040. It is important that you always use valid UF2
files (as for example generated by [elf2uf2]), as invalid files may be partially written and then silently fail. Note that on
some operating systems you may receive a disk write error on failure, but this is not guaranteed. TO DO: GRAHAM: link
elf2uf2 to the appropriate content, after it’s been added
All data destined for the device must be in a UF2 block with familyID present and set to 0xe48bff56, and a payload_size
of 256.
All data must be destined for (and fit entirely within) the following memory ranges (depending on the type of binary
being downloaded which is determined by the address of the first UF2 block encountered):
a. A regular flash binary
0x10000000-0x11000000 Flash: All blocks must be targeted at 256 byte alignments. Writes beyond the end of
physical flash will wrap back to the beginning of flash.
b. A RAM only binary
0x20000000-0x20042000 Main RAM: Blocks can be positioned with byte alignment.
0x15000000-0x15004000 Flash Cache: (since flash is not being targeted, the Flash Cache is available for use as
RAM with same properties as Main RAM).
Note that traditionally UF2 has only been used to write to Flash, but this is more a limitation of using the metadata
free .BIN file as the source to generate the UF2 file. RP2040 takes full advantage of the inherent flexibility of UF2 to
support the full range of binaries in the richer .ELF format produced by the build to be used as the source for the UF2
file.
The numBlocks must specify a total size of the binary that fits in the regions specified above
A change of numBlocks or the binary type (determined by UF2 block target address) will discard the current transfer in
progress.
All data must be in blocks without the UF2_FLAG_NOT_MAIN_FLASH marking which relates to content to be ignored rather
than Flash vs RAM.
Note that flash is erased a 4K sector at a time, so writing to only a subset of a 4K flash sector will leave the rest of that
flash sector undefined. Beyond that there is no requirement that a binary be contiguous.
Note that a binary is considered "downloaded" when each of the numBlocks blocks has been seen at least once in the
course of a single valid transfer. The data for a block is only written the first time in case of the host resending duplicate
blocks.
RP2040 Datasheet
2.7. Bootrom 128