Error when compiling to Hex

Forum for problems or queries regarding the Flowcode application and compiler usage.

Moderators: Benj, Mods

Post Reply
jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

Error when compiling to Hex

Post by jadiflow »

Hi,

I receive an error when compiling to hex:

/quote
C:\.....\G2\quad G2-2.c(1174): error: missing semicolon
C:\.....\G2\quad G2-2.c(1174): error: failure

failure

Return code = 1

Flowcode was unable to compile the flowchart's C code due to the following errors:

If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.
/unquote

It compiles to C without errors.

Edit: This is the offending line (the 'void... is line 1175)

//Supplementary implementations


void main()
{

I can mail the source to tech support, but would prefer not to post here.

Thanks in advance,

Jan Didden

jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

Re: Error when compiling to Hex

Post by jadiflow »

Hi,

I have isolated the problem to a single C statement. If it is in, I get the error described above. If it is out, it compiles to HEX without errors. The statement is:

#pragma DATA 0x2100, 0x12, 0x34, 0x56, 0x78 ;

to preset some eeprom memory locations.

What am I doing wrong here??

Jan Didden

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: Error when compiling to Hex

Post by Benj »

Hello Jan

The ; at the end of the line of C code is not required. Hopefully this should fix your problem.

jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

Re: Error when compiling to Hex

Post by jadiflow »

Unfortunately, it doesn't. Same error.
If I enclose the statement in curly braces before/after, the error is: 'missing right parenthes'

Jan Didden

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: Error when compiling to Hex

Post by Benj »

Hello Jan

Which chip are you trying to compile to?

jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

Re: Error when compiling to Hex

Post by jadiflow »

16F865

Jan Didden

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: Error when compiling to Hex

Post by Benj »

Hello Jan

The 16F865 is not supported by Flowcode. Is this chip name correct?

jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

Re: Error when compiling to Hex

Post by jadiflow »

Errr..... 16F685 :-(

Jan Didden

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: Error when compiling to Hex

Post by Benj »

Hello Jan

Place the code into the defines section of the supplementary code window rather then inside a C code block.

jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

Re: Error when compiling to Hex

Post by jadiflow »

Hello Ben,

Sorry for the delay in replying; I have been on a vacation.
Indeed, placing the #pragma for the EEPROM preset in an AddDefines component gets rid of the error message.

Thanks,

Jan Didden

jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

Re: Error when compiling to Hex

Post by jadiflow »

Hello again Ben,

So now I have an AddDefines macro at the start of my program, to enable the AddDefines 'component'.

There are two defines, for the purpose of presetting the EEPROM contents at the moment of downloading the hex code into the 16F685:
#pragma DATA 0x2100, 0x55
#pragma DATA 0x2110, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96

The values do, however, not show up in the EPROM component window when I simulate the flowchart.
I'm not sure whether it is implemented that way though; it only would seem logical to me that it would appear.
Subsequently in the program I read these preset locations and take actions accordingly.
It works when I manually preset these EEPROM locations before the sim.

Can you enlighten me?

Thanks,

Jan Didden

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

Re: Error when compiling to Hex

Post by Steve »

Flowcode does not simulate code in the C icons, "AddDefines" component or the "Supplementary Code" window.

jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

Re: Error when compiling to Hex

Post by jadiflow »

Steve, thanks. Are you guys considering to implement it in a future version?

Jan Didden

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

Re: Error when compiling to Hex

Post by Steve »

Accurately simulating all C code would be quite tricky, but I can see that implementing certain bits could be beneficial and fairly easy (e.g. the "#pragma data" statements).

So yes - I'll look at allowing you to preset the EEPROM values within the simulation for v4.

jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

Re: Error when compiling to Hex

Post by jadiflow »

Sterling! Thanks,

Jan Didden

Post Reply