Preprocessing error
Moderator: Benj
Preprocessing error
Hi all,
I have just transferred a working program from a PIC16F886 to a PIC16F1827.
I now get these errors:
"EEPROM Error MX_EEADR not set"
"EEPROM Error MX_EEDATA not set"
Any ideas please?
Dave.
I have just transferred a working program from a PIC16F886 to a PIC16F1827.
I now get these errors:
"EEPROM Error MX_EEADR not set"
"EEPROM Error MX_EEDATA not set"
Any ideas please?
Dave.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Preprocessing error
Hello Dave,
Please bear with me and I will see if I can fix this for you tomorrow.
Please bear with me and I will see if I can fix this for you tomorrow.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Preprocessing error
Hello Dave,
I've just had a go at compiling the EEPROM for the 16F1827 device and it is working fine here. What version of v4 are you using?
I've just had a go at compiling the EEPROM for the 16F1827 device and it is working fine here. What version of v4 are you using?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Preprocessing error
Ben,
I have tested for this issue.
My findings are, if you just create a new flowchart using 16F1827 issue is not there.
If you create a Flowchart using EEPROM for 16F88 target for example, then compile to check all is ok.
If you then change target to 16F1827, then recompile, you get errors Dave has
Stated.
Martin
I have tested for this issue.
My findings are, if you just create a new flowchart using 16F1827 issue is not there.
If you create a Flowchart using EEPROM for 16F88 target for example, then compile to check all is ok.
If you then change target to 16F1827, then recompile, you get errors Dave has
Stated.
Martin
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Preprocessing error
Hi Dave/Ben
This time I created a new Flowchart by selecting 16F1827, and error is there from the start. Not sure why error was not there when tried from the first time, so changing from one target device to 16F1827 could have been a red herring?
The good news is I managed to successfully compile since is same issue as:
http://www.matrixmultimedia.com/mmforum ... 11&p=21395
After editing code as suggested.
Martin
This time I created a new Flowchart by selecting 16F1827, and error is there from the start. Not sure why error was not there when tried from the first time, so changing from one target device to 16F1827 could have been a red herring?
The good news is I managed to successfully compile since is same issue as:
http://www.matrixmultimedia.com/mmforum ... 11&p=21395
After editing code as suggested.
Martin
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Preprocessing error
If you get stuck, this is how to do suggested fix that Ben posted for a different target device.
1)Highlight and Copy the following code:
2) Make sure panel properties is selected in the View menu.
3) On panel properties select EEPROM(0) then click on dots next to custom code.
4) Select EEPROMRead, then Click Edit code
5) Highlight lines 1 to 24 then just use paste to over-right original code with copied code above.
Clock OK then Close. Now recompile.
Hope that helps.
Unless a permanent fix is found today of course.
What has got me puzzled is how comes Ben's Flowchart has not got same error as us?
Maybe there is an update we missed out on?
Ben, as a test I created a flowchart with just a write to eeprom component.
Martin
1)Highlight and Copy the following code:
Code: Select all
char data = 0;
#ifdef _BOOSTC
#ifdef MX_EE
#ifndef MX_EEADR
#ifdef EEADR
#define MX_EEADR eeadr
#endif
#endif
#ifndef MX_EEDATA
#ifdef EEDATA
#define MX_EEDATA eedata
#endif
#ifdef EEDATAL
#define MX_EEDATA eedatal
#endif
#endif
3) On panel properties select EEPROM(0) then click on dots next to custom code.
4) Select EEPROMRead, then Click Edit code
5) Highlight lines 1 to 24 then just use paste to over-right original code with copied code above.
Clock OK then Close. Now recompile.
Hope that helps.
Unless a permanent fix is found today of course.
What has got me puzzled is how comes Ben's Flowchart has not got same error as us?
Maybe there is an update we missed out on?
Ben, as a test I created a flowchart with just a write to eeprom component.
Martin
Last edited by medelec35 on Thu Oct 20, 2011 8:36 am, edited 1 time in total.
Martin
- Steve
- Matrix Staff
- Posts: 3431
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: Preprocessing error
I saw this yesterday and I thought it seems strange. Flowcode should reload the component C code that is appropriate for the chip whenever the target chip changes. Clearly this is not happening due to your description above.medelec35 wrote:Ben,
I have tested for this issue.
My findings are, if you just create a new flowchart using 16F1827 issue is not there.
If you create a Flowchart using EEPROM for 16F88 target for example, then compile to check all is ok.
If you then change target to 16F1827, then recompile, you get errors Dave has
Stated.
Martin
There is one exception where the component C code is not replaced and that is when the flowchart uses the "customize C code" feature of the component. In this case, the customizations in the C code are retained between chip changes. And if these customizations are specific to a particular chip, then it may not work on another chip.
Perhaps this is what is happening?
Re: Preprocessing error
Hi Steve, Martin, Ben,
I have repeated Martins experiment. Opened a new project with just write Eeprom macro. Write to address 0, 0x55.
Compiler gives errors as in OP.
Changing Pic was probably irellevant. I have not touched the "customise C code".
I noticed that the error message is different in this case to the one in the suggested fix. I get:
"EEPROM Error MX_EEADR not set"
"EEPROM Error MX_EEDATA not set"
The suggested fix was for:
Illegal redefinition of symbol: MX_EEADR
Illegal redefinition of symbol: MX_EEDATA
Does this make a difference?
I have repeated Martins experiment. Opened a new project with just write Eeprom macro. Write to address 0, 0x55.
Compiler gives errors as in OP.
Changing Pic was probably irellevant. I have not touched the "customise C code".
I noticed that the error message is different in this case to the one in the suggested fix. I get:
"EEPROM Error MX_EEADR not set"
"EEPROM Error MX_EEDATA not set"
The suggested fix was for:
Illegal redefinition of symbol: MX_EEADR
Illegal redefinition of symbol: MX_EEDATA
Does this make a difference?
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Preprocessing error
Hi, Dave,
I tried your code and got
Test.c(98): Illegal redefinition of symbol: MX_EEADR
Test.c(109): Illegal redefinition of symbol: MX_EEDATA
2 errors detected
Error: preprocessing error
failure
Return code = 1
Edited custom code the way I described and compiled OK with no errors.
I have attached modified flowchart for you to try
Martin
I tried your code and got
Test.c(98): Illegal redefinition of symbol: MX_EEADR
Test.c(109): Illegal redefinition of symbol: MX_EEDATA
2 errors detected
Error: preprocessing error
failure
Return code = 1
Edited custom code the way I described and compiled OK with no errors.
I have attached modified flowchart for you to try
Martin
- Attachments
-
- Test_Mod Code.fcf
- (7 KiB) Downloaded 291 times
Martin
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Preprocessing error
Hi Dave,
If you have not already done so then I would advise you update to v4.5 of Flowcode as this should then allow you to compile correctly or at least get the same error as Martin is reporting.
If you have not already done so then I would advise you update to v4.5 of Flowcode as this should then allow you to compile correctly or at least get the same error as Martin is reporting.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Preprocessing error
Success!
I upgraded to v4.5 and got the same error messages as Martin.
Martin's Test_Mod code compiles fine.
Modified my Test code as per Martin's instructions, compiles ok.
Modified my work in progress file the same, compiles ok.
I guess this mod will be added on the next upgrade?
Thanks very much for all of your help, much appreciated.
Dave
I upgraded to v4.5 and got the same error messages as Martin.
Martin's Test_Mod code compiles fine.
Modified my Test code as per Martin's instructions, compiles ok.
Modified my work in progress file the same, compiles ok.
I guess this mod will be added on the next upgrade?
Thanks very much for all of your help, much appreciated.
Dave
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Preprocessing error
Your welcome Dave.
But to be honest, it’s all down to Ben’s solution.
If he did not post solution, I would have not been able to help.
Thanks Ben.
Martin
But to be honest, it’s all down to Ben’s solution.
If he did not post solution, I would have not been able to help.
Thanks Ben.
Martin
Martin
Re: Preprocessing error
Ah, but you found it for be in amongst the hundreds of pages............medelec35 wrote:Your welcome Dave.
But to be honest, it’s all down to Ben’s solution.
If he did not post solution, I would have not been able to help.
Thanks Ben.
Martin

Thanks to Ben as well.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Preprocessing error
Hello,
Cheers for your support guys just doing my job
Yes this will be fixed in the next update.
Cheers for your support guys just doing my job

Yes this will be fixed in the next update.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel