Page 1 of 1

XC8 crash on I2C RTC component ECIO40

Posted: Thu May 11, 2017 12:21 pm
by beanie
HI Guys,

I've got an issue when i try to compile the attached software, the compiler boots and gets as far as

Employing 18F4455 errata work-arounds:
* Corrupted fast interrupt shadow registers
* No stopping on H/W breakpoints after NOP2
Doha MK2 Vb test.c:
136: #define MX_I2C_CAL_I2C1::STOPDEL_1 (1)
^ (111) redefining preprocessor macro "MX_I2C_CAL_I2C1" (Doha MK2 Vb test.c: 135) (warning)
137: #define MX_I2C_CAL_I2C1::CHANNEL_1 (1)
^ (111) redefining preprocessor macro "MX_I2C_CAL_I2C1" (Doha MK2 Vb test.c: 135) (warning)


At this point i get a popup windows with p1.exe has stopped responding, I know this is part of the XC8 toolchain, but I have no idea how to get round this.

Any help would be greatly appriciated as I really need to get this part flow in the next couple of days.

Cheers

Matt

Re: XC8 crash on I2C RTC component ECIO40

Posted: Thu May 11, 2017 1:10 pm
by Benj
Hi Matt,

Just tried the program here and it's compiling correctly for me. Can you tell us exactly what version of Flowcode 7 you're using. You can find out by clicking on Help -> About Flowcode. If you're not using the latest release then it might be worth updating to ensure your using the latest components and bug fixes.

I'm not even getting the warnings you reported so something must be different.
Employing 18F4455 errata work-arounds:
* Corrupted fast interrupt shadow registers
* No stopping on H/W breakpoints after NOP2

Memory Summary:
Program space used 2B4Ah ( 11082) of 5800h bytes ( 49.2%)
Data space used 76h ( 118) of 800h bytes ( 5.8%)
Configuration bits used 7h ( 7) of 7h words (100.0%)
EEPROM space used 10h ( 16) of 100h bytes ( 6.2%)
ID Location space used 0h ( 0) of 8h bytes ( 0.0%)
Data stack space used 0h ( 0) of 779h bytes ( 0.0%)
Before you do update it might be worth posting your generated .C file here and then I can compare it with my .C file and see what the differences are.

Re: XC8 crash on I2C RTC component ECIO40

Posted: Thu May 11, 2017 1:16 pm
by beanie
thats odd, he's the C

im running FC 7.2.1.4 with XC1.41

Re: XC8 crash on I2C RTC component ECIO40

Posted: Thu May 11, 2017 1:23 pm
by Benj
Hi Matt,

Thanks for the file, I thought I was going a bit crazy then the files were so different.

Then I noticed that you C file is saying v6.1.2?
CDiff.jpg
CDiff.jpg (94.42 KiB) Viewed 6814 times

Re: XC8 crash on I2C RTC component ECIO40

Posted: Thu May 11, 2017 1:25 pm
by beanie
just checked an re-upladed the correct file, them two should be massively different, sorry pal

Re: XC8 crash on I2C RTC component ECIO40

Posted: Thu May 11, 2017 2:57 pm
by Benj
Perfect thanks Matt,

Looks like the compilation error is coming from the defines of the RTC component. There is a slightly newer version of the component here that looks to have fixed the problem.

viewtopic.php?f=63&t=18876

Let me know how you get on and if this solves it for you then I'll add this to the main updates archive.

Re: XC8 crash on I2C RTC component ECIO40

Posted: Fri May 12, 2017 9:26 am
by beanie
Hi Ben,

That sorted the compilation error cheers. However using an ECIO40 I2C channel with these routines (initialise(), GetDate(), time, etc) the code locks up after initialise and before the the first register value from the DS3231 is returned. I've scoped B0 and B1 and nothing looks to be coming out of the micro, both lines are held up with 4K7s and the clock is the only component on the bus.

Any thoughts?

Re: XC8 crash on I2C RTC component ECIO40

Posted: Mon May 15, 2017 11:30 am
by Benj
Hmm, Have you tried the software I2C channel. That should work correctly.

I'll see if I can replicate this here and work out what's going wrong with the hardware I2C channel on the ECIO40P device.

Re: XC8 crash on I2C RTC component ECIO40

Posted: Mon May 15, 2017 7:18 pm
by Steve001
Hi Ben

Not sure if this is relevant or not. I have had problems have been playing with johns post with an ECIO40P

viewtopic.php?f=29&t=8607

Thought it was me doing something wrong

Steve