The UDS basic firmware download process is the defined sequence of UDS services to download a new firmware to an UDS bootloader. It is the default sequence support both by emotas UDS bootloader and emotas CAN UpdateManager. Additionally, it is supported by the UDS PlugIn for the CDE.
The following explanation shows examples of the basic download sequence. All CAN-IDs can be configured both in the bootloader and in the tool. The pair 0x7e0 and 0x7e8 is just an example.
The sequence starts with a DiagnosticSessionControl request to enter the programming session.
Security Access is based on a Request Seed – Send Key sequence. If the correct key has been send, access to the requested security level will be granted and the bootloader will allow the execution of additional services.
For development purposes it is sometimes useful just to use a simple key==seed algorithm. Of course, it has to be replaced by a more sophisticated algorithm later on both in the bootloader and also in the tool.
The algorithm can also be integrated into a specific .dll/.so which is used by the tool to calculate the key for a given seed automatically.
RoutineControl can be used to execute various routines. In this sequence “Erase Memory” is used to erase the flash memory before writing a new firmware to it.
The RequestDownload services allows to specify an address and an length of the firmware. Nevertheless, the UDS bootloader only supports a fixed address and rejects Download requests to other addresses.
Multiple TransferData requests will be used to transfer the complete firmware.
This example transfers blocks of 256 bytes of payload (+2 bytes for the UDS protocol itself: Service-ID and block counter).
This service terminates the transfer of the firmware.
This service checks if the download had been successfully.
Finally the reset command will be send to the bootloader and it resets and it will start the application, if everything went well.
In general the bootloader can be adopted to support different download sequences. Additionally emotas can integrate additional download sequences into the CAN UpdateManager on request.