1. Base Example
As a base for this Example, the ECS CustomOD Example can be used.:
netXStudio_ECSV5_simpleConfig_V2.1.0.0\netX 90 - EtherCAT Slave - simpleConfig V2.1.0.0\Components\cifXApplicationDemoECS\Sources
2. netX90 Use Case A
Activate FoE parameter evaluation in Set Configuration Packet:
ptConfigReq->tData.tBasicCfg.ulComponentInitialization |= ECAT_SET_CONFIG_DEVICEINFO | ECAT_SET_CONFIG_FOE;
ECAT_SET_CONFIG_FOE_T* ptFoE;
ptFoE=&ptConfigReq->tData.tComponentsCfg.tFoECfg;
ptFoE->ulTimeout= 1000;
Before an update can be done, the netX90 need needs to be flashed with a maintenance firmware (MFW) and the *.mwc file.
Used here is For Use Case A the MFW V1.2.0.0 for Use Case A the file (File MFW-netX90_flash.mxf) or later can be used.
Insalled on netX the firmware ECS V5.1.0.4
and as Update tested with the firmware ECS V5.1.0.5 as update.
3. netX90 Use Case C
Very important! With ECS V5.2.0.0 the MFW V1.3.0.0 or later is necessary.
Take the files fdl, fimware, hwc and MFW for use case c and flash it on the netX90
start the MFW (S400.6 on NXHX90 = on) or start the ECS firmware.
Follow this guide to create with netHost tool and the command HIL_FORMAT_REQ_DATA_FLAGS_FULLFORMAT a files system in the SQI flash:
Use Case C - Extended Webserver - getting started
activate in the Set Configuration Packet
ptConfigReq->tData.tBasicCfg.ulComponentInitialization |= ECAT_SET_CONFIG_DEVICEINFO | ECAT_SET_CONFIG_FOE;
ECAT_SET_CONFIG_FOE_T* ptFoE;
ptFoE=&ptConfigReq->tData.tComponentsCfg.tFoECfg;
ptFoE->ulTimeout= 1000;
4. Create Zip file for update
Take the firmware V5.1.0.5 and create the folder structure inside the zip file like this:
VAR0\XIP\FWUPDATE.NXI
and Now create FWUPDATE.ZIP. The name of the zip file must be exactly FWUPDATE.ZIP .Mor
Open the FWUPDATE.ZIP and take cate that the folder inside is VAR0\XIP\ and not FWUPDATE\VAR0\XIP\
More information can be found underhere: Firmware update. For example the settings for the zip archivarchive.
...
5. Change the source code of the customOD Example
After download of downloading the zip archiv archive, a trigger is necessary to send the packet HIL_FIRMWARE_RESET_REQ to the stack and to start the update.
For that the "Hello Word" object of the customOD example can be used.
In the Write Object Indciation can be palced , the AppECS_StartUpdateReq can be placed:
...
Details to this Request can be found here:
netX Dual-Port Memory packet-based services - netX 90/4000/4100 - Packet API (Revision 3)
Maintenance Firmware (netX 90/4000)
6. ESI file
Add FoE to ESI file:
Copy the updated ESI file to TwinCAT3 folder C:\TwinCAT\3.1\Config\Io\EtherCAT
7. TwinCAT
Start TwinCat. Change the device state to PREOP and select "Download...":
Do not forget to add .ZIP:
Click OK and wait for download process to be finished. You can see the progress status at the right bottom of Twincat.
After the download finished successfully, go to CoE-Online. Try to write object 4000:01, the update reset command (AppECS_StartUpdateReq) will be trigged.
After a click on "OK", the netX will reset and update to the new firmware.