Adafruit Feather, overclocking, flash FS shims
Add support for Adafruit Feather RP2040 (8MB). Identified with a unique USB PID so it displays properly once programmed one time. Moved LED to pin 13 (per the website docs), but have no board to test. Add over/underclocking menus, applied at boot. Use at your own risk, as usual. Add shims to allocate flash space for a filesystem (but not implemented yet). Add a "generic" RP2040 board
This commit is contained in:
parent
33dc16d033
commit
b2cef8d8d6
9 changed files with 444 additions and 293 deletions
324
boards.txt
324
boards.txt
|
|
@ -1,18 +1,17 @@
|
||||||
menu.BoardModel=Model
|
menu.BoardModel=Model
|
||||||
menu.led=Builtin LED
|
menu.flash=Flash Size
|
||||||
menu.ResetMethod=Reset Method
|
menu.freq=CPU Speed
|
||||||
menu.dbg=Debug Port
|
menu.dbgport=Debug Port
|
||||||
menu.lvl=Debug Level
|
menu.dbglvl=Debug Level
|
||||||
|
|
||||||
##############################################################
|
|
||||||
rpipico.name=Raspberry Pi Pico
|
rpipico.name=Raspberry Pi Pico
|
||||||
rpipico.vid.0=0x2e8a
|
rpipico.vid.0=0x2e8a
|
||||||
rpipico.pid.0=0x000a
|
rpipico.pid.0=0x000a
|
||||||
rpipico.build.board=RPI_PICO
|
rpipico.build.usbpid=-DSERIALUSB_PID=0x000a
|
||||||
|
rpipico.build.board=RASPBERRY_PI_PICO
|
||||||
rpipico.build.mcu=cortex-m0plus
|
rpipico.build.mcu=cortex-m0plus
|
||||||
rpipico.build.variant=rpipico
|
rpipico.build.variant=rpipico
|
||||||
rpipico.upload.tool=uf2conv
|
rpipico.upload.tool=uf2conv
|
||||||
rpipico.upload.maximum_size=2093056
|
rpipico.upload.maximum_size=2097152
|
||||||
rpipico.upload.maximum_data_size=262144
|
rpipico.upload.maximum_data_size=262144
|
||||||
rpipico.upload.wait_for_upload_port=true
|
rpipico.upload.wait_for_upload_port=true
|
||||||
rpipico.upload.erase_cmd=
|
rpipico.upload.erase_cmd=
|
||||||
|
|
@ -23,22 +22,293 @@ rpipico.build.led=
|
||||||
rpipico.build.core=rp2040
|
rpipico.build.core=rp2040
|
||||||
rpipico.build.mcu=rp2040
|
rpipico.build.mcu=rp2040
|
||||||
rpipico.build.ldscript=memmap_default.ld
|
rpipico.build.ldscript=memmap_default.ld
|
||||||
rpipico.menu.dbg.Disabled.build.debug_port=
|
rpipico.menu.flash.2097152_0=2MB (no FS)
|
||||||
rpipico.menu.dbg.Serial=Serial
|
rpipico.menu.flash.2097152_0.upload.maximum_size=2093056
|
||||||
rpipico.menu.dbg.Serial.build.debug_port=-DDEBUG_RP2040_PORT=Serial
|
rpipico.menu.flash.2097152_0.build.flash_length=2093056
|
||||||
rpipico.menu.dbg.Serial1=Serial1
|
rpipico.menu.flash.2097152_0.build.eeprom_start=2093056
|
||||||
rpipico.menu.dbg.Serial1.build.debug_port=-DDEBUG_RP2040_PORT=Serial1
|
rpipico.menu.flash.2097152_0.build.fs_start=2093056
|
||||||
rpipico.menu.dbg.Serial2=Serial2
|
rpipico.menu.flash.2097152_0.build.fs_end=2093056
|
||||||
rpipico.menu.dbg.Serial2.build.debug_port=-DDEBUG_RP2040_PORT=Serial2
|
rpipico.menu.flash.2097152_65536=2MB (FS: 64KB)
|
||||||
rpipico.menu.lvl.None____=None
|
rpipico.menu.flash.2097152_65536.upload.maximum_size=2027520
|
||||||
rpipico.menu.lvl.None____.build.debug_level=
|
rpipico.menu.flash.2097152_65536.build.flash_length=2027520
|
||||||
rpipico.menu.lvl.Core=Core
|
rpipico.menu.flash.2097152_65536.build.eeprom_start=2093056
|
||||||
rpipico.menu.lvl.Core.build.debug_level=-DDEBUG_RP2040_CORE
|
rpipico.menu.flash.2097152_65536.build.fs_start=2027520
|
||||||
rpipico.menu.lvl.SPI=SPI
|
rpipico.menu.flash.2097152_65536.build.fs_end=2093056
|
||||||
rpipico.menu.lvl.SPI.build.debug_level=-DDEBUG_RP2040_SPI
|
rpipico.menu.flash.2097152_262144=2MB (FS: 256KB)
|
||||||
rpipico.menu.lvl.Wire=Wire
|
rpipico.menu.flash.2097152_262144.upload.maximum_size=1830912
|
||||||
rpipico.menu.lvl.Wire.build.debug_level=-DDEBUG_RP2040_WIRE
|
rpipico.menu.flash.2097152_262144.build.flash_length=1830912
|
||||||
rpipico.menu.lvl.All=All
|
rpipico.menu.flash.2097152_262144.build.eeprom_start=2093056
|
||||||
rpipico.menu.lvl.All.build.debug_level=-DDEBUG_RP2040_WIRE -DDEBUG_RP2040_SPI -DDEBUG_RP2040_CORE
|
rpipico.menu.flash.2097152_262144.build.fs_start=1830912
|
||||||
rpipico.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG
|
rpipico.menu.flash.2097152_262144.build.fs_end=2093056
|
||||||
rpipico.menu.lvl.NoAssert-NDEBUG.build.debug_level=-DNDEBUG
|
rpipico.menu.flash.2097152_524288=2MB (FS: 512KB)
|
||||||
|
rpipico.menu.flash.2097152_524288.upload.maximum_size=1568768
|
||||||
|
rpipico.menu.flash.2097152_524288.build.flash_length=1568768
|
||||||
|
rpipico.menu.flash.2097152_524288.build.eeprom_start=2093056
|
||||||
|
rpipico.menu.flash.2097152_524288.build.fs_start=1568768
|
||||||
|
rpipico.menu.flash.2097152_524288.build.fs_end=2093056
|
||||||
|
rpipico.menu.flash.2097152_1048576=2MB (FS: 1MB)
|
||||||
|
rpipico.menu.flash.2097152_1048576.upload.maximum_size=1044480
|
||||||
|
rpipico.menu.flash.2097152_1048576.build.flash_length=1044480
|
||||||
|
rpipico.menu.flash.2097152_1048576.build.eeprom_start=2093056
|
||||||
|
rpipico.menu.flash.2097152_1048576.build.fs_start=1044480
|
||||||
|
rpipico.menu.flash.2097152_1048576.build.fs_end=2093056
|
||||||
|
rpipico.menu.freq.125=125 MHz
|
||||||
|
rpipico.menu.freq.125.build.f_cpu=125000000L
|
||||||
|
rpipico.menu.freq.50=50 MHz
|
||||||
|
rpipico.menu.freq.50.build.f_cpu=50000000L
|
||||||
|
rpipico.menu.freq.100=100 MHz
|
||||||
|
rpipico.menu.freq.100.build.f_cpu=100000000L
|
||||||
|
rpipico.menu.freq.133=133 MHz
|
||||||
|
rpipico.menu.freq.133.build.f_cpu=133000000L
|
||||||
|
rpipico.menu.freq.150=150 MHz (Overclock)
|
||||||
|
rpipico.menu.freq.150.build.f_cpu=150000000L
|
||||||
|
rpipico.menu.freq.175=175 MHz (Overclock)
|
||||||
|
rpipico.menu.freq.175.build.f_cpu=175000000L
|
||||||
|
rpipico.menu.freq.200=200 MHz (Overclock)
|
||||||
|
rpipico.menu.freq.200.build.f_cpu=200000000L
|
||||||
|
rpipico.menu.freq.225=225 MHz (Overclock)
|
||||||
|
rpipico.menu.freq.225.build.f_cpu=225000000L
|
||||||
|
rpipico.menu.freq.250=250 MHz (Overclock)
|
||||||
|
rpipico.menu.freq.250.build.f_cpu=250000000L
|
||||||
|
rpipico.menu.freq.275=275 MHz (Overclock)
|
||||||
|
rpipico.menu.freq.275.build.f_cpu=275000000L
|
||||||
|
rpipico.menu.freq.300=300 MHz (Overclock)
|
||||||
|
rpipico.menu.freq.300.build.f_cpu=300000000L
|
||||||
|
rpipico.menu.dbgport.Disabled=Disabled
|
||||||
|
rpipico.menu.dbgport.Disabled.build.debug_port=
|
||||||
|
rpipico.menu.dbgport.Serial=Serial
|
||||||
|
rpipico.menu.dbgport.Serial.build.debug_port=-DDEBUG_RP2040_PORT=Serial
|
||||||
|
rpipico.menu.dbgport.Serial1=Serial1
|
||||||
|
rpipico.menu.dbgport.Serial1.build.debug_port=-DDEBUG_RP2040_PORT=Serial1
|
||||||
|
rpipico.menu.dbgport.Serial2=Serial2
|
||||||
|
rpipico.menu.dbgport.Serial2.build.debug_port=-DDEBUG_RP2040_PORT=Serial2
|
||||||
|
rpipico.menu.dbglvl.None=None
|
||||||
|
rpipico.menu.dbglvl.None.build.debug_level=
|
||||||
|
rpipico.menu.dbglvl.Core=Core
|
||||||
|
rpipico.menu.dbglvl.Core.build.debug_level=-DDEBUG_RP2040_CORE
|
||||||
|
rpipico.menu.dbglvl.SPI=SPI
|
||||||
|
rpipico.menu.dbglvl.SPI.build.debug_level=-DDEBUG_RP2040_SPI
|
||||||
|
rpipico.menu.dbglvl.Wire=Wire
|
||||||
|
rpipico.menu.dbglvl.Wire.build.debug_level=DDEBUG_RP2040_WIRE
|
||||||
|
rpipico.menu.dbglvl.All=All
|
||||||
|
rpipico.menu.dbglvl.All.build.debug_level=-DDEBUG_RP2040_WIRE -DDEBUG_RP2040_SPI -DDEBUG_RP2040_CORE
|
||||||
|
rpipico.menu.dbglvl.NDEBUG=NDEBUG
|
||||||
|
rpipico.menu.dbglvl.NDEBUG.build.debug_level=-DNDEBUG
|
||||||
|
adafruitfeather.name=Adafruit Feather RP2040
|
||||||
|
adafruitfeather.vid.0=0x2e8a
|
||||||
|
adafruitfeather.pid.0=0x000b
|
||||||
|
adafruitfeather.build.usbpid=-DSERIALUSB_PID=0x000b
|
||||||
|
adafruitfeather.build.board=ADAFRUIT_FEATHER_RP2040
|
||||||
|
adafruitfeather.build.mcu=cortex-m0plus
|
||||||
|
adafruitfeather.build.variant=adafruitfeather
|
||||||
|
adafruitfeather.upload.tool=uf2conv
|
||||||
|
adafruitfeather.upload.maximum_size=8388608
|
||||||
|
adafruitfeather.upload.maximum_data_size=262144
|
||||||
|
adafruitfeather.upload.wait_for_upload_port=true
|
||||||
|
adafruitfeather.upload.erase_cmd=
|
||||||
|
adafruitfeather.serial.disableDTR=false
|
||||||
|
adafruitfeather.serial.disableRTS=false
|
||||||
|
adafruitfeather.build.f_cpu=125000000
|
||||||
|
adafruitfeather.build.led=
|
||||||
|
adafruitfeather.build.core=rp2040
|
||||||
|
adafruitfeather.build.mcu=rp2040
|
||||||
|
adafruitfeather.build.ldscript=memmap_default.ld
|
||||||
|
adafruitfeather.menu.flash.8388608_0=8MB (no FS)
|
||||||
|
adafruitfeather.menu.flash.8388608_0.upload.maximum_size=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_0.build.flash_length=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_0.build.eeprom_start=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_0.build.fs_start=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_0.build.fs_end=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_65536=8MB (FS: 64KB)
|
||||||
|
adafruitfeather.menu.flash.8388608_65536.upload.maximum_size=8318976
|
||||||
|
adafruitfeather.menu.flash.8388608_65536.build.flash_length=8318976
|
||||||
|
adafruitfeather.menu.flash.8388608_65536.build.eeprom_start=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_65536.build.fs_start=8318976
|
||||||
|
adafruitfeather.menu.flash.8388608_65536.build.fs_end=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_262144=8MB (FS: 256KB)
|
||||||
|
adafruitfeather.menu.flash.8388608_262144.upload.maximum_size=8122368
|
||||||
|
adafruitfeather.menu.flash.8388608_262144.build.flash_length=8122368
|
||||||
|
adafruitfeather.menu.flash.8388608_262144.build.eeprom_start=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_262144.build.fs_start=8122368
|
||||||
|
adafruitfeather.menu.flash.8388608_262144.build.fs_end=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_524288=8MB (FS: 512KB)
|
||||||
|
adafruitfeather.menu.flash.8388608_524288.upload.maximum_size=7860224
|
||||||
|
adafruitfeather.menu.flash.8388608_524288.build.flash_length=7860224
|
||||||
|
adafruitfeather.menu.flash.8388608_524288.build.eeprom_start=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_524288.build.fs_start=7860224
|
||||||
|
adafruitfeather.menu.flash.8388608_524288.build.fs_end=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_1048576=8MB (FS: 1MB)
|
||||||
|
adafruitfeather.menu.flash.8388608_1048576.upload.maximum_size=7335936
|
||||||
|
adafruitfeather.menu.flash.8388608_1048576.build.flash_length=7335936
|
||||||
|
adafruitfeather.menu.flash.8388608_1048576.build.eeprom_start=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_1048576.build.fs_start=7335936
|
||||||
|
adafruitfeather.menu.flash.8388608_1048576.build.fs_end=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_2097152=8MB (FS: 2MB)
|
||||||
|
adafruitfeather.menu.flash.8388608_2097152.upload.maximum_size=6287360
|
||||||
|
adafruitfeather.menu.flash.8388608_2097152.build.flash_length=6287360
|
||||||
|
adafruitfeather.menu.flash.8388608_2097152.build.eeprom_start=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_2097152.build.fs_start=6287360
|
||||||
|
adafruitfeather.menu.flash.8388608_2097152.build.fs_end=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_3145728=8MB (FS: 3MB)
|
||||||
|
adafruitfeather.menu.flash.8388608_3145728.upload.maximum_size=5238784
|
||||||
|
adafruitfeather.menu.flash.8388608_3145728.build.flash_length=5238784
|
||||||
|
adafruitfeather.menu.flash.8388608_3145728.build.eeprom_start=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_3145728.build.fs_start=5238784
|
||||||
|
adafruitfeather.menu.flash.8388608_3145728.build.fs_end=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_4194304=8MB (FS: 4MB)
|
||||||
|
adafruitfeather.menu.flash.8388608_4194304.upload.maximum_size=4190208
|
||||||
|
adafruitfeather.menu.flash.8388608_4194304.build.flash_length=4190208
|
||||||
|
adafruitfeather.menu.flash.8388608_4194304.build.eeprom_start=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_4194304.build.fs_start=4190208
|
||||||
|
adafruitfeather.menu.flash.8388608_4194304.build.fs_end=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_5242880=8MB (FS: 5MB)
|
||||||
|
adafruitfeather.menu.flash.8388608_5242880.upload.maximum_size=3141632
|
||||||
|
adafruitfeather.menu.flash.8388608_5242880.build.flash_length=3141632
|
||||||
|
adafruitfeather.menu.flash.8388608_5242880.build.eeprom_start=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_5242880.build.fs_start=3141632
|
||||||
|
adafruitfeather.menu.flash.8388608_5242880.build.fs_end=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_6291456=8MB (FS: 6MB)
|
||||||
|
adafruitfeather.menu.flash.8388608_6291456.upload.maximum_size=2093056
|
||||||
|
adafruitfeather.menu.flash.8388608_6291456.build.flash_length=2093056
|
||||||
|
adafruitfeather.menu.flash.8388608_6291456.build.eeprom_start=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_6291456.build.fs_start=2093056
|
||||||
|
adafruitfeather.menu.flash.8388608_6291456.build.fs_end=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_7340032=8MB (FS: 7MB)
|
||||||
|
adafruitfeather.menu.flash.8388608_7340032.upload.maximum_size=1044480
|
||||||
|
adafruitfeather.menu.flash.8388608_7340032.build.flash_length=1044480
|
||||||
|
adafruitfeather.menu.flash.8388608_7340032.build.eeprom_start=8384512
|
||||||
|
adafruitfeather.menu.flash.8388608_7340032.build.fs_start=1044480
|
||||||
|
adafruitfeather.menu.flash.8388608_7340032.build.fs_end=8384512
|
||||||
|
adafruitfeather.menu.freq.125=125 MHz
|
||||||
|
adafruitfeather.menu.freq.125.build.f_cpu=125000000L
|
||||||
|
adafruitfeather.menu.freq.50=50 MHz
|
||||||
|
adafruitfeather.menu.freq.50.build.f_cpu=50000000L
|
||||||
|
adafruitfeather.menu.freq.100=100 MHz
|
||||||
|
adafruitfeather.menu.freq.100.build.f_cpu=100000000L
|
||||||
|
adafruitfeather.menu.freq.133=133 MHz
|
||||||
|
adafruitfeather.menu.freq.133.build.f_cpu=133000000L
|
||||||
|
adafruitfeather.menu.freq.150=150 MHz (Overclock)
|
||||||
|
adafruitfeather.menu.freq.150.build.f_cpu=150000000L
|
||||||
|
adafruitfeather.menu.freq.175=175 MHz (Overclock)
|
||||||
|
adafruitfeather.menu.freq.175.build.f_cpu=175000000L
|
||||||
|
adafruitfeather.menu.freq.200=200 MHz (Overclock)
|
||||||
|
adafruitfeather.menu.freq.200.build.f_cpu=200000000L
|
||||||
|
adafruitfeather.menu.freq.225=225 MHz (Overclock)
|
||||||
|
adafruitfeather.menu.freq.225.build.f_cpu=225000000L
|
||||||
|
adafruitfeather.menu.freq.250=250 MHz (Overclock)
|
||||||
|
adafruitfeather.menu.freq.250.build.f_cpu=250000000L
|
||||||
|
adafruitfeather.menu.freq.275=275 MHz (Overclock)
|
||||||
|
adafruitfeather.menu.freq.275.build.f_cpu=275000000L
|
||||||
|
adafruitfeather.menu.freq.300=300 MHz (Overclock)
|
||||||
|
adafruitfeather.menu.freq.300.build.f_cpu=300000000L
|
||||||
|
adafruitfeather.menu.dbgport.Disabled=Disabled
|
||||||
|
adafruitfeather.menu.dbgport.Disabled.build.debug_port=
|
||||||
|
adafruitfeather.menu.dbgport.Serial=Serial
|
||||||
|
adafruitfeather.menu.dbgport.Serial.build.debug_port=-DDEBUG_RP2040_PORT=Serial
|
||||||
|
adafruitfeather.menu.dbgport.Serial1=Serial1
|
||||||
|
adafruitfeather.menu.dbgport.Serial1.build.debug_port=-DDEBUG_RP2040_PORT=Serial1
|
||||||
|
adafruitfeather.menu.dbgport.Serial2=Serial2
|
||||||
|
adafruitfeather.menu.dbgport.Serial2.build.debug_port=-DDEBUG_RP2040_PORT=Serial2
|
||||||
|
adafruitfeather.menu.dbglvl.None=None
|
||||||
|
adafruitfeather.menu.dbglvl.None.build.debug_level=
|
||||||
|
adafruitfeather.menu.dbglvl.Core=Core
|
||||||
|
adafruitfeather.menu.dbglvl.Core.build.debug_level=-DDEBUG_RP2040_CORE
|
||||||
|
adafruitfeather.menu.dbglvl.SPI=SPI
|
||||||
|
adafruitfeather.menu.dbglvl.SPI.build.debug_level=-DDEBUG_RP2040_SPI
|
||||||
|
adafruitfeather.menu.dbglvl.Wire=Wire
|
||||||
|
adafruitfeather.menu.dbglvl.Wire.build.debug_level=DDEBUG_RP2040_WIRE
|
||||||
|
adafruitfeather.menu.dbglvl.All=All
|
||||||
|
adafruitfeather.menu.dbglvl.All.build.debug_level=-DDEBUG_RP2040_WIRE -DDEBUG_RP2040_SPI -DDEBUG_RP2040_CORE
|
||||||
|
adafruitfeather.menu.dbglvl.NDEBUG=NDEBUG
|
||||||
|
adafruitfeather.menu.dbglvl.NDEBUG.build.debug_level=-DNDEBUG
|
||||||
|
generic.name=Generic RP2040
|
||||||
|
generic.vid.0=0x2e8a
|
||||||
|
generic.pid.0=0xf00a
|
||||||
|
generic.build.usbpid=-DSERIALUSB_PID=0xf00a
|
||||||
|
generic.build.board=GENERIC_RP2040
|
||||||
|
generic.build.mcu=cortex-m0plus
|
||||||
|
generic.build.variant=generif
|
||||||
|
generic.upload.tool=uf2conv
|
||||||
|
generic.upload.maximum_size=2097152
|
||||||
|
generic.upload.maximum_data_size=262144
|
||||||
|
generic.upload.wait_for_upload_port=true
|
||||||
|
generic.upload.erase_cmd=
|
||||||
|
generic.serial.disableDTR=false
|
||||||
|
generic.serial.disableRTS=false
|
||||||
|
generic.build.f_cpu=125000000
|
||||||
|
generic.build.led=
|
||||||
|
generic.build.core=rp2040
|
||||||
|
generic.build.mcu=rp2040
|
||||||
|
generic.build.ldscript=memmap_default.ld
|
||||||
|
generic.menu.flash.2097152_0=2MB (no FS)
|
||||||
|
generic.menu.flash.2097152_0.upload.maximum_size=2093056
|
||||||
|
generic.menu.flash.2097152_0.build.flash_length=2093056
|
||||||
|
generic.menu.flash.2097152_0.build.eeprom_start=2093056
|
||||||
|
generic.menu.flash.2097152_0.build.fs_start=2093056
|
||||||
|
generic.menu.flash.2097152_0.build.fs_end=2093056
|
||||||
|
generic.menu.flash.2097152_65536=2MB (FS: 64KB)
|
||||||
|
generic.menu.flash.2097152_65536.upload.maximum_size=2027520
|
||||||
|
generic.menu.flash.2097152_65536.build.flash_length=2027520
|
||||||
|
generic.menu.flash.2097152_65536.build.eeprom_start=2093056
|
||||||
|
generic.menu.flash.2097152_65536.build.fs_start=2027520
|
||||||
|
generic.menu.flash.2097152_65536.build.fs_end=2093056
|
||||||
|
generic.menu.flash.2097152_262144=2MB (FS: 256KB)
|
||||||
|
generic.menu.flash.2097152_262144.upload.maximum_size=1830912
|
||||||
|
generic.menu.flash.2097152_262144.build.flash_length=1830912
|
||||||
|
generic.menu.flash.2097152_262144.build.eeprom_start=2093056
|
||||||
|
generic.menu.flash.2097152_262144.build.fs_start=1830912
|
||||||
|
generic.menu.flash.2097152_262144.build.fs_end=2093056
|
||||||
|
generic.menu.flash.2097152_524288=2MB (FS: 512KB)
|
||||||
|
generic.menu.flash.2097152_524288.upload.maximum_size=1568768
|
||||||
|
generic.menu.flash.2097152_524288.build.flash_length=1568768
|
||||||
|
generic.menu.flash.2097152_524288.build.eeprom_start=2093056
|
||||||
|
generic.menu.flash.2097152_524288.build.fs_start=1568768
|
||||||
|
generic.menu.flash.2097152_524288.build.fs_end=2093056
|
||||||
|
generic.menu.flash.2097152_1048576=2MB (FS: 1MB)
|
||||||
|
generic.menu.flash.2097152_1048576.upload.maximum_size=1044480
|
||||||
|
generic.menu.flash.2097152_1048576.build.flash_length=1044480
|
||||||
|
generic.menu.flash.2097152_1048576.build.eeprom_start=2093056
|
||||||
|
generic.menu.flash.2097152_1048576.build.fs_start=1044480
|
||||||
|
generic.menu.flash.2097152_1048576.build.fs_end=2093056
|
||||||
|
generic.menu.freq.125=125 MHz
|
||||||
|
generic.menu.freq.125.build.f_cpu=125000000L
|
||||||
|
generic.menu.freq.50=50 MHz
|
||||||
|
generic.menu.freq.50.build.f_cpu=50000000L
|
||||||
|
generic.menu.freq.100=100 MHz
|
||||||
|
generic.menu.freq.100.build.f_cpu=100000000L
|
||||||
|
generic.menu.freq.133=133 MHz
|
||||||
|
generic.menu.freq.133.build.f_cpu=133000000L
|
||||||
|
generic.menu.freq.150=150 MHz (Overclock)
|
||||||
|
generic.menu.freq.150.build.f_cpu=150000000L
|
||||||
|
generic.menu.freq.175=175 MHz (Overclock)
|
||||||
|
generic.menu.freq.175.build.f_cpu=175000000L
|
||||||
|
generic.menu.freq.200=200 MHz (Overclock)
|
||||||
|
generic.menu.freq.200.build.f_cpu=200000000L
|
||||||
|
generic.menu.freq.225=225 MHz (Overclock)
|
||||||
|
generic.menu.freq.225.build.f_cpu=225000000L
|
||||||
|
generic.menu.freq.250=250 MHz (Overclock)
|
||||||
|
generic.menu.freq.250.build.f_cpu=250000000L
|
||||||
|
generic.menu.freq.275=275 MHz (Overclock)
|
||||||
|
generic.menu.freq.275.build.f_cpu=275000000L
|
||||||
|
generic.menu.freq.300=300 MHz (Overclock)
|
||||||
|
generic.menu.freq.300.build.f_cpu=300000000L
|
||||||
|
generic.menu.dbgport.Disabled=Disabled
|
||||||
|
generic.menu.dbgport.Disabled.build.debug_port=
|
||||||
|
generic.menu.dbgport.Serial=Serial
|
||||||
|
generic.menu.dbgport.Serial.build.debug_port=-DDEBUG_RP2040_PORT=Serial
|
||||||
|
generic.menu.dbgport.Serial1=Serial1
|
||||||
|
generic.menu.dbgport.Serial1.build.debug_port=-DDEBUG_RP2040_PORT=Serial1
|
||||||
|
generic.menu.dbgport.Serial2=Serial2
|
||||||
|
generic.menu.dbgport.Serial2.build.debug_port=-DDEBUG_RP2040_PORT=Serial2
|
||||||
|
generic.menu.dbglvl.None=None
|
||||||
|
generic.menu.dbglvl.None.build.debug_level=
|
||||||
|
generic.menu.dbglvl.Core=Core
|
||||||
|
generic.menu.dbglvl.Core.build.debug_level=-DDEBUG_RP2040_CORE
|
||||||
|
generic.menu.dbglvl.SPI=SPI
|
||||||
|
generic.menu.dbglvl.SPI.build.debug_level=-DDEBUG_RP2040_SPI
|
||||||
|
generic.menu.dbglvl.Wire=Wire
|
||||||
|
generic.menu.dbglvl.Wire.build.debug_level=DDEBUG_RP2040_WIRE
|
||||||
|
generic.menu.dbglvl.All=All
|
||||||
|
generic.menu.dbglvl.All.build.debug_level=-DDEBUG_RP2040_WIRE -DDEBUG_RP2040_SPI -DDEBUG_RP2040_CORE
|
||||||
|
generic.menu.dbglvl.NDEBUG=NDEBUG
|
||||||
|
generic.menu.dbglvl.NDEBUG.build.debug_level=-DNDEBUG
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,12 @@ extern void serialEvent() __attribute__((weak));
|
||||||
#define PICO_STDIO_USB_LOW_PRIORITY_IRQ 31
|
#define PICO_STDIO_USB_LOW_PRIORITY_IRQ 31
|
||||||
|
|
||||||
#define USBD_VID (0x2E8A) // Raspberry Pi
|
#define USBD_VID (0x2E8A) // Raspberry Pi
|
||||||
#define USBD_PID (0x000a) // Raspberry Pi Pico SDK CDC
|
|
||||||
|
#ifdef SERIALUSB_PID
|
||||||
|
#define USBD_PID (SERIALUSB_PID)
|
||||||
|
#else
|
||||||
|
#define USBD_PID (0x000a) // Raspberry Pi Pico SDK CDC
|
||||||
|
#endif
|
||||||
|
|
||||||
#define USBD_DESC_LEN (TUD_CONFIG_DESC_LEN + TUD_CDC_DESC_LEN)
|
#define USBD_DESC_LEN (TUD_CONFIG_DESC_LEN + TUD_CDC_DESC_LEN)
|
||||||
#define USBD_MAX_POWER_MA (250)
|
#define USBD_MAX_POWER_MA (250)
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
#include <pico/stdlib.h>
|
||||||
|
|
||||||
extern void setup();
|
extern void setup();
|
||||||
extern void loop();
|
extern void loop();
|
||||||
|
|
||||||
extern "C" int main() {
|
extern "C" int main() {
|
||||||
|
#if F_CPU != 125000000
|
||||||
|
set_sys_clock_khz(F_CPU / 1000, true);
|
||||||
|
#endif
|
||||||
#if defined DEBUG_RP2040_PORT
|
#if defined DEBUG_RP2040_PORT
|
||||||
DEBUG_RP2040_PORT.begin();
|
DEBUG_RP2040_PORT.begin();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,14 @@
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 2044k /* 2048 - 4K for EEPROM */
|
FLASH(rx) : ORIGIN = 0x10000000, LENGTH = __FLASH_LENGTH__
|
||||||
RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 256k
|
RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 256k
|
||||||
SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
|
SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
|
||||||
SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k
|
SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k
|
||||||
}
|
}
|
||||||
PROVIDE ( _EEPROM_start = 0x101FF000 );
|
PROVIDE ( _EEPROM_start = __EEPROM_START__ );
|
||||||
|
PROVIDE ( _FS_start = __FS_START__ );
|
||||||
|
PROVIDE ( _FS_end = __FS_END__ );
|
||||||
|
|
||||||
ENTRY(_entry_point)
|
ENTRY(_entry_point)
|
||||||
|
|
||||||
23
platform.txt
23
platform.txt
|
|
@ -76,29 +76,29 @@ compiler.S.extra_flags=
|
||||||
compiler.ar.extra_flags=
|
compiler.ar.extra_flags=
|
||||||
compiler.elf2hex.extra_flags=
|
compiler.elf2hex.extra_flags=
|
||||||
|
|
||||||
|
# Board configuration, set in boards.txt. Present here to ensure substitution works
|
||||||
|
build.flash_length=
|
||||||
|
build.eeprom_start=
|
||||||
|
build.fs_start=
|
||||||
|
build.fs_end=
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Allow Pico boards do be auto-discovered by the IDE
|
# Allow Pico boards do be auto-discovered by the IDE
|
||||||
discovery.rp2040.pattern="{runtime.tools.pqt-python3.path}/python3" "{runtime.platform.path}/tools/discovery.py"
|
discovery.rp2040.pattern="{runtime.tools.pqt-python3.path}/python3" "{runtime.platform.path}/tools/discovery.py"
|
||||||
|
|
||||||
# USB Flags
|
|
||||||
# ---------
|
|
||||||
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} -DUSBCON '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
|
|
||||||
|
|
||||||
# Default usb manufacturer will be replaced at compile time using
|
|
||||||
# numeric vendor ID if available or by board's specific value.
|
|
||||||
build.usb_manufacturer="Unknown"
|
|
||||||
|
|
||||||
# Compile patterns
|
# Compile patterns
|
||||||
# ----------------
|
# ----------------
|
||||||
|
|
||||||
## Compile c files
|
## Compile c files
|
||||||
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {build.debug_port} {build.debug_level} {includes} "{source_file}" -o "{object_file}"
|
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} {build.usbpid} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {build.debug_port} {build.debug_level} {includes} "{source_file}" -o "{object_file}"
|
||||||
|
|
||||||
## Compile c++ files
|
## Compile c++ files
|
||||||
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {build.debug_port} {build.debug_level} {includes} "{source_file}" -o "{object_file}"
|
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {build.usbpid} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {build.debug_port} {build.debug_level} {includes} "{source_file}" -o "{object_file}"
|
||||||
|
|
||||||
## Compile S files
|
## Compile S files
|
||||||
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.debug_port} {build.debug_level} {includes} "{source_file}" -o "{object_file}"
|
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} {build.usbpid} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.debug_port} {build.debug_level} {includes} "{source_file}" -o "{object_file}"
|
||||||
|
|
||||||
## Create archives
|
## Create archives
|
||||||
# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value
|
# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value
|
||||||
|
|
@ -106,7 +106,8 @@ archive_file_path={build.path}/{archive_file}
|
||||||
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
|
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
|
||||||
|
|
||||||
## Combine gc-sections, archives, and objects
|
## Combine gc-sections, archives, and objects
|
||||||
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-Wl,--script={build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nosys.specs -Wl,--start-group {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "{runtime.platform.path}/lib/libpico.a" -lm "-I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/" "-I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include" "{runtime.platform.path}/assembly/bs2_default_padded_checksummed.S" -lc -lstdc++ -Wl,--end-group
|
recipe.hooks.linking.prelink.1.pattern="{runtime.tools.pqt-python3.path}/python3" "{runtime.platform.path}/tools/simplesub.py" --input "{runtime.platform.path}/lib/memmap_default.ld" --out "{build.path}/memmap_default.ld" --sub __FLASH_LENGTH__ {build.flash_length} --sub __EEPROM_START__ {build.eeprom_start} --sub __FS_START__ {build.fs_start} --sub __FS_END__ {build.fs_end}
|
||||||
|
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-Wl,--script={build.path}/memmap_default.ld" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nosys.specs -Wl,--start-group {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "{runtime.platform.path}/lib/libpico.a" -lm "-I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/" "-I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include" "{runtime.platform.path}/assembly/bs2_default_padded_checksummed.S" -lc -lstdc++ -Wl,--end-group
|
||||||
|
|
||||||
## Create output (UF2 file)
|
## Create output (UF2 file)
|
||||||
recipe.objcopy.uf2.pattern="{runtime.tools.pqt-elf2uf2.path}/elf2uf2" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.uf2"
|
recipe.objcopy.uf2.pattern="{runtime.tools.pqt-elf2uf2.path}/elf2uf2" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.uf2"
|
||||||
|
|
|
||||||
85
tools/makeboards.py
Executable file
85
tools/makeboards.py
Executable file
|
|
@ -0,0 +1,85 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
def BuildFlashMenu(name, flashsize, fssizelist):
|
||||||
|
for fssize in fssizelist:
|
||||||
|
if fssize == 0:
|
||||||
|
fssizename = "no FS"
|
||||||
|
elif fssize < 1024 * 1024:
|
||||||
|
fssizename = "FS: %dKB" % (fssize / 1024)
|
||||||
|
else:
|
||||||
|
fssizename = "FS: %dMB" % (fssize / (1024 * 1024))
|
||||||
|
mn="%d_%d" % (flashsize, fssize)
|
||||||
|
print("%s.menu.flash.%s=%dMB (%s)" % (name, mn, flashsize / (1024 * 1024), fssizename))
|
||||||
|
print("%s.menu.flash.%s.upload.maximum_size=%d" % (name, mn, flashsize - 4096 - fssize))
|
||||||
|
print("%s.menu.flash.%s.build.flash_length=%d" % (name, mn, flashsize - 4096 - fssize))
|
||||||
|
print("%s.menu.flash.%s.build.eeprom_start=%d" % (name, mn, flashsize - 4096))
|
||||||
|
print("%s.menu.flash.%s.build.fs_start=%d" % (name, mn, flashsize - 4096 - fssize))
|
||||||
|
print("%s.menu.flash.%s.build.fs_end=%d" % (name, mn, flashsize - 4096))
|
||||||
|
|
||||||
|
def BuildDebugPort(name):
|
||||||
|
print("%s.menu.dbgport.Disabled=Disabled" % (name))
|
||||||
|
print("%s.menu.dbgport.Disabled.build.debug_port=" % (name))
|
||||||
|
for p in ["Serial", "Serial1", "Serial2"]:
|
||||||
|
print("%s.menu.dbgport.%s=%s" % (name, p, p))
|
||||||
|
print("%s.menu.dbgport.%s.build.debug_port=-DDEBUG_RP2040_PORT=%s" % (name, p, p))
|
||||||
|
|
||||||
|
def BuildDebugLevel(name):
|
||||||
|
for l in [ ("None", ""), ("Core", "-DDEBUG_RP2040_CORE"), ("SPI", "-DDEBUG_RP2040_SPI"), ("Wire", "DDEBUG_RP2040_WIRE"),
|
||||||
|
("All", "-DDEBUG_RP2040_WIRE -DDEBUG_RP2040_SPI -DDEBUG_RP2040_CORE"), ("NDEBUG", "-DNDEBUG") ]:
|
||||||
|
print("%s.menu.dbglvl.%s=%s" % (name, l[0], l[0]))
|
||||||
|
print("%s.menu.dbglvl.%s.build.debug_level=%s" % (name, l[0], l[1]))
|
||||||
|
|
||||||
|
def BuildFreq(name):
|
||||||
|
for f in [ 125, 50, 100, 133, 150, 175, 200, 225, 250, 275, 300]:
|
||||||
|
warn = ""
|
||||||
|
if f > 133: warn = " (Overclock)"
|
||||||
|
print("%s.menu.freq.%s=%s MHz%s" % (name, f, f, warn))
|
||||||
|
print("%s.menu.freq.%s.build.f_cpu=%dL" % (name, f, f * 1000000))
|
||||||
|
|
||||||
|
def BuildHeader(name, prettyname, pid, boarddefine, variant, uploadtool, flashsize):
|
||||||
|
print("%s.name=%s" % (name, prettyname))
|
||||||
|
print("%s.vid.0=0x2e8a" % (name))
|
||||||
|
print("%s.pid.0=%s" % (name, pid))
|
||||||
|
print("%s.build.usbpid=-DSERIALUSB_PID=%s" % (name, pid))
|
||||||
|
print("%s.build.board=%s" % (name, boarddefine))
|
||||||
|
print("%s.build.mcu=cortex-m0plus" % (name))
|
||||||
|
print("%s.build.variant=%s" % (name, variant))
|
||||||
|
print("%s.upload.tool=%s" % (name, uploadtool))
|
||||||
|
print("%s.upload.maximum_size=%d" % (name, flashsize))
|
||||||
|
print("%s.upload.maximum_data_size=262144" % (name))
|
||||||
|
print("%s.upload.wait_for_upload_port=true" % (name))
|
||||||
|
print("%s.upload.erase_cmd=" % (name))
|
||||||
|
print("%s.serial.disableDTR=false" % (name))
|
||||||
|
print("%s.serial.disableRTS=false" % (name))
|
||||||
|
print("%s.build.f_cpu=125000000" % (name))
|
||||||
|
print("%s.build.led=" % (name))
|
||||||
|
print("%s.build.core=rp2040" % (name))
|
||||||
|
print("%s.build.mcu=rp2040" % (name))
|
||||||
|
print("%s.build.ldscript=memmap_default.ld" % (name))
|
||||||
|
|
||||||
|
def BuildGlobalMenuList():
|
||||||
|
print("menu.BoardModel=Model")
|
||||||
|
print("menu.flash=Flash Size")
|
||||||
|
print("menu.freq=CPU Speed")
|
||||||
|
print("menu.dbgport=Debug Port")
|
||||||
|
print("menu.dbglvl=Debug Level")
|
||||||
|
|
||||||
|
BuildGlobalMenuList()
|
||||||
|
|
||||||
|
BuildHeader("rpipico", "Raspberry Pi Pico", "0x000a", "RASPBERRY_PI_PICO", "rpipico", "uf2conv", 2 * 1024*1024)
|
||||||
|
BuildFlashMenu("rpipico", 2 * 1024 * 1024, [ 0, 64 * 1024, 256 * 1024, 512 * 1024, 1024 * 1024 ])
|
||||||
|
BuildFreq("rpipico")
|
||||||
|
BuildDebugPort("rpipico")
|
||||||
|
BuildDebugLevel("rpipico")
|
||||||
|
|
||||||
|
BuildHeader("adafruitfeather", "Adafruit Feather RP2040", "0x000b", "ADAFRUIT_FEATHER_RP2040", "adafruitfeather", "uf2conv", 8 *1024*1024)
|
||||||
|
BuildFlashMenu("adafruitfeather", 8 * 1024 * 1024, [ 0, 64 * 1024, 256 * 1024, 512 * 1024, 1024 * 1024, 2 * 1024 * 1024, 3 * 1024 * 1024, 4 * 1024 *1024, 5 * 1024 *1024, 6 * 1024*1024, 7*1024*1024 ])
|
||||||
|
BuildFreq("adafruitfeather")
|
||||||
|
BuildDebugPort("adafruitfeather")
|
||||||
|
BuildDebugLevel("adafruitfeather")
|
||||||
|
|
||||||
|
BuildHeader("generic", "Generic RP2040", "0xf00a", "GENERIC_RP2040", "generif", "uf2conv", 2 * 1024*1024)
|
||||||
|
BuildFlashMenu("generic", 2 * 1024 * 1024, [ 0, 64 * 1024, 256 * 1024, 512 * 1024, 1024 * 1024 ])
|
||||||
|
BuildFreq("generic")
|
||||||
|
BuildDebugPort("generic")
|
||||||
|
BuildDebugLevel("generic")
|
||||||
28
tools/simplesub.py
Executable file
28
tools/simplesub.py
Executable file
|
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import sys
|
||||||
|
import struct
|
||||||
|
import subprocess
|
||||||
|
import re
|
||||||
|
import os
|
||||||
|
import os.path
|
||||||
|
import argparse
|
||||||
|
import time
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description='Simple text substitution')
|
||||||
|
parser.add_argument('-i', '--input', action='store', required=True, help='Path to the source file')
|
||||||
|
parser.add_argument('-o', '--out', action='store', required=True, help='Path to the output file')
|
||||||
|
parser.add_argument('-s', '--sub', action='append', nargs=2, metavar=('find', 'replace'), required=True, help='Substition')
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
with open(args.input, "r") as fin:
|
||||||
|
data = fin.read()
|
||||||
|
|
||||||
|
for f, r in args.sub:
|
||||||
|
data = re.sub(f, r, data)
|
||||||
|
|
||||||
|
with open(args.out, "w") as fout:
|
||||||
|
fout.write(data)
|
||||||
|
|
||||||
|
|
||||||
|
main()
|
||||||
8
variants/adafruitfeather/pins_arduino.h
Normal file
8
variants/adafruitfeather/pins_arduino.h
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
#ifndef __rpipico_pins_arduino_h__
|
||||||
|
#define __rpipico_pins_arduino_h__
|
||||||
|
|
||||||
|
#define LED_BUILTIN 13
|
||||||
|
|
||||||
|
#include "../generic/common.h"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -1,252 +0,0 @@
|
||||||
/* Based on GCC ARM embedded samples.
|
|
||||||
Defines the following symbols for use by code:
|
|
||||||
__exidx_start
|
|
||||||
__exidx_end
|
|
||||||
__etext
|
|
||||||
__data_start__
|
|
||||||
__preinit_array_start
|
|
||||||
__preinit_array_end
|
|
||||||
__init_array_start
|
|
||||||
__init_array_end
|
|
||||||
__fini_array_start
|
|
||||||
__fini_array_end
|
|
||||||
__data_end__
|
|
||||||
__bss_start__
|
|
||||||
__bss_end__
|
|
||||||
__end__
|
|
||||||
end
|
|
||||||
__HeapLimit
|
|
||||||
__StackLimit
|
|
||||||
__StackTop
|
|
||||||
__stack (== StackTop)
|
|
||||||
*/
|
|
||||||
|
|
||||||
MEMORY
|
|
||||||
{
|
|
||||||
FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 2044k /* 2048 - 4K for EEPROM */
|
|
||||||
RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 256k
|
|
||||||
SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
|
|
||||||
SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k
|
|
||||||
}
|
|
||||||
PROVIDE ( _EEPROM_start = 0x101FF000 );
|
|
||||||
|
|
||||||
ENTRY(_entry_point)
|
|
||||||
|
|
||||||
SECTIONS
|
|
||||||
{
|
|
||||||
/* Second stage bootloader is prepended to the image. It must be 256 bytes big
|
|
||||||
and checksummed. It is usually built by the boot_stage2 target
|
|
||||||
in the Pico SDK
|
|
||||||
*/
|
|
||||||
|
|
||||||
.flash_begin : {
|
|
||||||
__flash_binary_start = .;
|
|
||||||
} > FLASH
|
|
||||||
|
|
||||||
.boot2 : {
|
|
||||||
__boot2_start__ = .;
|
|
||||||
KEEP (*(.boot2))
|
|
||||||
__boot2_end__ = .;
|
|
||||||
} > FLASH
|
|
||||||
|
|
||||||
ASSERT(__boot2_end__ - __boot2_start__ == 256,
|
|
||||||
"ERROR: Pico second stage bootloader must be 256 bytes in size")
|
|
||||||
|
|
||||||
/* The second stage will always enter the image at the start of .text.
|
|
||||||
The debugger will use the ELF entry point, which is the _entry_point
|
|
||||||
symbol if present, otherwise defaults to start of .text.
|
|
||||||
This can be used to transfer control back to the bootrom on debugger
|
|
||||||
launches only, to perform proper flash setup.
|
|
||||||
*/
|
|
||||||
|
|
||||||
.text : {
|
|
||||||
__reset_start = .;
|
|
||||||
KEEP (*(.reset))
|
|
||||||
. = ALIGN(256);
|
|
||||||
__reset_end = .;
|
|
||||||
ASSERT(__reset_end - __reset_start == 256, "ERROR: reset section should only be 256 bytes");
|
|
||||||
KEEP (*(.vectors))
|
|
||||||
/* TODO revisit this now memset/memcpy/float in ROM */
|
|
||||||
/* bit of a hack right now to exclude all floating point and time critical (e.g. memset, memcpy) code from
|
|
||||||
* FLASH ... we will include any thing excluded here in .data below by default */
|
|
||||||
*(.init)
|
|
||||||
*(EXCLUDE_FILE(*libgcc.a: *libc.a:*lib_a-mem*.o *libm.a:) .text*)
|
|
||||||
*(.fini)
|
|
||||||
/* Pull all c'tors into .text */
|
|
||||||
*crtbegin.o(.ctors)
|
|
||||||
*crtbegin?.o(.ctors)
|
|
||||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
|
||||||
*(SORT(.ctors.*))
|
|
||||||
*(.ctors)
|
|
||||||
/* Followed by destructors */
|
|
||||||
*crtbegin.o(.dtors)
|
|
||||||
*crtbegin?.o(.dtors)
|
|
||||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
|
||||||
*(SORT(.dtors.*))
|
|
||||||
*(.dtors)
|
|
||||||
|
|
||||||
*(.eh_frame*)
|
|
||||||
. = ALIGN(4);
|
|
||||||
} > FLASH
|
|
||||||
|
|
||||||
.rodata : {
|
|
||||||
*(EXCLUDE_FILE(*libgcc.a: *libc.a:*lib_a-mem*.o *libm.a:) .rodata*)
|
|
||||||
. = ALIGN(4);
|
|
||||||
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.flashdata*)))
|
|
||||||
. = ALIGN(4);
|
|
||||||
} > FLASH
|
|
||||||
|
|
||||||
.ARM.extab :
|
|
||||||
{
|
|
||||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
|
||||||
} > FLASH
|
|
||||||
|
|
||||||
__exidx_start = .;
|
|
||||||
.ARM.exidx :
|
|
||||||
{
|
|
||||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
|
||||||
} > FLASH
|
|
||||||
__exidx_end = .;
|
|
||||||
|
|
||||||
/* Machine inspectable binary information */
|
|
||||||
. = ALIGN(4);
|
|
||||||
__binary_info_start = .;
|
|
||||||
.binary_info :
|
|
||||||
{
|
|
||||||
KEEP(*(.binary_info.keep.*))
|
|
||||||
*(.binary_info.*)
|
|
||||||
} > FLASH
|
|
||||||
__binary_info_end = .;
|
|
||||||
. = ALIGN(4);
|
|
||||||
|
|
||||||
/* End of .text-like segments */
|
|
||||||
__etext = .;
|
|
||||||
|
|
||||||
.ram_vector_table (COPY): {
|
|
||||||
*(.ram_vector_table)
|
|
||||||
} > RAM
|
|
||||||
|
|
||||||
.data : {
|
|
||||||
__data_start__ = .;
|
|
||||||
*(vtable)
|
|
||||||
|
|
||||||
*(.time_critical*)
|
|
||||||
|
|
||||||
/* remaining .text and .rodata; i.e. stuff we exclude above because we want it in RAM */
|
|
||||||
*(.text*)
|
|
||||||
. = ALIGN(4);
|
|
||||||
*(.rodata*)
|
|
||||||
. = ALIGN(4);
|
|
||||||
|
|
||||||
*(.data*)
|
|
||||||
|
|
||||||
. = ALIGN(4);
|
|
||||||
*(.after_data.*)
|
|
||||||
. = ALIGN(4);
|
|
||||||
/* preinit data */
|
|
||||||
PROVIDE_HIDDEN (__mutex_array_start = .);
|
|
||||||
KEEP(*(SORT(.mutex_array.*)))
|
|
||||||
KEEP(*(.mutex_array))
|
|
||||||
PROVIDE_HIDDEN (__mutex_array_end = .);
|
|
||||||
|
|
||||||
. = ALIGN(4);
|
|
||||||
/* preinit data */
|
|
||||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
|
||||||
KEEP(*(SORT(.preinit_array.*)))
|
|
||||||
KEEP(*(.preinit_array))
|
|
||||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
|
||||||
|
|
||||||
. = ALIGN(4);
|
|
||||||
/* init data */
|
|
||||||
PROVIDE_HIDDEN (__init_array_start = .);
|
|
||||||
KEEP(*(SORT(.init_array.*)))
|
|
||||||
KEEP(*(.init_array))
|
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
|
||||||
|
|
||||||
. = ALIGN(4);
|
|
||||||
/* finit data */
|
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
|
||||||
*(SORT(.fini_array.*))
|
|
||||||
*(.fini_array)
|
|
||||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
|
||||||
|
|
||||||
*(.jcr)
|
|
||||||
. = ALIGN(4);
|
|
||||||
/* All data end */
|
|
||||||
__data_end__ = .;
|
|
||||||
} > RAM AT> FLASH
|
|
||||||
|
|
||||||
.uninitialized_data (COPY): {
|
|
||||||
. = ALIGN(4);
|
|
||||||
*(.uninitialized_data*)
|
|
||||||
} > RAM
|
|
||||||
|
|
||||||
/* Start and end symbols must be word-aligned */
|
|
||||||
.scratch_x : {
|
|
||||||
__scratch_x_start__ = .;
|
|
||||||
*(.scratch_x.*)
|
|
||||||
. = ALIGN(4);
|
|
||||||
__scratch_x_end__ = .;
|
|
||||||
} > SCRATCH_X AT > FLASH
|
|
||||||
__scratch_x_source__ = LOADADDR(.scratch_x);
|
|
||||||
|
|
||||||
.scratch_y : {
|
|
||||||
__scratch_y_start__ = .;
|
|
||||||
*(.scratch_y.*)
|
|
||||||
. = ALIGN(4);
|
|
||||||
__scratch_y_end__ = .;
|
|
||||||
} > SCRATCH_Y AT > FLASH
|
|
||||||
__scratch_y_source__ = LOADADDR(.scratch_y);
|
|
||||||
|
|
||||||
.bss : {
|
|
||||||
. = ALIGN(4);
|
|
||||||
__bss_start__ = .;
|
|
||||||
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.bss*)))
|
|
||||||
*(COMMON)
|
|
||||||
. = ALIGN(4);
|
|
||||||
__bss_end__ = .;
|
|
||||||
} > RAM
|
|
||||||
|
|
||||||
.heap (COPY):
|
|
||||||
{
|
|
||||||
__end__ = .;
|
|
||||||
end = __end__;
|
|
||||||
*(.heap*)
|
|
||||||
__HeapLimit = .;
|
|
||||||
} > RAM
|
|
||||||
|
|
||||||
/* .stack*_dummy section doesn't contains any symbols. It is only
|
|
||||||
* used for linker to calculate size of stack sections, and assign
|
|
||||||
* values to stack symbols later
|
|
||||||
*
|
|
||||||
* stack1 section may be empty/missing if platform_launch_core1 is not used */
|
|
||||||
|
|
||||||
/* by default we put core 0 stack at the end of scratch Y, so that if core 1
|
|
||||||
* stack is not used then all of SCRATCH_X is free.
|
|
||||||
*/
|
|
||||||
.stack1_dummy (COPY):
|
|
||||||
{
|
|
||||||
*(.stack1*)
|
|
||||||
} > SCRATCH_X
|
|
||||||
.stack_dummy (COPY):
|
|
||||||
{
|
|
||||||
*(.stack*)
|
|
||||||
} > SCRATCH_Y
|
|
||||||
|
|
||||||
.flash_end : {
|
|
||||||
__flash_binary_end = .;
|
|
||||||
} > FLASH
|
|
||||||
|
|
||||||
/* stack limit is poorly named, but historically is maximum heap ptr */
|
|
||||||
__StackLimit = ORIGIN(RAM) + LENGTH(RAM);
|
|
||||||
__StackOneTop = ORIGIN(SCRATCH_X) + LENGTH(SCRATCH_X);
|
|
||||||
__StackTop = ORIGIN(SCRATCH_Y) + LENGTH(SCRATCH_Y);
|
|
||||||
__StackOneBottom = __StackOneTop - SIZEOF(.stack1_dummy);
|
|
||||||
__StackBottom = __StackTop - SIZEOF(.stack_dummy);
|
|
||||||
PROVIDE(__stack = __StackTop);
|
|
||||||
|
|
||||||
/* Check if data + heap + stack exceeds RAM limit */
|
|
||||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed")
|
|
||||||
/* todo assert on extra code */
|
|
||||||
}
|
|
||||||
|
|
||||||
Loading…
Reference in a new issue