Skip to content

Commit 8c1afc7

Browse files
committed
Set PICO_FLASH_SPI_CLKDIV=2 when building boot2
The assembly files contain a configurable clock divider, with a default value of 4. The C SDK overwrites this value with 2, eg. for the rp pico: https://github.com/raspberrypi/pico-sdk/blob/master/src/boards/include/boards/pico.h#L70 Because we didn't set that value in rp2040-boot2-rs, rust firmwares effectively ran the flash chip at half speed. Therefore, set the preprocessor define from build.rs, to match what the C SDK does.
1 parent 4b7adf8 commit 8c1afc7

File tree

7 files changed

+1
-0
lines changed

7 files changed

+1
-0
lines changed

bin/boot2_at25sf128a.padded.bin

0 Bytes
Binary file not shown.

bin/boot2_gd25q64cs.padded.bin

0 Bytes
Binary file not shown.

bin/boot2_generic_03h.padded.bin

0 Bytes
Binary file not shown.

bin/boot2_is25lp080.padded.bin

0 Bytes
Binary file not shown.

bin/boot2_w25q080.padded.bin

0 Bytes
Binary file not shown.

bin/boot2_w25x10cl.padded.bin

0 Bytes
Binary file not shown.

build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ fn make_elf<P: AsRef<Path>, Q: AsRef<Path>>(input_path: P, out_dir: Q) -> PathBu
3434
.arg("-fPIC")
3535
.arg("--specs=nosys.specs")
3636
.arg("-Isrc/include")
37+
.arg("-DPICO_FLASH_SPI_CLKDIV=2")
3738
.arg(input_path)
3839
.arg("-o")
3940
.arg(&result_path)

0 commit comments

Comments
 (0)