UDS RoutineControl for Erase & UDS Service for Flash

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
Posts: 25
Joined: Tue 28. Apr 2020, 10:09

UDS RoutineControl for Erase & UDS Service for Flash

Post by Shail » Tue 19. May 2020, 09:09


We need to send uds request to erase flash using routing control and flash hex file.

(1) How we can send UDS request to erase flash? What changes require for testRoutineControl API?
(2) To erase the flash we require more time How we need to handle this problem? or It will take care by testRoutineControl API of PCAN UDS Client project?
(3) How we can handle sending the hex file content to ECU for programming? How to handle multiple uds data request?


Software Development
Software Development
Posts: 175
Joined: Mon 9. Sep 2013, 12:21

Re: UDS RoutineControl for Erase & UDS Service for Flash

Post by F.Vergnaud » Tue 19. May 2020, 11:13

Hello Shail,

(1) Please refer to your ECU specifications, it is usually a call to UDS service RoutineControl (with a start command and the standardized "EraseMemory" routineId), but the parameters (a buffer of byte) are specific to your ECU:
  • UDS_SvcRoutineControl(CanHandle, msgReq, PUDS_SVC_PARAM_RC_STR, PUDS_SVC_PARAM_RC_RID_EM_, buffer, buffer_length);
(2) Your ECU will/should respond that it needs more time to process the request. It is a mechanims that is handled by UDS and ISO-TP communication protocols.

(3) Sending hex file is out of the scope of the UDS API, your process should include a way to convert hex file to binary (search for tools like hex2bin for example).
Sending content to an ECU is explained in UDS protocol (please check ISO-14229):
  1. First you need to make a request to download data to your ECU using UDS_SvcRequestDownload.
  2. Then in a loop, make UDS requests to transfer data with UDS_SvcTransferData until all the data are sent (the maximum size of the chunks of data is part of the response to the UDS service RequestDownload).
  3. Finally complete the transfer with UDS_SvcRequestTransferExit.
Best regards,

Post Reply