mirror of
				https://github.com/Klipper3d/klipper.git
				synced 2025-10-31 10:25:57 +01:00 
			
		
		
		
	flash_usb: Initial support for flashing rp2350 chips
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
		| @@ -321,7 +321,7 @@ Failed to flash to %s: %s | |||||||
|  |  | ||||||
| If the device is already in bootloader mode it can be flashed with the | If the device is already in bootloader mode it can be flashed with the | ||||||
| following command: | following command: | ||||||
|   make flash FLASH_DEVICE=2e8a:0003 |   make flash FLASH_DEVICE=%s | ||||||
|  |  | ||||||
| Alternatively, one can flash rp2040 boards like the Pico by manually | Alternatively, one can flash rp2040 boards like the Pico by manually | ||||||
| entering bootloader mode(hold bootsel button during powerup), mount the | entering bootloader mode(hold bootsel button during powerup), mount the | ||||||
| @@ -330,13 +330,16 @@ device as a usb drive, and copy klipper.uf2 to the device. | |||||||
| """ | """ | ||||||
|  |  | ||||||
| def flash_rp2040(options, binfile): | def flash_rp2040(options, binfile): | ||||||
|  |     rawdev = "2e8a:0003" | ||||||
|  |     if options.mcutype == 'rp2350': | ||||||
|  |         rawdev = "2e8a:000f" | ||||||
|     try: |     try: | ||||||
|         if options.device.lower() == "2e8a:0003": |         if options.device.lower() == rawdev: | ||||||
|             call_picoboot(None, None, binfile, options.sudo) |             call_picoboot(None, None, binfile, options.sudo) | ||||||
|         else: |         else: | ||||||
|             flash_picoboot(options.device, binfile, options.sudo) |             flash_picoboot(options.device, binfile, options.sudo) | ||||||
|     except error as e: |     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) |         sys.exit(-1) | ||||||
|  |  | ||||||
| MCUTYPES = { | MCUTYPES = { | ||||||
| @@ -347,7 +350,7 @@ MCUTYPES = { | |||||||
|     'stm32f070': flash_stm32f4, 'stm32f072': flash_stm32f4, |     'stm32f070': flash_stm32f4, 'stm32f072': flash_stm32f4, | ||||||
|     'stm32g0b1': flash_stm32f4, 'stm32f7': flash_stm32f4, |     'stm32g0b1': flash_stm32f4, 'stm32f7': flash_stm32f4, | ||||||
|     'stm32h7': flash_stm32f4, 'stm32l4': flash_stm32f4, |     'stm32h7': flash_stm32f4, 'stm32l4': flash_stm32f4, | ||||||
|     'stm32g4': flash_stm32f4, 'rp2040': flash_rp2040, |     'stm32g4': flash_stm32f4, 'rp2': flash_rp2040, | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user