Unverified Commit a259eb73 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Clean up directory organization, libpico build (#129)

Also add a README.md to the tools directory.
parent 7f8f0cc1
No preview for this file type
-iwithprefixbefore/cores/rp2040/api/deprecated-avr-comp/
-iwithprefixbefore/pico_base/
-iwithprefixbefore/lib/pico_base/
-iwithprefixbefore/pico-examples/build/generated/pico_base
-iwithprefixbefore/pico-extras/src/common/pico_audio/include
-iwithprefixbefore/pico-extras/src/common/pico_util_buffer/include
......
mkdir -p pico
touch pico/config.h
for type in boot2_generic_03h boot2_is25lp080 boot2_w25q080 boot2_w25x10cl; do
for div in 2 4; do
../../system/arm-none-eabi/bin/arm-none-eabi-gcc -march=armv6-m -mcpu=cortex-m0plus -mthumb -O3 -DNDEBUG -DPICO_FLASH_SPI_CLKDIV=$div -c ../../pico-sdk/src/rp2_common/boot_stage2/$type.S -I ../../pico-sdk/src/rp2_common/pico_platform/include/ -I ../../pico-sdk/src/rp2040/hardware_regs/include/ -I../../pico-sdk/src/rp2_common/boot_stage2/asminclude/ -I.
../../system/arm-none-eabi/bin/arm-none-eabi-gcc -march=armv6-m -mcpu=cortex-m0plus -mthumb -O3 -DNDEBUG -Wl,--build-id=none --specs=nosys.specs -nostartfiles -Wl,--script=../../pico-sdk/src/rp2_common/boot_stage2/boot_stage2.ld -Wl,-Map=$type.$div.elf.map $type.o -o $type.$div.elf
../../system/arm-none-eabi/bin/arm-none-eabi-objdump -h $type.$div.elf > $type.$div.dis
../../system/arm-none-eabi/bin/arm-none-eabi-objdump -d $type.$div.elf >> $type.$div.dis
../../system/arm-none-eabi/bin/arm-none-eabi-objcopy -Obinary $type.$div.elf $type.$div.bin
python3 ../../pico-sdk/src/rp2_common/boot_stage2/pad_checksum -s 0xffffffff $type.$div.bin ${type}_${div}_padded_checksum.S
done
done
#!/bin/bash
rm -rf build
mkdir build
cd build
PICO_SDK_PATH=../../pico-sdk/ PATH="$(cd ../../system/arm-none-eabi/bin; pwd):$PATH" cmake ..
make -j32
cp libpico.a ../../lib/.
cp generated/pico_base/pico/version.h ../../pico_base/pico/.
cd ..
rm -rf boot
mkdir boot
cd boot
../boot.sh
cp *.S ../../assembly/.
cd ..
# Tools directory for the RP2040 Arduino-Pico
# get.py
Downloads and installs the toolchain into a GIT clone of the repo. Run
once after the `git clone` and any time the toolchain JSON file updates.
The `dist` directory caches downloaded toolchain files.
# discovery.py
Run in the background by the IDE to scan for UF2 drives to show in the
menus. Normally not run manually by the user.
# uf2conv.py
Manages the upload of the UF2 formatted file to the board. Called as part
of the IDE upload process. Will optionally send the serial reset signal
to get the board into update mode (1200bps connection).
# simplesub.py
Very dumb `sed`-like tool used by the platform scripts to generate the
linker `.ld` file (replacing the EEPROM location, FS sizes, etc.).
Because we run on Windows, Mac, and Linux, need to provide this and not
rely on existance of `sed` command.
# pyserial
`git clone` of the PySerial Python3 library to be used by the IDE.
# makeboards.py
Generates `boards.txt` programmatically. Never edit the `boards.txt` file
manually, use `python3 tools/makeboards.py > boards.py`. Change the script
as necessary to add any add'l fields or menus required. Used because the
`boards.txt` file is very repetitive and it's safer to generate with code
than by hand.
# libpico/make-libpico.sh
Builds the libpico.a file as well as the bootloader stage2 binaries.
Run whenever the pico-sdk is updated.
......@@ -72,7 +72,7 @@ target_link_libraries(pico
)
add_custom_command(TARGET pico PRE_BUILD
COMMAND ../../system/arm-none-eabi/bin/arm-none-eabi-gcc -g -c ../../assembly/crt0.S -I ../../pico-sdk/src/rp2040/hardware_regs/include -I ../../pico-sdk/src/common/pico_binary_info/include/
COMMAND arm-none-eabi-gcc -g -c ../../../assembly/crt0.S -I "${PICO_SDK_PATH}/src/rp2040/hardware_regs/include" -I "${PICO_SDK_PATH}/src/common/pico_binary_info/include/"
)
add_custom_command(TARGET pico POST_BUILD
......
#!/bin/bash
set -e # Exit on error
export PICO_SDK_PATH="$(cd ../../pico-sdk/; pwd)"
export PATH="$(cd ../../system/arm-none-eabi/bin; pwd):$PATH"
rm -rf build
mkdir build
cd build
cmake ..
make -j
mv libpico.a ../../../lib/.
mv generated/pico_base/pico/version.h ../../../lib/pico_base/pico/.
rm -rf boot
mkdir boot
cd boot
mkdir -p pico
touch pico/config.h
for type in boot2_generic_03h boot2_is25lp080 boot2_w25q080 boot2_w25x10cl; do
for div in 2 4; do
arm-none-eabi-gcc -march=armv6-m -mcpu=cortex-m0plus -mthumb -O3 \
-DNDEBUG -DPICO_FLASH_SPI_CLKDIV=$div \
-c "$PICO_SDK_PATH/src/rp2_common/boot_stage2/$type.S" \
-I "$PICO_SDK_PATH/src/rp2040/hardware_regs/include/" \
-I "$PICO_SDK_PATH/src/rp2_common/pico_platform/include/" \
-I "$PICO_SDK_PATH/src/rp2_common/boot_stage2/asminclude/" \
-I .
arm-none-eabi-gcc -march=armv6-m -mcpu=cortex-m0plus -mthumb -O3 \
-DNDEBUG -Wl,--build-id=none --specs=nosys.specs -nostartfiles \
-Wl,--script="$PICO_SDK_PATH/src/rp2_common/boot_stage2/boot_stage2.ld" \
-Wl,-Map=$type.$div.elf.map $type.o -o $type.$div.elf
arm-none-eabi-objdump -h $type.$div.elf > $type.$div.dis
arm-none-eabi-objdump -d $type.$div.elf >> $type.$div.dis
arm-none-eabi-objcopy -Obinary $type.$div.elf $type.$div.bin
python3 "$PICO_SDK_PATH/src/rp2_common/boot_stage2/pad_checksum" \
-s 0xffffffff $type.$div.bin ${type}_${div}_padded_checksum.S
done
done
mv *.S ../../../../assembly/.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment