Skip to content

Commit

Permalink
flash_usb: Initial support for flashing rp2350 chips
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin O'Connor <[email protected]>
  • Loading branch information
KevinOConnor committed Oct 27, 2024
1 parent a7ffd82 commit 9827645
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/flash_usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def flash_stm32f4(options, binfile):
If the device is already in bootloader mode it can be flashed with the
following command:
make flash FLASH_DEVICE=2e8a:0003
make flash FLASH_DEVICE=%s
Alternatively, one can flash rp2040 boards like the Pico by manually
entering bootloader mode(hold bootsel button during powerup), mount the
Expand All @@ -330,13 +330,16 @@ def flash_stm32f4(options, binfile):
"""

def flash_rp2040(options, binfile):
rawdev = "2e8a:0003"
if options.mcutype == 'rp2350':
rawdev = "2e8a:000f"
try:
if options.device.lower() == "2e8a:0003":
if options.device.lower() == rawdev:
call_picoboot(None, None, binfile, options.sudo)
else:
flash_picoboot(options.device, binfile, options.sudo)
except error as e:
sys.stderr.write(RP2040_HELP % (options.device, str(e)))
sys.stderr.write(RP2040_HELP % (options.device, str(e), rawdev))
sys.exit(-1)

MCUTYPES = {
Expand All @@ -347,7 +350,7 @@ def flash_rp2040(options, binfile):
'stm32f070': flash_stm32f4, 'stm32f072': flash_stm32f4,
'stm32g0b1': flash_stm32f4, 'stm32f7': flash_stm32f4,
'stm32h7': flash_stm32f4, 'stm32l4': flash_stm32f4,
'stm32g4': flash_stm32f4, 'rp2040': flash_rp2040,
'stm32g4': flash_stm32f4, 'rp2': flash_rp2040,
}


Expand Down

0 comments on commit 9827645

Please sign in to comment.