Skip to content

Commit f23b2ca

Browse files
Re-enable BOOT2.S compiles in libpico
No actual changes to output boot2 files, but if they ever do update we'll catch it.
1 parent 818210d commit f23b2ca

File tree

1 file changed

+40
-34
lines changed

1 file changed

+40
-34
lines changed

tools/libpico/make-libpico.sh

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,46 @@ make -j
1717
# The develop branch of the SDK seems to have busted the RP2040 boot2.S files.
1818
# These don't change and aren't lkikely to get any new additions, so comment out
1919
# for now and use the prior versions built under earlier SDK.
20-
#rm -rf boot
21-
#mkdir boot
22-
#cd boot
23-
#mkdir -p pico
24-
#touch pico/config.h
25-
#for type in boot2_generic_03h boot2_is25lp080 boot2_w25q080 boot2_w25x10cl; do
26-
# for div in 2 4; do
27-
# arm-none-eabi-gcc -march=armv6-m -mcpu=cortex-m0plus -mthumb -O3 \
28-
# -DNDEBUG -DPICO_FLASH_SPI_CLKDIV=$div \
29-
# -c "$PICO_SDK_PATH/src/rp2040/boot_stage2/$type.S" \
30-
# -I "$PICO_SDK_PATH/src/boards/include/boards/" \
31-
# -I "$PICO_SDK_PATH/src/rp2040/hardware_regs/include/" \
32-
# -I "$PICO_SDK_PATH/src/rp2_common/pico_platform/include/" \
33-
# -I "$PICO_SDK_PATH/src/rp2_common/boot_stage2/asminclude/" \
34-
# -I "$PICO_SDK_PATH/src/rp2040/pico_platform/include/" \
35-
# -I "$PICO_SDK_PATH/src/rp2040/boot_stage2/asminclude/" \
36-
# -I .
37-
#
38-
# arm-none-eabi-gcc -march=armv6-m -mcpu=cortex-m0plus -mthumb -O3 \
39-
# -DNDEBUG -Wl,--build-id=none --specs=nosys.specs -nostartfiles \
40-
# -Wl,--script="$PICO_SDK_PATH/src/rp2040/boot_stage2/boot_stage2.ld" \
41-
# -Wl,-Map=$type.$div.elf.map $type.o -o $type.$div.elf
42-
#
43-
# arm-none-eabi-objdump -h $type.$div.elf > $type.$div.dis
44-
# arm-none-eabi-objdump -d $type.$div.elf >> $type.$div.dis
45-
#
46-
# arm-none-eabi-objcopy -Obinary $type.$div.elf $type.$div.bin
47-
#
48-
# python3 "$PICO_SDK_PATH/src/rp2040/boot_stage2/pad_checksum" \
49-
# -s 0xffffffff $type.$div.bin ${type}_${div}_padded_checksum.S
50-
# done
51-
#done
52-
#mv *.S ../../../../boot2/rp2040/.
53-
#cd ../..
20+
rm -rf boot
21+
mkdir boot
22+
cd boot
23+
mkdir -p pico
24+
touch pico/config.h
25+
cp ../generated/pico_base/pico/*.h pico/.
26+
for type in boot2_generic_03h boot2_is25lp080 boot2_w25q080 boot2_w25x10cl; do
27+
for div in 2 4; do
28+
arm-none-eabi-gcc -march=armv6-m -mcpu=cortex-m0plus -mthumb -O3 \
29+
-DNDEBUG -DPICO_FLASH_SPI_CLKDIV=$div \
30+
-c "$PICO_SDK_PATH/src/rp2040/boot_stage2/$type.S" \
31+
-I "$PICO_SDK_PATH/src/common/pico_base_headers/include/" \
32+
-I "$PICO_SDK_PATH/src/rp2_common/pico_platform_compiler/include/" \
33+
-I "$PICO_SDK_PATH/src/rp2_common/pico_platform_sections/include/" \
34+
-I "$PICO_SDK_PATH/src/rp2_common/pico_platform_panic/include/" \
35+
-I "$PICO_SDK_PATH/src/rp2_common/pico_platform_common/include/" \
36+
-I "$PICO_SDK_PATH/src/boards/include/boards/" \
37+
-I "$PICO_SDK_PATH/src/rp2040/hardware_regs/include/" \
38+
-I "$PICO_SDK_PATH/src/rp2_common/pico_platform/include/" \
39+
-I "$PICO_SDK_PATH/src/rp2_common/boot_stage2/asminclude/" \
40+
-I "$PICO_SDK_PATH/src/rp2040/pico_platform/include/" \
41+
-I "$PICO_SDK_PATH/src/rp2040/boot_stage2/asminclude/" \
42+
-I .
43+
44+
arm-none-eabi-gcc -march=armv6-m -mcpu=cortex-m0plus -mthumb -O3 \
45+
-DNDEBUG -Wl,--build-id=none --specs=nosys.specs -nostartfiles \
46+
-Wl,--script="$PICO_SDK_PATH/src/rp2040/boot_stage2/boot_stage2.ld" \
47+
-Wl,-Map=$type.$div.elf.map $type.o -o $type.$div.elf
48+
49+
arm-none-eabi-objdump -h $type.$div.elf > $type.$div.dis
50+
arm-none-eabi-objdump -d $type.$div.elf >> $type.$div.dis
51+
52+
arm-none-eabi-objcopy -Obinary $type.$div.elf $type.$div.bin
53+
54+
python3 "$PICO_SDK_PATH/src/rp2040/boot_stage2/pad_checksum" \
55+
-s 0xffffffff $type.$div.bin ${type}_${div}_padded_checksum.S
56+
done
57+
done
58+
mv *.S ../../../../boot2/rp2040/.
59+
cd ..
5460

5561
cd ..
5662
rm -rf build-rp2350

0 commit comments

Comments
 (0)