Preprocessing error

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Has thanked: 12 times
Been thanked: 5 times
Contact:

Preprocessing error

Post by Dave S »

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.

User avatar
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

Post by Benj »

Hello Dave,

Please bear with me and I will see if I can fix this for you tomorrow.

Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Preprocessing error

Post by Dave S »

Ok, thanks Benj.

User avatar
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

Post by Benj »

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?

Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Preprocessing error

Post by Dave S »

v4.3.7.63

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Preprocessing error

Post by medelec35 »

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
Martin

Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Preprocessing error

Post by Dave S »

That's it exactly Martin. I want to just use a different Pic. Hopefully I don't need to start a new project with the 16F1827 and rewrite all of the code again.

Dave.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Preprocessing error

Post by medelec35 »

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
Martin

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Preprocessing error

Post by medelec35 »

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:

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
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
Last edited by medelec35 on Thu Oct 20, 2011 8:36 am, edited 1 time in total.
Martin

User avatar
Steve
Matrix Staff
Posts: 3426
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Preprocessing error

Post by Steve »

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
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.

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?

Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Preprocessing error

Post by Dave S »

Hi Steve, Martin, Ben,

I have repeated Martins experiment. Opened a new project with just write Eeprom macro. Write to address 0, 0x55.
Test.fcf
(4 KiB) Downloaded 272 times
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?

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Preprocessing error

Post by medelec35 »

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
Attachments
Test_Mod Code.fcf
(7 KiB) Downloaded 269 times
Martin

User avatar
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

Post by Benj »

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.

Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Preprocessing error

Post by Dave S »

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

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Preprocessing error

Post by medelec35 »

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
Martin

Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: Preprocessing error

Post by Dave S »

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
Ah, but you found it for be in amongst the hundreds of pages............ :)

Thanks to Ben as well.

User avatar
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

Post by Benj »

Hello,

Cheers for your support guys just doing my job :D

Yes this will be fixed in the next update.

Post Reply