VTOS Firmware File Patching
VTOS Developer includes a new feature to patch firmware files. The patching process enables a user to modify board specific data that is used by VTOS firmware. The user can modify items such as which UART to use for PC to Target communications and update Pin Mux Settings. The new feature was released in 18.104.22.168 and later releases.
VTOS firmware releases for the following micro-controllers and processors include this feature:
- STM32 L1
The feature is being added to supported micro-controllers and processors as needed by customers. Please contact us if you would like to see this feature for your micro-controller, processor, or SoC.
Firmware File Patch
To access the firmware file patch feature, launch VTOS Developer and select the menu option Tools | Firmware File Patch. Please note that this menu option only appears for Projects that are using a supported processor family. Selecting this option will bring up the Patch Firmware File dialog.
The steps needed to patch firmware files are as follows:
- Select UART, Rx, and Tx options.
- [Optional] Select a Pin Mux File.
- Click on Patch
After Patch is clicked on, VTOS Developer will patch the firmware files for every task in your Project, as well as patching the Unified firmware files if they are provided for your micro-controller or processor. The process will always use the released firmware images as input and then generate updated firmware images which are copied to your project folder. The patched firmware images can be found in %KOZIO_HOME_3%\projects\YOUR-PROJECT.
This step will produce a number of new firmware files with these extensions:
- ELF – A patched version of the released VTOS firmware Executable and Linkable Format (ELF) file.
- BIN – A patched version of the released VTOS firmware binary executable file.
- SREC – A patched version of the released VTOS firmware SREC executable file. The SREC format was created by Motorola in the 1970s.
Anytime you make changes to the UART being used on your Target circuit board design, or alter Pin Mux File settings, you will need run the Patch utility again and download the newly created files.
This new feature provides the user with the ability to select which Target UART to use for communications, as well as specifying which Rx and TX pins are used by that UART. Providing this feature allows the user to alter the VTOS Firmware on their own. This feature also reduces the number of files Kozio has to release to support the various permutations of UART/Rx/Tx combinations.
The UART options presented to the user are based on the processor family and processor model chosen for your Project. You should select the UART that you have enabled on your circuit board design and the one that has a cable connected from your PC to your Target.
The Rx and Tx options presented are based on the UART you have chosen. Some UARTs only have one choice, while others have multiple choices. This choice is specific to your circuit board design.
VTOS Developer includes the option of automatically downloading a new firmware image when Connect is selected. The Load Firmware on Connect option is chosen by selecting the Project node in the configuration tree and then clicking on the Load Firmware on Connect field. You must also chose a Target Loader option. The Target Loader option is chosen by clicking on the enabled Fixture (the one highlighted in green) and then clicking on the Target Loader parameter.
Note: This option requires that you have the appropriate hardware adapter connected to your target.
By using this feature, you can patch new firmware images and Connect to validate that the firmware image is working properly. If the patch was successful, and your image matches your UART configuration, you will see VTOS Firmware version information printed to the Console after Connect is clicked.
Example: VTOS STM32L1XX ScanCore Firmware
Pin Mux Settings Update
This new feature provides the user with the ability to embed Pin Mux Settings into your VTOS firmware file. When the VTOS firmware image includes pin mux settings, those settings are used when VTOS first boots. Using this feature allows you to specify pin mux settings without having to Connect and download new settings. If you do Connect and download new settings, the new settings will override the patched settings. Using embedded pin mux settings is also much faster than downloading them.
This feature is optional. If the Pin Mux File text box is empty, then no pin mux settings are embedded into your patched firmware files. To embed new settings, click on the Browse button and select your pin mux file. If this file is not already in your project, it will be copied to your Project folder.
For STM32 designs, two commands are accepted and processed from a pin mux file, the “pad_mux.set” and “gpio.write” commands. The case is ignored, so uppercase and lowercase are both accepted. These commands must be on separate lines. You must also use the “pad_mux.set” command before a “gpio.write” in order to set the GPIO select state (as an input or output pin).
For example, on an STM32 design:
#STM32_GPIOF 0 #STM32_GPIO_MODE_OUTPUT_PP #STM32_GPIO_NOPULL #STM32_GPIO_SPEED_FREQ_VERY_H #STM32_GPIO_AF0_SWJ pad_mux.set
1 #STM32_GPIOF 0 gpio.write
Any time you launch VTOS Developer or open your Project, VTOS Developer will check to see if a new patch is required. If new firmware image files were released, which happens when you run the latest VTOS Tools Installer, you will be prompted with a message similar to the following.
You must patch your files again to start using the newly released firmware files. If you select No, you will continue to use an older release of VTOS firmware. If you select Yes, you will be presented with the Patch Firmware File dialog as previously described. If this is the first time you are using this release, it means that you must patch VTOS firmware files to begin using this new feature.