- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to check the contents of the user programmable flash on startup as a basic integrity check.
The plan was to perform a 32-bit checksum on the contents and compare the 2 LS Bytes to the value that is supposed to be stored in 0x90300000 (This is entered during the programming phase). When I try to read this location using a normal flash pointer read, the system crashes as I am obviously performing an illegal operation.
1) Doe anyone know how I should go about this operation OR
2) Does the processor check the contents of the flash on startup and I don't need to do this
Many thanks
Simon
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Simon,
This location (0x90300000) is not accessible in application. This is the location for checksum in Intel Hex File. During the programming process (or checksum verify process) PSoC programmer sends SWD command to PSoC device to calculate the flash checksum and return the calculated value and then compares it with the hex file checksum (at 0x90300000 location).
-Gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may define
uint16 * ChkSum = 0x90300000;
and later use *ChkSum to access its data
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
Thanks for the response. The compiler does not like the code and states
incompatible integer to pointer conversion initializing 'uint16_t (aka 'unsigned short*) with an expression of type 'unsigned int'
The original code that I had written before I posted for help casted the pointer as:
uint16_t *checksumLoc = (uint16_t *)0x90300000;
and accessed by:
uint16_t calcCypressChecksum = *checksumLoc;
This compiles fine but the system crashes when it is executed and a reset occurs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Simon,
This location (0x90300000) is not accessible in application. This is the location for checksum in Intel Hex File. During the programming process (or checksum verify process) PSoC programmer sends SWD command to PSoC device to calculate the flash checksum and return the calculated value and then compares it with the hex file checksum (at 0x90300000 location).
-Gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Gyan
That explains a lot!
Thank you for your help in clarifying this matter
Simon