flipperzero-firmware
flipperzero-firmware copied to clipboard
Black Magic wont compile to wifi devboard
Describe the bug.
So i am using your guide to install black magic to the wifi devboard WD.1 When i run the command py -m ufbt devboard_flash i get the error of wifi board not being found. It shows up in my device manager.
Reproduction
- Install uFBT.
- Connect the wifiboard to pc
- run the command py -m ufbt devboard_flash
Target
Wifi Devboard
Logs
PS C:\Users\HydeAiden> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.22621.2506
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.2506
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PS C:\Users\HydeAiden> py -m ufbt devboard_flash
scons: Entering directory `C:\Users\HydeAiden\.ufbt\current\scripts\ufbt'
fbt: warning: Folder app: manifest application.fam is missing
LoadAppManifest, line 33, in file "C:\Users\HydeAiden\.ufbt\current\scripts\fbt_tools\fbt_apps.py"
python C:\Users\HydeAiden\.ufbt\current\scripts/wifi_board.py
2023-11-16 10:09:09,804 [ERROR] WiFi board not found
2023-11-16 10:09:09,804 [INFO] Please connect WiFi board to your computer, hold down BOOT button and press RESET button
scons: *** [phony_devboard_flash] Error 1
PS C:\Users\HydeAiden>
Anything else?
No response
Please show how does your device manager display it.
I have the same issue, and it also shows under "Other Devices" as ESP32-S2 with an error icon.
Under the ports section od device manager, mine looks the same, except it is COM9 instead of 6. I confirmed the ID it shows is an ESP ID in the device manager. Hope this helps. Not sure what to try next.
@hedger @DrZlo13 any progress?
Just chiming in as I have the exact same issue.
I'm going to infodump everything I have found out when debugging it on my end. I will be updating this post with findings. cc @hedger
find_wifi_board_bootloaderappears to be looking forESP32-S2, so I tried to check if it shows in the list at all.include_linksparameter does not help.
Output:for test_post in list_ports.comports(): print(f'Name: {test_post.name}, Desc: {test_post.description}, HWID: {test_post.hwid}')Name: COM6, Desc: USB Serial Device (COM6), HWID: USB VID:PID=303A:0002 SER=0 LOCATION=1-6:x.0The name the script expects is present in Device Manager for this COM device underBus reported device description, but that is not grepped by pySerial, at least by default.- This appears to be a known limitation of the Windows version of pySerial, with a PR open since 2018! https://github.com/pyserial/pyserial/pull/338
- Passing the port manually through
ufbtdoesn't seem to work either, scons doesn't pass it through. I hoped forufbt devboard_flash -p COM6to work, but it doesn't.
It would seem like using -p COM6 may be necessary in this case? It is potentially a necessity on Windows overall? The docs seem to imply that by saying Repeat Step 1 and view the name of your Developer Board that appeared in the list., but then this is never brought up again. Seems like without manual setupapi query circumventing pySerial, this is currently hopeless.
EDIT:
Even running wifi_board.py manually does not work. flash.command downloaded from Flipper's CDN refers to
'esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32s2 write_flash --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 bootloader.bin 0x10000 blackmagic.bin 0x8000 partition-table.bin \n'
while on Windows, it's esptool.exe. The CDN might have to drop .py from the definition so it works on both OSes, maybe?
It also cannot locate it, despite being located in python\Scripts.
EDIT2: I finally got it to run by:
- Adding
flash_command.replace("esptool.py", "python -m esptool")towifi_board.py. If this was to become a proper fix,pythonshould probably becomesys.executablethough. - Running
wifi_board.py -p COM6. Notice thatCOM6alone worked, which makes me think
inif os.name == "nt": port.device = f"\\\\.\\{port.device}"find_wifi_board_bootloadermay not be needed?