cancel
Showing results for 
Search instead for 
Did you mean: 

STM8S207SB checksum fails with cosmic compiler

hjs
Associate II
Posted on April 18, 2016 at 14:20

Hi!

I just tried to verify the FLASH according to CLASS B considerations. I followed the manual by using -ck for .text and -ik (.checksum area) flags for the linker,

The descriptor is inside the s19 file, the map file shows 10 bytes as expected. My codesize is around 64k (I did not check lower sizes, but exceeding 64k boundary). I have to use the long stack model for my code.

All _checksum/_checkCRC functions fail (result is not zero). 

I do not use breakpoints (I read the hint in one post), but it still does not work. 

The descriptor area starts at 0x18b96, code area at 0x9528-0x18b96.

I tried Cosmic 4.3x and 4.4x (dongle license). No luck.

What could be the reason for that?

Best regards,

HaJo
3 REPLIES 3
jdf25252
Associate II
Posted on April 19, 2016 at 16:38

HaJo

I had issues when first using the checksum routines.  Turns out Cosmic had problems in some earlier versions of the compiler package.  V4.3.12 or newer has these issues corrected. I am using ''ckcrc161()'' and it correctly (now) calculates the crcc in extended memory.

jdf

hjs
Associate II
Posted on April 19, 2016 at 18:05

Hi John!

Are you using ckcrc161.s ''directly'' or _checkcrc16() (inside libisl.sm8, which should be the same)? By the way, _checkcrc16 crashes here, _checkcrc16x() does not crash.

Could there be an issue with the libfiles or compiler flags (far library calls)?

HaJo

hjs
Associate II
Posted on April 21, 2016 at 14:00

[SOLVED]

Fixed by cosmic support (updated linker)!

1. Descriptor section has to be in lower 64k area. So now my ''.cksum... -ik'' is in front of the other sections (.const and .text) at 0x8080, not behind .text.

2. It only works (in my case) with a modified linker.

3. The crashes were the result of the activated watchdog running out (in case of CRC16 check).

Best regards,

HaJo