Rescue Mode (DFU) in Windows (for upgrading old firmware uploaded via Linux)


#1

Hi all - I decided to finally take a stab at using the Axoloti in Windows and having some fun issues.

I am using a pre-release v05 board and have successfully installed the new Axoloti app and platform_win folder on Windows 7 64bit.

The board seems to correctly boot into DFU mode and the zadig installed windows driver seems to show the board correctly inside the Axoloti app:

screenshot

Since the board was previously flashed with older firmware on ubuntu - I need to reflash the new firmware in windows - and here is where it gets sketchy. I am following the Windows Install guide.

Connecting to the board that has incorrect firmware for the OS is impossible - so Entering Rescue mode is not possible.
Booting up while pressing S1 is fine, so then I select the Flash (Rescue).

I get this error

Link to firmware CRC Please compile the firmware first
Start disconnect
Done disconnect
Start flashing firmware with DFU
java.io.IOException: Cannot run program "C:\Program" (in directory "C:\Program Files (x86)\Axoloti\app\firmware"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:450)
at qcmds.QCmdShellTask.Do(QCmdShellTask.java:114)
at qcmds.QCmdProcessor.run(QCmdProcessor.java:183)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 5 more

Flashing firmware failed!

Perhaps I need to compile the firmware first, but I get a familiar error for an incorrectly configured Windows OS:

Start compiling firmware
"setup build dir"
"Compiling firmware..."
'make' is not recognized as an internal or external command,
operable program or batch file.
'make' is not recognized as an internal or external command,
operable program or batch file.
"Compiling firmware flasher..."
'make' is not recognized as an internal or external command,
operable program or batch file.
Link to firmware CRC Please compile the firmware first
Done compiling firmware

I recall the windows setup guide for the prerelease Axoloti firmware being pretty involved - i guess all of those instructions are still relevant?
I am also thinking it won't be easy to use the official Axoloti board with the Zadig replaced USB driver on the same Windows OS that is configured for STM Discovery DFU (I use the STM flasher nowadays on another machine).

Part of me wants it to work, but I also don't mind sticking to Linux if it is just simpler in my case.


#2

I recall the windows setup guide for the prerelease Axoloti firmware being pretty involved - i guess all of those instructions are still relevant?

possibly not, please follow the installation guide for windows... we have streamlined the whole process to make it much simpler for users, so no, it is now not 'involved'... e.g. you should not need to compile the firmware, or even enter DFU mode.

I suspect your issues are simply related to using pre-release versions of the software, which are partially incompatible with the release software.

but lets go through a few things, to get you on a level footing

a) can you confirm you are using v1.0 (and not a pre-release... of both app and runtime) ,
if not, download and update

b) can you confirm you put the axoloti_runtime folder in C:\Program Files (x86)
you should have:
C:\:\Program Files (x86)\axoloti_runtime\platform_win
I ask as this is where 'make' is looked for....

'make' is not recognized as an internal or external command

(also if you have changed the runtime path in preferences Id recommend you change it back... or just delete axoloti.prefs in your \Documents\axoloti' folder, which will reset you to default.

c) I assume you are using the app, and not trying to run from the command line/or a repo install.
easier for me to diagnose, and everything can be done from the app now.

d) non-dfu mode - the most likely reason it wont connect, is if you used a pre-release version of the windows driver, this had an issue with the driver installation. to resolve this you can either:

  • use Zadig and switch it to use libusb from winusb (easy route :))
    OR
  • uninstall the Axoloti Core driver (make use you uninstall the driver, not just delete the device), then use regedit to delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\16C004420200

neither is 'better', just the later will allow you to use the normal windows drivers, as production boards do.

a few other thoughts/notes:

  • how did you get the compile firmware option, did you start changing the location of the firmware/engage expert mode? the 'normal' user is no longer exposed to this, as its unnecessary for anyone other than someone developing the firmware to use this.
  • linux, if you get the current linux app/runtime and install as per instructions... then you can use that to flash the board to get your firmware on to the current version, without worrying about DFU mode on windows.

my general recommendation here, is if you are not developing firmware, then I would move to using the pre-built & released versions of app/runtime.... (at least initially), and that we ensure your setup on Linux/Windows are both using these.


#3

Thanks for the reply!

a) Yes this is a different PC than I've ever used and it did not have any previous versions of the software. I've freshly downloaded both the app and the zip as per instructions.

b) Here is my first problem - I did not put the zip in the correct location. I am afraid it wasn't clear enough to me where to put it in the instructions. I ended up putting "platform_win" folder from the zip into "C:\Program Files (x86)". I have now placed it into /axoloti_runtime/ after creating a new folder in "C:\Program Files (x86)"

After doing this I ran the Rescue flash option in the Windows App again and got these errors in the log:

search path : objects
finished loading objects
port: driver OK, CPU ID indeterminate
Link to firmware CRC Please compile the firmware first
Start disconnect
Done disconnect
Start flashing firmware with DFU

C:\Program Files (x86)\Axoloti\app\firmware>call C:\PROGRA~2\AXOLOT~1\PLATFO~1\path.bat

C:\Program Files (x86)\Axoloti\app\firmware>set platformdir=C:\PROGRA~2\AXOLOT~1\PLATFO~1\

C:\Program Files (x86)\Axoloti\app\firmware>if not defined axoloti_release (set axoloti_release=C:\PROGRA~2\AXOLOT~1\PLATFO~1.. )

C:\Program Files (x86)\Axoloti\app\firmware>if not defined axoloti_runtime (set axoloti_runtime=C:\PROGRA~2\AXOLOT~1\PLATFO~1\.. )

C:\Program Files (x86)\Axoloti\app\firmware>if not defined axoloti_firmware (call :setfirmware "C:\Program Files (x86)\Axoloti\app\firmware" )

C:\Program Files (x86)\Axoloti\app\firmware>call :setrelease "C:\Program Files (x86)\Axoloti\app"

C:\Program Files (x86)\Axoloti\app\firmware>set axoloti_release=C:\PROGRA~2\Axoloti\app

C:\Program Files (x86)\Axoloti\app\firmware>goto :eof

C:\Program Files (x86)\Axoloti\app\firmware>if not defined axoloti_home (set axoloti_home=C:\PROGRA~2\AXOLOT~1\PLATFO~1.. )

C:\Program Files (x86)\Axoloti\app\firmware>set PATH=C:\PROGRA~2\AXOLOT~1\PLATFO~1\bin

C:\Program Files (x86)\Axoloti\app\firmware>goto :eof

C:\Program Files (x86)\Axoloti\app\firmware>dfu-util --device 0483:df11 -i 0 -a 0 -D C:\Program Files (x86)\Axoloti\app\firmware/build/axoloti.bin --dfuse-address=0x08000000:leave
dfu-util 0.8
No such file or directory: Could not open file C:\Program for reading

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

shell task failed, exit value: 74
Flashing firmware failed!

I haven't changed any preferences and I can not see any axoloti folder in My Documents either.

c) I definitely want to try to use Axoloti on Windows as a user, so trying not to resort to any command lines or firmware modification.

d) I will try to use zadig again to switch to the correct USB driver. I don't think it is documented in the windows installations instructions so I am pretty sure I just switched the DFU STM driver and the boards non DFU mode driver, both to Win USB with zadig.

The firmware compile is simply visible in my app after installation

screenshot

Nice tip about using linux to bring it to the current firmware - really glad this will work. I remember during beta you were not able to use a board flashed on Linux on Windows.

thanks again!


#4

There is an issue in the upload_fw_dfu.bat script in the last release, causing an incomplete filename.


tells you how to fix dfu flashing on windows. Coming from pre-release firmware you will likely need to do a flash using DFU mode.


#5

I am thinking I will just flash to 1.0 with Ubuntu and save myself the pain of windows for this very specific task.

but I could also play guinea pig and try to do it


#6

Guinea pig please!
The screenshot shows the exact issue I fixed in the git commit above, perhaps just edit upload_fw_dfu.bat manually untill the next release (shortly).
Normally you do not need this "rescue flash" (dfu) method, since there is in-application flashing without engaging any button or plugging a cable.


#7

*no dfu mode
yeah thats pretty great - but i guess it (shouldn't) won't work in my case since im on old firmware anyway.


#8

Yes, upgrading from pre-release firmware will need a DFU mode flash.


#9

here we go - there seems to be no firmware in the directory.

changed to the new .bat

No available USB device found with matching PID/VID
search path : objects
finished loading objects
port: driver OK, CPU ID indeterminate
Link to firmware CRC Please compile the firmware first
Start disconnect
Done disconnect
Start flashing firmware with DFU

C:\Program Files (x86)\Axoloti\app\firmware>call C:\PROGRA~2\AXOLOT~1\PLATFO~1\path.bat

C:\Program Files (x86)\Axoloti\app\firmware>set platformdir=C:\PROGRA~2\AXOLOT~1\PLATFO~1\

No such file or directory: Could not open file C:\Program Files (x86)\Axoloti\app\firmware/build/axoloti.bin for reading
C:\Program Files (x86)\Axoloti\app\firmware>if not defined axoloti_release (set axoloti_release=C:\PROGRA~2\AXOLOT~1\PLATFO~1.. )

C:\Program Files (x86)\Axoloti\app\firmware>if not defined axoloti_runtime (set axoloti_runtime=C:\PROGRA~2\AXOLOT~1\PLATFO~1\.. )

C:\Program Files (x86)\Axoloti\app\firmware>if not defined axoloti_firmware (call :setfirmware "C:\Program Files (x86)\Axoloti\app\firmware" )

C:\Program Files (x86)\Axoloti\app\firmware>call :setrelease "C:\Program Files (x86)\Axoloti\app"

C:\Program Files (x86)\Axoloti\app\firmware>set axoloti_release=C:\PROGRA~2\Axoloti\app

C:\Program Files (x86)\Axoloti\app\firmware>goto :eof

C:\Program Files (x86)\Axoloti\app\firmware>if not defined axoloti_home (set axoloti_home=C:\PROGRA~2\AXOLOT~1\PLATFO~1.. )

C:\Program Files (x86)\Axoloti\app\firmware>set PATH=C:\PROGRA~2\AXOLOT~1\PLATFO~1\bin

C:\Program Files (x86)\Axoloti\app\firmware>goto :eof

C:\Program Files (x86)\Axoloti\app\firmware>dfu-util --device 0483:df11 -i 0 -a 0 -D "C:\Program Files (x86)\Axoloti\app\firmware/build/axoloti.bin" --dfuse-address=0x08000000:leave
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

shell task failed, exit value: 74
Flashing firmware failed!


#10

im going to reinstall the app in case me pressing Firmware> "Compile" deleted whatever was bundled with the app install.

*nope - no firmware bundled.
**Maybe that is why the option is visible to me inside the App - Board>Firmware> "Compile"


#11

Oh oh, bundle is missing firmware indeed. Will fix this now!


#12

thanks. will try the new bundle tomorrow.


#13

With new version of the zip and the app I was able to do the rescue flash without any problem!

No available USB device found with matching PID/VID
search path : objects
finished loading objects
port: driver OK, CPU ID indeterminate
Link to firmware CRC 2B8D2015
Start disconnect
Done disconnect
Start flashing firmware with DFU

C:\Program Files (x86)\Axoloti\app\firmware>call C:\PROGRA~2\AXOLOT~1\PLATFO~1\path.bat

C:\Program Files (x86)\Axoloti\app\firmware>set platformdir=C:\PROGRA~2\AXOLOT~1\PLATFO~1\

C:\Program Files (x86)\Axoloti\app\firmware>if not defined axoloti_release (set axoloti_release=C:\PROGRA~2\AXOLOT~1\PLATFO~1.. )

C:\Program Files (x86)\Axoloti\app\firmware>if not defined axoloti_runtime (set axoloti_runtime=C:\PROGRA~2\AXOLOT~1\PLATFO~1\.. )

C:\Program Files (x86)\Axoloti\app\firmware>if not defined axoloti_firmware (call :setfirmware "C:\Program Files (x86)\Axoloti\app\firmware" )

C:\Program Files (x86)\Axoloti\app\firmware>call :setrelease "C:\Program Files (x86)\Axoloti\app"

C:\Program Files (x86)\Axoloti\app\firmware>set axoloti_release=C:\PROGRA~2\Axoloti\app

C:\Program Files (x86)\Axoloti\app\firmware>goto :eof

C:\Program Files (x86)\Axoloti\app\firmware>if not defined axoloti_home (set axoloti_home=C:\PROGRA~2\AXOLOT~1\PLATFO~1.. )

C:\Program Files (x86)\Axoloti\app\firmware>set PATH=C:\PROGRA~2\AXOLOT~1\PLATFO~1\bin

C:\Program Files (x86)\Axoloti\app\firmware>goto :eof

C:\Program Files (x86)\Axoloti\app\firmware>dfu-util --device 0483:df11 -i 0 -a 0 -D "C:\Program Files (x86)\Axoloti\app\firmware/build/axoloti.bin" --dfuse-address=0x08000000:leave
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Deducing device DFU version from functional descriptor length
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08000000, size = 560936

Download [ ] 0% 0 bytes
Download [ ] 0% 2048 bytes
Download [ ] 2% 12288 bytes
Download [ ] 3% 18432 bytes
Download [= ] 4% 22528 bytes
Download [= ] 4% 26624 bytes
Download [= ] 5% 32768 bytes
Download [= ] 7% 43008 bytes
Download [== ] 8% 45056 bytes
Download [== ] 8% 49152 bytes
Download [== ] 10% 57344 bytes
Download [== ] 11% 65536 bytes
Download [=== ] 12% 67584 bytes
Download [=== ] 13% 75776 bytes
Download [=== ] 14% 83968 bytes
Download [==== ] 16% 90112 bytes
Download [==== ] 16% 94208 bytes
Download [==== ] 18% 104448 bytes
Download [===== ] 20% 112640 bytes
Download [===== ] 21% 122880 bytes
Download [===== ] 23% 131072 bytes
Download [===== ] 23% 133120 bytes
Download [====== ] 24% 135168 bytes
Download [====== ] 25% 141312 bytes
Download [====== ] 27% 151552 bytes
Download [======= ] 28% 157696 bytes
Download [======= ] 28% 161792 bytes
Download [======= ] 30% 169984 bytes
Download [======== ] 32% 180224 bytes
Download [======== ] 33% 188416 bytes
Download [======== ] 35% 198656 bytes
Download [========= ] 36% 202752 bytes
Download [========= ] 37% 208896 bytes
Download [========= ] 38% 217088 bytes
Download [========== ] 40% 225280 bytes
Download [========== ] 40% 227328 bytes
Download [========== ] 42% 237568 bytes
Download [========== ] 43% 245760 bytes
Download [=========== ] 44% 247808 bytes
Download [=========== ] 45% 256000 bytes
Download [=========== ] 46% 262144 bytes
Download [=========== ] 47% 264192 bytes
Download [============ ] 48% 270336 bytes
Download [============ ] 48% 274432 bytes
Download [============ ] 50% 282624 bytes
Download [============= ] 52% 292864 bytes
Download [============= ] 54% 303104 bytes
Download [============= ] 55% 311296 bytes
Download [============== ] 56% 315392 bytes
Download [============== ] 57% 321536 bytes
Download [============== ] 59% 331776 bytes
Download [=============== ] 60% 337920 bytes
Download [=============== ] 60% 339968 bytes
Download [=============== ] 62% 350208 bytes
Download [================ ] 64% 360448 bytes
Download [================ ] 65% 368640 bytes
Download [================ ] 67% 378880 bytes
Download [================= ] 68% 382976 bytes
Download [================= ] 69% 387072 bytes
Download [================= ] 70% 393216 bytes
Download [================= ] 70% 397312 bytes
Download [================== ] 72% 405504 bytes
Download [================== ] 72% 407552 bytes
Download [================== ] 74% 415744 bytes
Download [================== ] 75% 425984 bytes
Download [=================== ] 76% 428032 bytes
Download [=================== ] 77% 436224 bytes
Download [=================== ] 79% 444416 bytes
Download [==================== ] 80% 450560 bytes
Download [==================== ] 81% 454656 bytes
Download [==================== ] 82% 464896 bytes
Download [===================== ] 84% 473088 bytes
Download [===================== ] 86% 483328 bytes
Download [===================== ] 87% 493568 bytes
Download [====================== ] 88% 495616 bytes
Download [====================== ] 89% 501760 bytes
Download [====================== ] 91% 512000 bytes
Download [======================= ] 92% 516096 bytes
Download [======================= ] 92% 520192 bytes
Download [======================= ] 93% 524288 bytes
Download [======================= ] 94% 530432 bytes
Download [======================== ] 96% 538624 bytes
Download [======================== ] 97% 548864 bytes
Download [======================== ] 99% 559104 bytes
Download [=========================] 100% 560936 bytes
Download done.
File downloaded successfully
Transitioning to dfuMANIFEST state
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Done flashing firmware with DFU.

Compile firmware option is still available to me though - not sure if this is intended based on past conversation above.

Now I am able to connect the board normally but I believe we need to add some more details to the instructions about the driver switching with Zadig. I will add those to issue tracker.


#14

Im fixing the 'compile option' now... its another 'windows' thing, and the way its shortens its paths...
it will be in 1.0.2, doh, just noticed johannes has released 1.0.2... ok, it will be in 1.0.3 smile


#15

just for more info -
when board is NOT connected - http://i.imgur.com/CuOwWsp.png
when board IS connected - http://i.imgur.com/w70xs1u.png

I am not running the APP in any special way.