When the device has been programmed, a checksum is stored in 0x90300000. How do you access this location (using a microcontroller read in run-time) as a normal flash read operation seems to crash the system

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
simcc_1526081
Level 1
Level 1

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 

0 Likes
1 Solution
GyanC_36
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

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

View solution in original post

0 Likes
4 Replies

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

0 Likes
GyanC_36
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

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

0 Likes