Ethercat firmware update on XMC4800

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User11975
Level 1
Level 1
Given the ample amount of flash space on an XMC4800 and the fact that I plan setting these devices up in a system with Ethercat as the only channel of communication with a host, it would be nice to be able to update the boards over Ethercat.

Has anybody here tried something like this?

I would guess I have two options:

Option 1 a Bootloader with ethercat:

The bootloader would either run the main application or download an updated application with verification etc. based on what the host tells it to do.
The updated application would be written to a specific area and verified before use, and not on top of the known good application.

Is this even possible with the given DAVE apps?
The bootloader would have to communicate over Ethercat and there's only one EEPROM location available when using the DAVE Ethercat implementation (0x08010000), would this not cause problems?
Maybe a "basic" implementation with mailboxes and FOE?

Option 2 self updating application:

The application contains the update functionality, making the system useless if an update fails, when ordered to update, it will use FOE to receive the update and write to the upper half of the flash which is reserved for this purpose.

Once the update is verified, the application would have to load a copy routine into PSRAM, copy the updated application to the lower part of the flash (0x0C020000 at the moment) and reset it self once this is done and verified.

-------

Any thoughts from the community, do you guys and gals think this is worth pursuing, and do you have any into before I might start working on this?
0 Likes
2 Replies
User11325
Level 1
Level 1
Hello C64,

We have been working on option 1 and are close to using it in the "real world" as well. So hopefully we have chosen the correct method.
Option 2 has the shortcoming, as you state, that if the application fails to initialize Ethercat, the you're stuck.

The bootloader jumps to the application when a INIT->PREOP is commanded when being in the bootloader.
Once in the application, a reset is required to reach the bootloader again.

How have you tackled the task?

Regards Mathias
0 Likes
User11975
Level 1
Level 1
Just a friendly update.

It is possible to write a bootloader with ethercat that handles all the update functionality in the bootloader alone, without having any application dependencies.

There is only one EEPROM location in flash, but a few changes to some of the files generated by DAVE can fix this, making the bootloader stick with it's original EEPROM content i.e. completely ignoring the EEPROM information in flash.
This removes the option of the master writing to the EEPROM when in the bootloader, but I have yet to find a reason why you would want to change this in something as static as a bootloader.

Going from bootloader to application can cause some headaches, depending on implementation.
I'm not going the advocate for any solution, but having a button or switch on the pcb for controlling if the bootloader should just start the application or stay active and receive an update over EtherCAT is probably the simplest solution.
0 Likes