Improvement to Rpmsg library to get firmware checksum

Based on my experience with VF61 I would suggest an improvement to Rpmsg library.

I was thinking to a new configuration parameter to get the checksum of the firmware file.

Rpmsg_GetConfigInt (HANDLE  hRpmsg, "FileChecksum", DWORD * pValue);

In this way the checksum (MD5, …) can be compared against the expected one and if they don’t match I can skip the call to Rpmsg_Open().

In this way it’s possible to show messages to the customer.
Otherwise, if the firmware is wrong and/or corrupted, most of the time after Rpmsg_Open() the A5 core crashes and the customer can’t understand what happened.

Dear @vix

Thank you for the suggestion.

In my opinion the approach is of limited use. It would allow to only verify the M4 firmware file, ignoring that your WinCe application or any related DLL and data file could be corrupted in a similar way.

What you should do instead is to use a CRC / hasing algorithm to verify every relevant file. Simple implementation examples for CRC algorithms can be found easily in the web.