Cosmic _checksum16() problems
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-12-05 1:28 AM
Posted on December 05, 2013 at 10:28
Hi folks
Couple of questions about the_checksum16()
function. I've kind of got it working, but:- I have to put in an ''
extern int _checksum16(void);
'' declaration of my own - I can't for the life of me find a header file which declares this - It appears that it fails if there's a breakpoint set, presumably because setting a breakpoint modifies the code memory that's being checksummed. Is that expected, and does anyone have a tip for a reasonably safe workaround?
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-12-05 2:12 AM
Posted on December 05, 2013 at 11:12
Hello,
CRC implementation is simple, write your own function and the problem is solved;)Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-12-05 3:03 AM
Posted on December 05, 2013 at 12:03 Hi, the header is correct and the problem you mentioned, that only happens with debug instruments that modify the memory in order to set a bkpt (of course!), is known. As for solutions, nothing magic: either skip the checksum while debugging or use a more powerful debugger/emulator. Regards.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-12-05 6:49 AM
Posted on December 05, 2013 at 15:49
@Argail
Yes, I know CRC is easy to implement, but computing the correct value for the binary image before that image is linked, and then getting the value into program Flash is distinctly non-trivial! @luca Thanks for your prompt response. Which header is correct? I cannot find a .h file supplied with the compiler which declares _checksum16()... Given that ''simple'' debuggers cause a problem, and are probably the most commonly used, it would probably be a good idea to document it in the manual. I spent at least a couple of hours figuring out what was going on, having been used recently to ARM systems which have (a limited number of) hardware breakpoints, and thus don't suffer from this. Best regards JonathanOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-12-05 11:18 PM
Posted on December 06, 2013 at 08:18
Oh sorry, I didn't understand what you wanted to do
