I would like to ask for your advice regarding the correct HEX file format.
The application scenario is as follows: The customer has a batch of smart card chips that have already been programmed with code. These chips are based on the 8051 platform (em Tg132-5).
Now the customer wants to return these chips to the bootloader state, so they need to erase the COS program inside them.
Due to personnel turnover and loss of documentation, the customer does not know the erase command or the password. Fortunately, the customer has the APDU programming script for this program, which was generated from the HEX file.
My idea is to convert the APDU script back into a HEX file, then load this HEX file into Keil's debug mode, and use single-step tracking and debugging to find the erase command and password.
I have now completed the conversion from APDU script to HEX file. However, when I try to load the HEX file into Keil, it reports an error:
*** error 61: illegal hex module
I compared the HEX file generated by Keil with my converted HEX file. The main difference in the conversion results lies in the handling of "22FF" and "22FFFF".
I have observed that Keil sometimes ignores (discards) FF bytes, and other times it keeps them. I don't know when to discard FF and when to keep them.
Could you please give me some suggestions and help? Thank you!
Moved question to Keil forum