Spagett1 / pineflash

A tool to flash ironos to the pinecil soldering iron and possibly other pine64 devices in the future
Other
213 stars 12 forks source link

0.5.0 Flashing Failed Windows, V1 and V2 irons #38

Closed tjuoft closed 1 year ago

tjuoft commented 1 year ago

I have two irons. a V1 and a V2. Trying to bring both up to date is failing.

I downloaded the Windows premade binaries. Run the app. Hold - button and plug in iron to USB cable. Nothing plugged into other port. 0.5.0 detects the irons no problem. Soldering Iron detected is displayed. I select V2.21 (tried V2.20 also) and as soon as I click Update it says Flashing then immediately says Flashing Failed, is your pinecil plugged in? Tried running as admin and not as admin, same result. Thought I had an epiphany as CURA was running which has a tendency to grab USB devices... Closed CURA... same result.

If I unplug and replug the iron, the pineflash accurately displays iron connected/iron disconnected.

In device manager, the iron shows up as an unknown device when connected while holding the - button. Is there a driver I should have installed for Windows?

Log file: Pineflash v0.5.0 PineFlash: Versions successfully fetched. Pineflash: Pinecil detected PineFlash: Download of Language Info Complete. PineFlash: Download Complete. PineFlash: File extracted successfully PineFlash: Attempting to flash Pinecil with the firmware C:\Users\admin\AppData\Local\Temp\v2.21-Pinecil\Pinecil_EN.dfu Dfu-Util: dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2021 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Match vendor ID from file: 28e9 Match product ID from file: 0189 Cannot open DFU device 28e9:0189 found on devnum 74 (LIBUSB_ERROR_NOT_SUPPORTED) No DFU capable USB device available

Spagett1 commented 1 year ago

Hey, that's quite interesting, i don't believe any drivers are needed. I'll do some investigation and get back to you.

Spagett1 commented 1 year ago

Could you also please send the log of when you try to flash your v2? It may help diagnose the problem

tjuoft commented 1 year ago

Well, this just got more interesting... Today the V2 iron flashed... Cannot make it repeat the previous report... The V1 iron still the same. First thing I noticed is the V2 iron actually gets a COM port assigned by Windows, not Device Unknown.

Second thing I tried was to reflash the V2 iron right after the V1 failed. Unplugged the V1, plugged in the V2, saw in the log COM14, selected V2.20 firmware (I assume downgrade is OK) clicked Update and the program crashed. No messages. Have not been able to repeat that crash.

Here is the log from the following operations Launch pineflash Connect V1 in boot mode Select V1 in GUI. Select V2.21 in GUI. Click Update Fail. Unplug V1 Plug V2 Select V2 in GUI,Select V2.21 in GUI Click Update Success.

I will add these are both Pinecil devices ordered from Pine64 site in case that makes a difference.

Pineflash v0.5.0 PineFlash: Versions successfully fetched. Pineflash: Pinecil detected PineFlash: Download of Language Info Complete. PineFlash: Download Complete. PineFlash: File extracted successfully PineFlash: Attempting to flash Pinecil with the firmware C:\Users\admin\AppData\Local\Temp\v2.21-Pinecil\Pinecil_EN.dfu Dfu-Util: dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2021 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Match vendor ID from file: 28e9 Match product ID from file: 0189 Cannot open DFU device 28e9:0189 found on devnum 107 (LIBUSB_ERROR_NOT_SUPPORTED) No DFU capable USB device available

Pineflash: Pinecil disconnected Pineflash: Pinecilv2 detected PineFlash: Serial port is COM14 PineFlash: Download Complete. PineFlash: File extracted successfully PineFlash: Attempting to flash Pinecilv2 with the firmware C:\Users\admin\AppData\Local\Temp\v2.21-Pinecilv2\Pinecilv2_EN.bin Blisp: Sending a handshake... Handshake successful! Getting chip info... BootROM version 1.0.2.7, ChipID: 0000C5D641CF0EB4 0b / 59200b (0.00%) 4092b / 59200b (6.91%) 8184b / 59200b (13.82%) 12276b / 59200b (20.74%) 16368b / 59200b (27.65%) 20460b / 59200b (34.56%) 24552b / 59200b (41.47%) 28644b / 59200b (48.39%) 32736b / 59200b (55.30%) 36828b / 59200b (62.21%) 40920b / 59200b (69.12%) 45012b / 59200b (76.03%) 49104b / 59200b (82.95%) 53196b / 59200b (89.86%) 57288b / 59200b (96.77%) 59200b / 59200b (100.00%) Sending a handshake... Handshake with eflash_loader successful. Erasing flash, this might take a while... Flashing boot header... Flashing the firmware... 0b / 189960b (0.00%) 2052b / 189960b (1.08%) 4104b / 189960b (2.16%) 6156b / 189960b (3.24%) 8208b / 189960b (4.32%) 10260b / 189960b (5.40%) 12312b / 189960b (6.48%) 14364b / 189960b (7.56%) 16416b / 189960b (8.64%) 18468b / 189960b (9.72%) 20520b / 189960b (10.80%) 22572b / 189960b (11.88%) 24624b / 189960b (12.96%) 26676b / 189960b (14.04%) 28728b / 189960b (15.12%) 30780b / 189960b (16.20%) 32832b / 189960b (17.28%) 34884b / 189960b (18.36%) 36936b / 189960b (19.44%) 38988b / 189960b (20.52%) 41040b / 189960b (21.60%) 43092b / 189960b (22.68%) 45144b / 189960b (23.77%) 47196b / 189960b (24.85%) 49248b / 189960b (25.93%) 51300b / 189960b (27.01%) 53352b / 189960b (28.09%) 55404b / 189960b (29.17%) 57456b / 189960b (30.25%) 59508b / 189960b (31.33%) 61560b / 189960b (32.41%) 63612b / 189960b (33.49%) 65664b / 189960b (34.57%) 67716b / 189960b (35.65%) 69768b / 189960b (36.73%) 71820b / 189960b (37.81%) 73872b / 189960b (38.89%) 75924b / 189960b (39.97%) 77976b / 189960b (41.05%) 80028b / 189960b (42.13%) 82080b / 189960b (43.21%) 84132b / 189960b (44.29%) 86184b / 189960b (45.37%) 88236b / 189960b (46.45%) 90288b / 189960b (47.53%) 92340b / 189960b (48.61%) 94392b / 189960b (49.69%) 96444b / 189960b (50.77%) 98496b / 189960b (51.85%) 100548b / 189960b (52.93%) 102600b / 189960b (54.01%) 104652b / 189960b (55.09%) 106704b / 189960b (56.17%) 108756b / 189960b (57.25%) 110808b / 189960b (58.33%) 112860b / 189960b (59.41%) 114912b / 189960b (60.49%) 116964b / 189960b (61.57%) 119016b / 189960b (62.65%) 121068b / 189960b (63.73%) 123120b / 189960b (64.81%) 125172b / 189960b (65.89%) 127224b / 189960b (66.97%) 129276b / 189960b (68.05%) 131328b / 189960b (69.13%) 133380b / 189960b (70.21%) 135432b / 189960b (71.30%) 137484b / 189960b (72.38%) 139536b / 189960b (73.46%) 141588b / 189960b (74.54%) 143640b / 189960b (75.62%) 145692b / 189960b (76.70%) 147744b / 189960b (77.78%) 149796b / 189960b (78.86%) 151848b / 189960b (79.94%) 153900b / 189960b (81.02%) 155952b / 189960b (82.10%) 158004b / 189960b (83.18%) 160056b / 189960b (84.26%) 162108b / 189960b (85.34%) 164160b / 189960b (86.42%) 166212b / 189960b (87.50%) 168264b / 189960b (88.58%) 170316b / 189960b (89.66%) 172368b / 189960b (90.74%) 174420b / 189960b (91.82%) 176472b / 189960b (92.90%) 178524b / 189960b (93.98%) 180576b / 189960b (95.06%) 182628b / 189960b (96.14%) 184680b / 189960b (97.22%) 186732b / 189960b (98.30%) 188784b / 189960b (99.38%) 189960b / 189960b (100.00%) Checking program... Program OK! Resetting the chip. Flash complete!

tjuoft commented 1 year ago

OK, so more to this and a good lead to the root cause... I knew I had flashed my V1 sometime in the past... not necessarily on this machine but I had... So I decided to try an alternate flasher...
I downloaded PINE64.Updater.Windows.3.zip and used that. I installed some kind of driver and the flash to V2.21 worked. After that... I went back and tried yours and yup, yours works now too... So there is some thing in the PINE64.Updater.Windows.3 driver installation that seems required... My guess is you have used that at some point on your machine...

Here is the log from the successful V1 flash using your program Pineflash v0.5.0 PineFlash: Versions successfully fetched. Pineflash: Pinecil detected PineFlash: Download of Language Info Complete. PineFlash: Download Complete. PineFlash: File extracted successfully PineFlash: Attempting to flash Pinecil with the firmware C:\Users\admin\AppData\Local\Temp\v2.21-Pinecil\Pinecil_EN.dfu Dfu-Util: dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2021 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Match vendor ID from file: 28e9 Match product ID from file: 0189 Multiple alternate interfaces for DfuSe file Opening DFU capable USB device... Device ID 28e9:0189 Device DFU version 011a Claiming USB DFU Interface... Setting Alternate Interface #1 ... Determining device status... DFU state(2) = dfuIDLE, status(0) = No error condition is present DFU mode device DFU version 011a Device returned transfer size 2048 DfuSe interface name: "Option Bytes " DfuSe interface name: "Internal Flash " Found GD32VF103, which reports a bad page size and count for its internal memory. Fixed layout based on part number: page size 1024, count 128. File contains 1 DFU images Parsing DFU image 1 Target name: ST... Image for alternate setting 0, (1 elements, total size = 53648) Setting Alternate Interface #0 ... Parsing element 1, address = 0x08000000, size = 53640

Erase [ ] 0% 0 bytes Erase [= ] 7% 4096 bytes Erase [== ] 11% 6144 bytes Erase [=== ] 15% 8192 bytes Erase [==== ] 19% 10240 bytes Erase [===== ] 22% 12288 bytes Erase [====== ] 26% 14336 bytes Erase [======= ] 30% 16384 bytes Erase [======== ] 34% 18432 bytes Erase [========= ] 38% 20480 bytes Erase [========== ] 41% 22528 bytes Erase [=========== ] 45% 24576 bytes Erase [============ ] 49% 26624 bytes Erase [============= ] 53% 28672 bytes Erase [============== ] 57% 30720 bytes Erase [=============== ] 61% 32768 bytes Erase [================ ] 64% 34816 bytes Erase [================= ] 68% 36864 bytes Erase [================== ] 72% 38912 bytes Erase [=================== ] 76% 40960 bytes Erase [==================== ] 80% 43008 bytes Erase [===================== ] 87% 47104 bytes Erase [====================== ] 91% 49152 bytes Erase [======================= ] 95% 51200 bytes Erase [======================== ] 99% 53248 bytes Erase [=========================] 100% 53640 bytes Erase done.

Download [ ] 0% 0 bytes Download [= ] 7% 4096 bytes Download [== ] 11% 6144 bytes Download [=== ] 15% 8192 bytes Download [==== ] 19% 10240 bytes Download [===== ] 22% 12288 bytes Download [====== ] 26% 14336 bytes Download [======= ] 30% 16384 bytes Download [======== ] 34% 18432 bytes Download [========= ] 38% 20480 bytes Download [========== ] 41% 22528 bytes Download [=========== ] 45% 24576 bytes Download [============ ] 49% 26624 bytes Download [============= ] 53% 28672 bytes Download [============== ] 57% 30720 bytes Download [=============== ] 61% 32768 bytes Download [================ ] 64% 34816 bytes Download [================= ] 68% 36864 bytes Download [================== ] 72% 38912 bytes Download [=================== ] 76% 40960 bytes Download [==================== ] 80% 43008 bytes Download [===================== ] 87% 47104 bytes Download [====================== ] 91% 49152 bytes Download [======================= ] 95% 51200 bytes Download [======================== ] 99% 53248 bytes Download [=========================] 100% 53640 bytes Download done. Done parsing DfuSe file

Spagett1 commented 1 year ago

Hmm, that's quite interesting. I don't actually have a v1 pinecil so that would be why i may have missed that. Interestingly though i havnt got any reports from others on windows about this but maybe they had it installed already too?

River-Mochi commented 1 year ago

@tjuoft

Pine64 Updater for windows indeed installs dfu-util 0.11 - that much I remember.

Only Pinecil V2 will show on Device manager as a PORT COM device, go to Device manager, top menu, pick View, "Show hidden devices" - this will show you all devices/software that is claiming a COM serial port. No idea why Windows is assigning V2 such a high COM14 number for you - it means lower POrts Com are already claimed. Typically one would get something COM1-COM4. this is also why it's good to View Show hidden devices and see what on earth is claiming all your COM ports. I have some software that automatically claims lower COM port for itself even when I don't have the device connected to my PC but only discovered this when I did "view, show hidden".

Details and some Screenshots of what V2 looks like in Device manager are in wiki:
https://wiki.pine64.org/wiki/Pinecil_Firmware#Troubleshoot_V2_Flashing Wiki also shows you how to get Device Manager to give Pinecil V2 a lower COM port. Mine is typicaly assigned COM3.

Pinecil V1 is different, when it connects to Device manager, it shows up under Universal Serial Bus devices as "unknown device" and not as any kind of PORT serial COM which is V2 only since it uses a different MCU chip.

Pinecil V1 will look very different and shows as Unknown USB device: image

I know that in past when V1 was only iron, there were issues with using older versions of dfu-util such as 0.9 but once peope updated to 0.11 DFU-util they were good (0.11 is the one Pine64 updater installs). I remember one person being upset that pine64-updater over-wrote their older DFU with newer dfu during install maybe more because it did not ask. Many times in Pine64 chat though people who were frustrated and could not get dfu to work with pinecil v1, as soon as they updated to 0.11 dfu, things simply worked (mostly this issue was in linux though since windows users tend to use GUI pine64 updater which automatically updates their DFU whereas linux often already had dfu-util installed but older version and people didn't realize right away to update would solve their issues updating pinecil firmware. https://dfu-util.sourceforge.net/

image

jaycollett commented 1 year ago

UPDATE: I got the device flashed just fine under windows 10 on the same machine (dual-boot). When the OS detected the Pinecil, it said "Setting up CDC Virtual Com Driver", then Pineflash detected the soldering iron, and flashing worked fine. I definitely think there is something odd with Windows 11 and the need for a virtual COM driver or something....

Just got a brand new Pinecil in the mail today; I went to flash the firmware, and no dice. After following the proper procedure to set the device in flash mode, I fire up PineFlash as Administrator (on Windows 11), and it shows "Soldering Iron Connected", I select V2.21 and EN, click update and it briefly shows "Flashing" followed by "Flashing failed, your device may have been disconnected". I see that I have a COM3 port when plug in my Pinecil in flash mode. For what it's worth, I tried blisp too and it would refuse to connect, tried multiple USB ports on the PC and cables. Any ideas?

Windows Version 22H2 (OS Build 22621.1992) Pineflash 0.5.1

Logs: Pineflash v0.5.1 PineFlash: Versions successfully fetched. Pineflash: Pinecilv2 detected PineFlash: Serial port is COM3 PineFlash: Download of Language Info Complete. PineFlash: Download Complete. PineFlash: File extracted successfully PineFlash: Attempting to flash Pinecilv2 with the firmware C:\Users\JAYCOL~1\AppData\Local\Temp\v2.21-Pinecilv2\Pinecilv2_EN.bin Blisp: Sending a handshake... Received no response from chip. Failed to handshake with device.

Spagett1 commented 1 year ago

Hey, thanks for the report but this seems to be an upstream issue with blisp, I forgot this was still open.