Welcome! Log In Create A New Profile

Advanced

Unable to update firmware

Posted by Marc van Beelen 
Re: Unable to update firmware
May 15, 2015 08:05AM
Quote
dmould
Another possible way to go would be to modify the firmware so that it looks for a firmware update file on the SD card. During initialisation, if it finds a firmware update file on the SD card that is a different version to the one installed, it updates its firmware from the file on the SD card. So long as all new Duets sold contain firmware with such a feature, uses will be able to update their firmware simply by copying the firmware update file onto the SD card and power-cycling the Duet.

That's how firmware updating is normally done on the Smoothieboard.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Unable to update firmware
May 15, 2015 08:43AM
Hi Dave

Yes, we've considered this. The main problem is that you effectively need two firmwares. The initial one (or extended bootloader) that runs at startup, that can access the SD card (or network) and compare the installed firmware to the firmware on the SD card (or online), and which can overwrite the flash memory (without overwriting itself), tell you what it's doing (by the serial console) then exit memory cleanly before loading the actual firmware! The Duet doesn't have a lot of memory (100k), but at least should have enough flash memory to hold, effectively, two firmwares.

It's all do-able, probably, we just haven't had the skills and time available to implement this (or something like it).

Ian
RepRapPro tech support
Re: Unable to update firmware
May 15, 2015 09:21AM
Quote
dc42
That's how firmware updating is normally done on the Smoothieboard.

I think Smoothieboard uses mBed, and that's quite a standard way of updating? It helps to have the in-house ARM devs behind you!

Ian
RepRapPro tech support
Re: Unable to update firmware
May 15, 2015 10:40AM
Quote
droftarts
Hi Dave

Yes, we've considered this. The main problem is that you effectively need two firmwares. The initial one (or extended bootloader) that runs at startup, that can access the SD card (or network) and compare the installed firmware to the firmware on the SD card (or online), and which can overwrite the flash memory (without overwriting itself), tell you what it's doing (by the serial console) then exit memory cleanly before loading the actual firmware! The Duet doesn't have a lot of memory (100k), but at least should have enough flash memory to hold, effectively, two firmwares.

It's all do-able, probably, we just haven't had the skills and time available to implement this (or something like it).

Ian
RepRapPro tech support

The way I do it for my products is to have a routine somewhere in the normal initialisation that looks to see whether a valid firmware update file exists and if so whether an update should be performed (firmware in file is different to firmware installed). If so, the actual Flash updating routine is copied to RAM, and the program then jumps to that RAM location. With instructions now being fetched from RAM, the whole Flash can be erased and the new firmware written, after which a software reset is carried out. As normal processing is suspended during firmware updating, it can re-initialise and use all of the available RAM if required (the update routine is written as a standalone program). A routine to erase the flash, read from SD card and write to Flash should not take more than a kB or so, though in your case you would probably need to do a walk through the SD card file system before you call the programming routine and make a RAM table of the SD card sectors to read to get the file data so that the programming routine running in RAM does not have to call any FAT32 routines but can pull data from the SD card directly by the pre-computed sector addresses. The flash programming routine I use (the part that you would need to run in RAM) takes up less than 100 bytes.

Dave
Re: Unable to update firmware
May 15, 2015 10:47AM
Dave - neat! Thanks for the ideas!

Ian
RepRapPro tech support
Re: Unable to update firmware
May 16, 2015 04:03AM
Hi Guys,

I am using a 32 bit Mac with OSX 10.6.8 and have Arduino 1.0.6 installed.

I have drilled down the folder structure but can see no sign of bossac. In the /hardware/tools directory there is only another folder called avr.

I have read further up about using Board Manager to add bossac, but can not see this in any of the menus on my set-up.

Any advice much appreciated.

Ralph
Re: Unable to update firmware
May 16, 2015 05:41AM
I can confirm that Bossa the gui version does NOT work with Mac computers, it never locates the port.

Brian
Re: Unable to update firmware
May 16, 2015 12:21PM
Quote
Europa
I can confirm that Bossa the gui version does NOT work with Mac computers, it never locates the port.

Brian

On the Arduino forum, I found a link to here [nw2s.net] for a Mavericks-only version of Bossac that is supposed to work with the Arduino Due

Edited 2 time(s). Last edit at 05/17/2015 03:28PM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Unable to update firmware
May 17, 2015 12:02PM
Quote
rjmusto
Hi Guys,

I am using a 32 bit Mac with OSX 10.6.8 and have Arduino 1.0.6 installed.

I have drilled down the folder structure but can see no sign of bossac. In the /hardware/tools directory there is only another folder called avr.

I have read further up about using Board Manager to add bossac, but can not see this in any of the menus on my set-up.

Any advice much appreciated.

Ralph

You're using Arduino IDE 1.0.6? This version pre-dates the Arduino Due, so does not have support for ARM-based Arduino boards, only the old AVR boards. Use version 1.6.1, as per the instructions: [reprappro.com]
Then bossac is where the firmware update instructions says it is: [reprappro.com]

You will only see the Tools > Board > Boards Manager menu in Arduino IDE version 1.6.2 and later. It installs bossac in a different place from 1.6.1, which is what I was explaining earlier in the thread.

And we know the 'gui' version of Bossa doesn't work, which is why we don't link to it!

Ian
RepRapPro tech support
Re: Unable to update firmware
May 20, 2015 03:33PM
Hi Ian,
Thanks for the input.

Not sure why, but I had it stuck in my head that version 1.0.6 was the last that would run on a 32bit machine - duh. So I have now installed 1.6.1 and i can see that bossac is there.

My next problem is that the Mac is not recognising the duet board on the USB port........

Ralph
Re: Unable to update firmware
May 20, 2015 04:24PM
Mac has issues when you reset the duet, I use my work windows for the firmware, no choice. Using windows on a virtual machine also does not work


----- Making the world smarter @ www.xetal.eu
----- Helping entrepreneurs @ www.fralke.com
Re: Unable to update firmware
May 20, 2015 05:29PM
Hi Ralph

There's a Mac-specific firmware update problem thread (with more explanation, and tests) here: [forums.reprap.org]
Please post your Mac connections problems there. At the moment, it generally seems Macs can see the Duet when it has firmware, but some can't when the firmware is erased. I really don't know why this is! If you can post your experience on the above thread, it may help resolve this problem.

Ian
RepRapPro tech support
Sorry, only registered users may post in this forum.

Click here to login