USB Software Updates Overview
OpenView Codesys Displays can be updated via a USB Flash drive. Files must be located in the appropriate locations and a complete file set is required. Here is a list of the required files and their locations:
- Application.app
- Application.crc
- /visu folder
- Splash.png (optional)
The files must be in the root directory of the USB, such as shown below:
Basic Programming Steps
- Initialize the System_USB_Mode variable with the current state of the USB port.
- Role swap the USB port from USB Device to USB Host: System_USB_Mode := 1;
- Call the library function “ECP.UpdateApplicationFirmware” located in the Peripherals library, then pass arguments for each of these files. This library function will place the files in the correct location and then return an error state.
- Evaluate the download process for errors using ECP.Download_Errors enumeration and if there are no errors, the application developer can then call for a reboot (also included in the library). If there are errors, the enum “ECP.Download_Errors” lists what the error is (i.e. missing files, fail to download, etc). The display can also be manually power cycled.
- On the next boot, the display will be updated with the new application code.
- Note: This example includes a “WiFi Debug” program. This program allows you to autonomously connect to a wifi network on each boot, so you can debug and write code. When the display is in HOST mode, the USB-C connection to the IDE will not be functional.
Comments
0 comments
Please sign in to leave a comment.