- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In most time I have more than 2 boards(pcb). Each board containing one PSoC. I want to know perticular software version running on perticular board (pcb). I think best way is to read checksum and dump through UART. If the checksum is of old pogram then only I update PSoC. If there will be some modification in program file checksum will be automatically changed.
I want to know :
1. how to read checksum in main.c so that I dump it through UART?
2. Is there any better solution to keep tag software version info on PSoC?
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. how to read checksum in main.c so that I dump it through UART?
You could calc checksum of program memory with a simple utility.
http://www.geeksengine.com/article/checksum.html
2. Is there any better solution to keep tag software version info on PSoC?
Yes, burn a version number into EEPROM by using EEPROM component.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ Dana,
Pls correct me if any mistake.
1. how to read checksum in main.c so that I dump it through UART?
Yes checksum may be calculated for every modification using given utility. But it will be manullay updated in main.c every time.
2. Is there any better solution to keep tag software version info on PSoC?
Yes, EEPROM may be a good option but this is useful in case of final release. Also I think you need to update version info manullay in EEPROM. (Some time it may happen I forgot to update version. That's why I think checksum may be good and it will automatically update whenever changes happen)
Regards, Pratik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With 2) this does not have to be manual, everytime main() starts up
run chksum utility and write EEPROM to update. In fact you could collect
a history inside EEPROM automatically.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is interesting. Can you provide some more info about this?
Regards, Pratik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Home page Creator, "Find Example Projects", there is a project for using
EEPROM.
Basically call the checksum routine each time you start up, and then look
at EEPROM to see if its the same, if not use a ptr stored in flash and write
to that location, of just scan EEPROM area used for this purpose for first
blank entry.
You could use RTC to date/time stamp the entry in EEPROM.
Use a structure for use in your writes to EEPROM, eg, new checksum, ptr
update, date, time etc..
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't understand about checksum routine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was referring to your original post thats how you determine
SW version.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think PSoC creator already generates checksum for every hex file . That's why PSoC progrommer shows checksum for hex file.
Is there any method to read this checksum in main.c instead of using utility in main?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nerver tried that but there are information about the checksum of PSOc
1. On section 3 of the psoc5 device programming manual. There are information of the checksum validation of the PSOC5.
2.Section 44 nonvolatile memory programming of PSoC 5 TRM does some information as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ H L
As I understand from PSoC® 5 Device Programming Specifications.
Target device (i.e. PSoC) has checksum at data register address = 32’h40004720, data = lower 2 bytes.
I tried to read this data register in main using :
uint32 check = CY_GET_REG32(0x40004720);
and I got check = 131072.
but checksum form PSoC programmer (for PSoC) = 0xC321.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the checksum is lower 2 bytes, a 16 bit checksum, then when you
read 32 bit register you need to mask off upper 16 bits ?
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ Dana
uint32 131072 = 0x20000
lower 16 bit = 0x0000.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did the checksum get calculated ?
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ Dana
No, lower 16 bit is not matched to actual checksum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually programming PSoC with different hex file does not change lower 16 bit of data register ( data = 0x0000).