DFUScript v0.1 - Script to help flashing

Shawn "prjktdtnt" Thompson mokowatch at projektenterprises.com
Sun Sep 14 14:56:25 CEST 2008

    I would be honored to see my code used in a project that serves a 
wider audience. I wrote the script mainly for my own use and figured I 
would submit it as a community project for those who wanted to use 
and/or improve upon it.

    To find multiple DFU devices I would have to type "dfu-util -l" then 
pass "dfu-util -d hexcode -a alternate -R -D imagefile.bin" or some 
similar command to flash my device. Now I type "./dfuscript device 
alternate file.bin" which takes me about half of what it did since I no 
longer need to list to grab the hex or type in additional arguments such 
as -R or -D.

    The hex codes should be static for all Neo1973 or Neo FreeRunners as 
far as I'm aware. If anyone knows otherwise please correct me.

    I think that adding the option to select your device type and then 
what images you would like to update would be great, a setup menu, as 
you suggested, would work for this also.

    One feature I would love to see is the option you mentioned of 
updating multiple sections at once. Ex: if I have a new kernel and 
rootfs, instead of doing them separately I would be able to select, via 
a checkbox instead of radio-button, both of them, select each file, 
confirm that is what I want to flash to each section and finally be 
advised that I should power into NAND/NOR and press ok for it to loop 
through each section. My script doesn't have this ability but it was 
something I considered as it would make life quite a bit faster in that 

    If I knew more about coding I would love to contribute additional 
code but for now all I can offer is what I have done so far. If any of 
my code could be useful to your script please use it. The fact that two 
open source fans can build upon each-other's work is why I love and back 
open-source wherever I can.

    I'm looking forward to seeing more improvements to the gui and 
hopefully eventually seeing my script being made completely obsolete or 
even integrated into your program in some form.

-Shawn "prjktdtnt" Thompson

Dale Maggee wrote:
> Shawn,
> I don't have multiple devices which support DFU, but I'd love to add 
> support for this in my utility, so can you give me some advice on how 
> this might work?
>  - is there a way to list attached devices which are DFU-capable?
>  - how are these hex codes obtained?
>  - since you have them hardcoded, I assume they're an identifier code 
> which is the same for all FR's and all 1973s (i.e the code identifies 
> the type of device)?
>  - is the hex code an argument you always need to pass if you're 
> flashing a 1973 (i.e if you only have 1 device attached and it's a 1973, 
> do you still need to give it the hex code or does it detect the 1973 and 
> flash it without the hex code)?
> One thought which might be the easiest method is to implement it as an 
> item in the 'setup' menu which allows you to choose between a freerunner 
> and a 1973 and provides the appropriate hex code. but it would be nice 
> if I could detect that you have 2 devices attached and show an 'which 
> device do you want to flash?' screen with a list of detected devices. 
> this way if you only have one device attached it doesn't matter whether 
> it's a 1973 or a freerunner.
> I am planning on adding command line support for my script, which should 
> make you happy. I may 'borrow' some of your code to implement this ;)
> I will also add a 'flashing u-boot on a 1973 may give you a paperweight' 
> warning to my tool.
> I should probably also change all references to 'freerunner' in my 
> script to say 'neo'.
> as for the 'only have 30 seconds' thing, this is why I have the 'now is 
> the time to turn on your device and activate the nand/nor menu' screen - 
> the idea is that you select your desired flashing option, then get into 
> the nand/nor menu on your device, then press OK and it starts. this is 
> also why I included the ability to flash multiple images at once - so 
> that for example you can flash rootfs and kernel without having the 
> thing power off while you're typing the second command [I also type 
> quicker than I click, but I don't do either particularly quickly ;) ]
> Shawn "prjktdtnt" Thompson wrote:
>> Minh,
>>     I am aware of Dale's work but if you have multiple devices that 
>> support DFU then the gui will error out. I have seen the UI and it does 
>> look very promising. I may stop using my script and go back to Dale's 
>> gui when it supports the ability to select a specific device. I am kind 
>> of a CLI enthusiast because I type much faster than I can click, which 
>> is good when you've only got 30 seconds to issue a command.
>>     Thanks for the suggestion, I will add the link now.
>> -Shawn
>> Minh Ha Duong wrote:
>>> Shawn: are you aware of Dale's work ?
>>> May I suggest also a link to the script's page from:
>>> http://wiki.openmoko.org/wiki/Flashing_the_Neo_FreeRunner#A_script_to_do_all_this_from_a_nice_GUI...
>>> Minh
>>> _______________________________________________
>>> Openmoko community mailing list
>>> community at lists.openmoko.org
>>> http://lists.openmoko.org/mailman/listinfo/community
>> _______________________________________________
>> Openmoko community mailing list
>> community at lists.openmoko.org
>> http://lists.openmoko.org/mailman/listinfo/community
> _______________________________________________
> Openmoko community mailing list
> community at lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/community

More information about the community mailing list