Page 1 of 1

Config Settings Checksum Error

Posted: Wed May 23, 2018 10:55 pm
by sptcarl
So FC8 is released and I still can't get FC7 to work 100%!
I program PICs using the TL866 Universal programmer, but hex code generated by FC7 with XC8 compiler, the programmer software reports a mismatch of the config checksum. Of course I can get round this by either telling the programmer software not to verify, or by telling Flowcode not to write the config file.
I can load the same flowcode project in V6 with the same config settings and use the same programmer, and all is fine. Using a completely different computer produces the same results.

Could anyone shed some light on this please? Does anyone else have the same problem (I did notice someone mentioned it briefly in a post here once)
I can only assume its either an FC7 or XC8 problem and every other type of programmer doesn't verify the checksums.

Thanks in advance for any suggestions.
Carl.

Re: Config Settings Checksum Error

Posted: Thu May 24, 2018 6:43 am
by Steve
Please post the "good" HEX file from V6 and the "bad" HEX file from V7 and I will have a look.

Also, please tell me what chip you are using and what configuration settings you have set (in both V6 and V7).

Re: Config Settings Checksum Error

Posted: Thu May 24, 2018 11:59 pm
by sptcarl
Hi Steve, thanks for offering to look into this.

I have simplified my example to be just the basic 1 second flasher, and the results are still the same.

I use PIC16F887 Frequency set at 8Mhz (I really need to test it with a completely different type of chip I guess)
Configurations for both versions as in the attached image.

The config word produced by FC on both versions is 0x23e2 but when loaded in the programmer, with the V7.hex file it gets changed to 0xe3e2, yet the configuration checked bits remain correct.

Thanks,
Carl.

Re: Config Settings Checksum Error

Posted: Fri May 25, 2018 9:06 am
by Steve
Thanks, Carl.

I've looked into this and have replicated it, but it seems to be an issue with the XC8 compiler itself rather than Flowcode, because the C code generated for the configuration data is identical in Flowcode v7 and Flowcode v8. We have updated the compiler toolchain so I suspect the problem is there.

This makes it a little more tricky for us to solve. I'll continue investigating it.

However, I think it should not affect the running of the program on the target and you can probably ignore that message on programmer software.

Regards,
Steve.

Re: Config Settings Checksum Error

Posted: Fri May 25, 2018 10:02 am
by Steve
Hi Carl.

I've looked into this without success. It doesn't look like there should be an issue as the top two bits of CONFIG1 are not programmable and should be ignored by the programmer software (if you ignore these top two bits, 0x23e2 is equal to 0xe3e2).

But 2 further thoughts have struck me:

1) Maybe it is a bug in the programmer software itself and it is not ignoring these top two bits?

2) It could have something to do with the LVP bit. The LVP bit (bit 12 of CONFIG1) can only be set to 0 (i.e. to turn low voltage programming off) if a high voltage level is applied during reprogramming.

However, the fact that a config mismatch does not occur when sending 0x23e2 (which also sets LVP to 0) means it must be to do with the top two bits. So we should discount (2) above.

Therefore, it's either the XC8 compiler or the programmer software. I suspect it's XC8 because I've been able to 'fix' the problem by editing the "16f887.cfgdata" file in the XC8 compiler toolchain by changing the line:

Code: Select all

CWORD:2007:3FFF:FFFF:CONFIG1
to:

Code: Select all

CWORD:2007:3FFF:3FFF:CONFIG1
And this seems to generate a HEX file containing 0x23e2 instead of 0xe3e2, which should fix your issue.

Re: Config Settings Checksum Error

Posted: Fri May 25, 2018 11:26 pm
by sptcarl
Thanks Steve,

I edited the .cfgdata file as you suggested and yes, once I had done the same for CONFIG2 too, it "fixes" it.

I mostly only use the F887 (and F886) so that will keep me happy for now.

So one issue solved, I just need to figure out now why some of my FC6 creations will not compile with FC7. Think I'll leave that for another day!

thanks again,
Carl.