Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpflash: unable to download PICO firmware due to changed BOARD_ID #577

Closed
Josverl opened this issue Jun 4, 2024 · 4 comments
Closed

mpflash: unable to download PICO firmware due to changed BOARD_ID #577

Josverl opened this issue Jun 4, 2024 · 4 comments
Assignees
Labels
mpflash Flashing tool for Micropython

Comments

@Josverl
Copy link
Owner

Josverl commented Jun 4, 2024

Start with PICO v1.19.1

mpflash -VV list
10:42:04 | 🐞 version: 0.8.2
10:42:05 | ✏️ include=['*'], ignore=[], bluetooth=False
10:42:05 | ✏️ comports: ['COM15', 'COM13', 'COM17', 'COM5', 'COM21']
10:42:05 | ✏️ no Bluetooth: ['COM21']
10:42:05 | 🐞 filtered_comports: ['COM21']
10:42:05 | 🐞 D:\MyPython\micropython-stubber\.venv\Scripts\python.exe -m mpremote connect COM21 run
D:\MyPython\micropython-stubber\src\mpflash\mpflash\mpremoteboard\mpy_fw_info.py

                           Connected boards
┏━━━━━━┳━━━━━━━━━━━┳━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━┓
┃Serial┃Family     ┃Port┃Board                        ┃CPU   ┃Version┃
┡━━━━━━╇━━━━━━━━━━━╇━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━┩
│COM21 │micropython│rp2 │PICO                         │RP2040│v1.19.1│
│      │           │    │Raspberry Pi Pico with RP2040│      │       │
└──────┴───────────┴────┴─────────────────────────────┴──────┴───────┘

mpflash download fails to find PICO firmware, as it has been renamed

PS D:\MyPython\micropython-stubber\src\mpflash> mpflash -VV download
10:42:50 | 🐞 version: 0.8.2
10:42:50 | ✏️ include=['*'], ignore=[], bluetooth=False
10:42:50 | ✏️ comports: ['COM15', 'COM13', 'COM17', 'COM5', 'COM21']
10:42:50 | ✏️ no Bluetooth: ['COM21']
10:42:50 | 🐞 filtered_comports: ['COM21']
10:42:50 | 🐞 D:\MyPython\micropython-stubber\.venv\Scripts\python.exe -m mpremote connect COM21 run
D:\MyPython\micropython-stubber\src\mpflash\mpflash\mpremoteboard\mpy_fw_info.py

10:42:50 | ✏️ ask_missing_params: DownloadParams(ports=['rp2'], boards=['PICO'], versions=['stable'], 
fw_folder=WindowsPath('C:/Users/josverl/Downloads/firmware'), serial=['*'], ignore=[], clean=True, force=False)
10:42:50 | ✏️ answers: {'action': 'download', 'versions': ['stable']}
10:42:50 | ✏️ ask_missing_params returns: DownloadParams(ports=['rp2'], boards=['PICO'], versions=['stable'], 
fw_folder=WindowsPath('C:/Users/josverl/Downloads/firmware'), serial=['*'], ignore=[], clean=True, force=False)
10:42:52 | ✏️ Using latest stable version: v1.23.0
10:42:52 | ✏️ Checking MicroPython download pages
10:42:52 | 🐞 Total 0 firmwares
10:42:52 | 🐞 Matching firmwares: 0
10:42:52 | 🐞 Last preview only: 0
10:42:52 | ℹ️ Found 0 relevant unique firmwares
10:42:52 | ❌ No relevant firmwares could be found on https://micropython.org/download
10:42:52 | ℹ️ versions=['1.23.0'] ports=['rp2'] boards=['PICO']
10:42:52 | ℹ️ Please check the website for the latest firmware files or try the preview version.

manually download RPI_PICO firmware

PS D:\MyPython\micropython-stubber\src\mpflash> mpflash -VV download --board RPI_PICO
10:43:39 | 🐞 version: 0.8.2
10:43:39 | ✏️ ask_missing_params: DownloadParams(ports=['rp2'], boards=['RPI_PICO'], versions=['stable'], 
fw_folder=WindowsPath('C:/Users/josverl/Downloads/firmware'), serial=['*'], ignore=[], clean=True, force=False)        
10:43:39 | ✏️ answers: {'action': 'download', 'versions': ['stable']}
10:43:39 | ✏️ ask_missing_params returns: DownloadParams(ports=['rp2'], boards=['RPI_PICO'], versions=['stable'],      
fw_folder=WindowsPath('C:/Users/josverl/Downloads/firmware'), serial=['*'], ignore=[], clean=True, force=False)        
10:43:41 | ✏️ Using latest stable version: v1.23.0
10:43:41 | ✏️ Checking MicroPython download pages
10:43:41 | 🐞 Total 17 firmwares                                                                                       
10:43:41 | 🐞 Matching firmwares: 1
10:43:41 | 🐞 Last preview only: 1
10:43:41 | 🐞 RPI_PICO-v1.23.0.uf2
10:43:41 | ℹ️ Found 1 relevant unique firmwares
10:43:41 | 🐞  C:\Users\josverl\Downloads\firmware\rp2\RPI_PICO-v1.23.0.uf2 already exists, skip download
10:43:41 | ✅ Downloaded 0 firmwares, skipped 1 existing files.

After download, mpflash flash IS able to match PICO to RPI_PICO

PS D:\MyPython\micropython-stubber\src\mpflash> mpflash -VV flash
10:43:51 | 🐞 version: 0.8.2
10:43:51 | ✏️ include=['*'], ignore=[], bluetooth=False
10:43:51 | ✏️ comports: ['COM15', 'COM13', 'COM17', 'COM5', 'COM21']
10:43:51 | ✏️ no Bluetooth: ['COM21']
10:43:51 | 🐞 filtered_comports: ['COM21']
10:43:51 | 🐞 D:\MyPython\micropython-stubber\.venv\Scripts\python.exe -m mpremote connect COM21 run
D:\MyPython\micropython-stubber\src\mpflash\mpflash\mpremoteboard\mpy_fw_info.py

10:43:52 | ✏️ ask_missing_params: FlashParams(ports=['rp2'], boards=['PICO'], versions=['stable'], 
fw_folder=WindowsPath('C:/Users/josverl/Downloads/firmware'), serial=['*'], ignore=[], erase=True, bootloader=True,    
cpu=None)
10:43:52 | ✏️ answers: {'action': 'flash', 'serial': ['*'], 'versions': ['stable']}
10:43:52 | ✏️ ask_missing_params returns: FlashParams(ports=['rp2'], boards=['PICO'], versions=['stable'], 
fw_folder=WindowsPath('C:/Users/josverl/Downloads/firmware'), serial=['*'], ignore=[], erase=True, bootloader=True,    
cpu=None)
10:43:54 | ✏️ Using latest stable version: v1.23.0
10:43:54 | ✏️ Auto updating all boards to v1.23.0
10:43:54 | ✏️ include=['*'], ignore=[], bluetooth=False
10:43:54 | ✏️ comports: ['COM15', 'COM13', 'COM17', 'COM5', 'COM21']
10:43:54 | ✏️ no Bluetooth: ['COM21']
10:43:54 | 🐞 filtered_comports: ['COM21']
10:43:54 | ℹ️ Try (2) to find a firmware for the board PICO
10:43:54 | 🐞 Multiple v1.23.0 firmwares found for PICO on COM21.
10:43:54 | ℹ️ Found v1.23.0 firmware rp2\RPI_PICO-v1.23.0.uf2 for PICO on COM21.
10:43:54 | ℹ️ Updating PICO on COM21 to 1.23.0
10:43:54 | ℹ️ Entering bootloader on PICO on COM21
10:43:54 | 🐞 D:\MyPython\micropython-stubber\.venv\Scripts\python.exe -m mpremote connect COM21 resume bootloader     
10:43:56 | ℹ️ Erasing not yet implemented for UF2 flashing.
10:43:56 | ℹ️ Board is in bootloader mode                                                                              
10:43:56 | ✏️ Found Board-ID=RPI-RP2
10:43:56 | ℹ️ Board ID: RPI-RP2
10:43:56 | ℹ️ Copying C:\Users\josverl\Downloads\firmware\rp2\RPI_PICO-v1.23.0.uf2 to E:\.
10:44:01 | ✅ Done copying, resetting the board and wait for it to restart
10:44:08 | ℹ️ Flashed 1 boards                                                                                         
Updating board info ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   0% -:--:--10:44:08 | 🐞 D:\MyPython\micropython-stubber\.venv\Scripts\python.exe -m mpremote connect COM21 resume run
D:\MyPython\micropython-stubber\src\mpflash\mpflash\mpremoteboard\mpy_fw_info.py
                    Updated boards after flashing                                                                      
┏━━━━━━┳━━━━━━━━━━━┳━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━┓
┃Serial┃Family     ┃Port┃Board                        ┃CPU   ┃Version┃
┡━━━━━━╇━━━━━━━━━━━╇━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━┩
│COM21 │micropython│rp2 │RPI_PICO                     │RP2040│v1.23.0│
│      │           │    │Raspberry Pi Pico with RP2040│      │       │
└──────┴───────────┴────┴─────────────────────────────┴──────┴───────┘

reported by @beetlegigg in #557

@Josverl Josverl changed the title mpflash: mpflash: unable to download PICO firmware due to change BOARD_ID Jun 4, 2024
@Josverl Josverl changed the title mpflash: unable to download PICO firmware due to change BOARD_ID mpflash: unable to download PICO firmware due to changed BOARD_ID Jun 4, 2024
@Josverl Josverl self-assigned this Jun 4, 2024
@Josverl Josverl added the mpflash Flashing tool for Micropython label Jun 4, 2024
@beetlegigg
Copy link

@Josverl - its looking good from your log and mpflash will be a a very useful tool. I just did a pip install mpflash, but the version installed is still at 0.8.1b1. I will try again in a day or so to see if I can get 0.8.2 or above at that time for a check of the latest on my mac at which time I will see if I can get a bunch of different boards to update to micropython v1.23

@Josverl
Copy link
Owner Author

Josverl commented Jun 4, 2024

Try pip install -U mpflash

U is for Upgrade

@beetlegigg
Copy link

I just tried pip install -U mpflash but it appears to have moved the version back from 0.8.1b1 as mpflash --version now reports: mpflash, version 0.8.1

@Josverl
Copy link
Owner Author

Josverl commented Jun 23, 2024

@beetlegigg , Apologies, the version was not published, but there have been a few updates since.
the current version 0.8.8 has the fixes that resolved this issue.

Thanks for testing.

@Josverl Josverl closed this as completed Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mpflash Flashing tool for Micropython
Projects
None yet
Development

No branches or pull requests

2 participants