@@ -14,43 +14,46 @@ cd build-rp2040
1414CPU=rp2040 cmake ..
1515make -j
1616
17- #  The develop branch of the SDK seems to have busted the RP2040 boot2.S files.
18- #  These don't change and aren't lkikely to get any new additions, so comment out
19- #  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 ../..
17+ rm -rf boot
18+ mkdir boot
19+ cd  boot
20+ mkdir -p pico
21+ touch pico/config.h
22+ cp ../generated/pico_base/pico/* .h pico/.
23+ for  type  in  boot2_generic_03h boot2_is25lp080 boot2_w25q080 boot2_w25x10cl;  do 
24+     for  div  in  2 4;  do 
25+         arm-none-eabi-gcc -march=armv6-m -mcpu=cortex-m0plus -mthumb -O3 \
26+                          -DNDEBUG -DPICO_FLASH_SPI_CLKDIV=$div  \
27+                          -c " $PICO_SDK_PATH /src/rp2040/boot_stage2/$type .S"   \
28+                          -I " $PICO_SDK_PATH /src/common/pico_base_headers/include/"   \
29+                          -I " $PICO_SDK_PATH /src/rp2_common/pico_platform_compiler/include/"   \
30+                          -I " $PICO_SDK_PATH /src/rp2_common/pico_platform_sections/include/"   \
31+                          -I " $PICO_SDK_PATH /src/rp2_common/pico_platform_panic/include/"   \
32+                          -I " $PICO_SDK_PATH /src/rp2_common/pico_platform_common/include/"   \
33+                          -I " $PICO_SDK_PATH /src/boards/include/boards/"   \
34+                          -I " $PICO_SDK_PATH /src/rp2040/hardware_regs/include/"   \
35+                          -I " $PICO_SDK_PATH /src/rp2_common/pico_platform/include/"   \
36+                          -I " $PICO_SDK_PATH /src/rp2_common/boot_stage2/asminclude/"   \
37+                          -I " $PICO_SDK_PATH /src/rp2040/pico_platform/include/"   \
38+                          -I " $PICO_SDK_PATH /src/rp2040/boot_stage2/asminclude/"   \
39+                          -I . 
40+ 
41+         arm-none-eabi-gcc -march=armv6-m -mcpu=cortex-m0plus -mthumb -O3 \
42+                           -DNDEBUG -Wl,--build-id=none --specs=nosys.specs -nostartfiles \
43+                           -Wl,--script=" $PICO_SDK_PATH /src/rp2040/boot_stage2/boot_stage2.ld"   \
44+                           -Wl,-Map=$type .$div .elf.map $type .o -o $type .$div .elf 
45+ 
46+         arm-none-eabi-objdump -h $type .$div .elf >   $type .$div .dis
47+         arm-none-eabi-objdump -d $type .$div .elf >>  $type .$div .dis
48+ 
49+         arm-none-eabi-objcopy -Obinary $type .$div .elf $type .$div .bin
50+ 
51+         python3 " $PICO_SDK_PATH /src/rp2040/boot_stage2/pad_checksum"   \
52+                    -s 0xffffffff $type .$div .bin ${type} _${div} _padded_checksum.S
53+     done 
54+ done 
55+ mv * .S ../../../../boot2/rp2040/.
56+ cd  ..
5457
5558cd  ..
5659rm -rf build-rp2350
0 commit comments