Compile to chip error

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

Moderators: Benj, Mods

Post Reply
icabjeff
Posts: 34
Joined: Thu Jul 27, 2006 11:00 pm
Location: Newton, NJ, USA
Contact:

Compile to chip error

Post by icabjeff »

Is there an easy way to find syntax errors in my flowchart. Or could it be in the code for simulated hardware. I'm using switches and a sensor interface. Here is the error report.

File name: F:\multi-click_axiss1-s4copy4.c
Generated by: Flowcode v3.2.2.40
Launching the compiler...

C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\boostc.pic16.flowcode.exe -v -t PIC16F877A "multi-click_axiss1-s4copy4.c"

BoostC Optimizing C Compiler Version 6.70 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2007 Pavel Baranov
Copyright(C) 2004-2007 David Hobday

Licensed to FlowCode User under Single user Pro License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited


multi-click_axiss1-s4copy4.c
Starting preprocessor: "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\pp.exe" F:\multi-click_axiss1-s4copy4.c -i "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\include" -d _PIC16F877A -la -c2 -o multi-click_axiss1-s4copy4.pp -v -d _BOOSTC -d _PIC16


.

F:\multi-click_axiss1-s4copy4.c(764): error: missing right paren
F:\multi-click_axiss1-s4copy4.c(764): error: missing semicolon
F:\multi-click_axiss1-s4copy4.c(764): error: missing right paren
F:\multi-click_axiss1-s4copy4.c(600): 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.

FINISHED

Thank you, Jeff

chevy6600
Flowcode V4 User
Posts: 115
Joined: Fri Feb 22, 2008 6:38 pm
Contact:

Re: Compile to chip error

Post by chevy6600 »

Hi icabjeff, i`m no expert but i was browsing through this forum as i have a problem in another thread that i`m hoping that someone will help with so i know what it`s like when your stuck and your left hoping that your problem will get sorted.

Any way back to your problem, i believe what is happening is that you have a `C` code component/macro inserted amongst all the other components/macros which make up your program, you can only put text in this `C` code component in the form and function of the `C` language and this uses semicolon`s and parenthesis. So if you were inputting some `C` code the semicolon is likely to be missing off the end of each text line. But if you have not been entering `C` code i think you might of selected the wrong component to input program text. If this is the case maybe you needed the `calculation` macro, this is the one that has 2 black horizontal lines on.
I have made this mistake a couple of times.
forgive me if i am stating the obvious to you but i do not know how knowledgeable you are with this programming lark.
best of luck though.

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

Re: Compile to chip error

Post by Steve »

If you have a look at the generated multi-click_axiss1-s4copy4.c file at or around line 764, you should see the problem and be able to trace it back to the relevant part of your Flowcode program.

If you can't find it, you can post your C file (and/or your FCF file) and we'll have a look at it here.

icabjeff
Posts: 34
Joined: Thu Jul 27, 2006 11:00 pm
Location: Newton, NJ, USA
Contact:

Re: Compile to chip error

Post by icabjeff »

I need help finding my errors. When I look through the code I'm not sure what line number I'm on. Are blank lines couted? Can you take a look. I will post the code here.
Thanks, Jeff
multi-click_axiss1-s4copy4.fcf
(23.67 KiB) Downloaded 508 times

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

Re: Compile to chip error

Post by Steve »

Hi Jeff,

The line which produced the error was the "aaaaaaaaaaaaaaaaaaaaaaaaa" decision icon (the first decision icon int he main flowchart). You had this:

Code: Select all

SWITCH1 = 1 OR SWITCH2 = 1 OR SWITCH3 = 1 SWITCH4 = 1
The error was produced because there was not an "OR" between the last 2 switches. Also note that "OR" in this case refers to a "bitwise" operation, rather than a "logical" operation (there are other posts on this forum about this). So, this is more appropriate:

Code: Select all

( SWITCH1 = 1 ) || ( SWITCH2 = 1 ) || ( SWITCH3 = 1 ) || ( SWITCH4 = 1 )
Note that I have added some brackets to aid clarity.

There are other decision icons which have the same "OR" issue. If you have any "AND" operations in decision or loop statements, these may need to change to "&&".

To get your program to compile, I also had to remove the unused RS232 component from the project.

I hope this gets you on the way with your program.

icabjeff
Posts: 34
Joined: Thu Jul 27, 2006 11:00 pm
Location: Newton, NJ, USA
Contact:

Re: Compile to chip error

Post by icabjeff »

I corrected my errors and tried to compile to chip. Here is the report:
File name: F:\multi-click_axiss1-s4copy4.c
Generated by: Flowcode v3.2.2.40
Date: Monday, January 19, 2009 13:29:56
Licence: Professional
Registered to: Jeffrey Gray


http://www.matrixmultimedia.com



Launching the compiler...

C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\boostc.pic16.flowcode.exe -v -t PIC16F877A "multi-click_axiss1-s4copy4.c"

BoostC Optimizing C Compiler Version 6.70 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2007 Pavel Baranov
Copyright(C) 2004-2007 David Hobday

Licensed to FlowCode User under Single user Pro License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited


multi-click_axiss1-s4copy4.c
Starting preprocessor: "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\pp.exe" F:\multi-click_axiss1-s4copy4.c -i "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\include" -d _PIC16F877A -la -c2 -o multi-click_axiss1-s4copy4.pp -v -d _BOOSTC -d _PIC16


.....................................................................................................................

multi-click_axiss1-s4copy4.c success

success

Return code = 0

Launching the linker/assembler...

C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\boostlink.pic.exe -ld "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\lib" libc.pic16.lib flowcode.pic16.lib "multi-click_axiss1-s4copy4.obj" -t PIC16F877A -d "F:" -p "multi-click_axiss1-s4copy4"

BoostLink Optimizing Linker Version 6.70
http://www.sourceboost.com
Copyright(C) 2004-2007 Pavel Baranov
Copyright(C) 2004-2007 David Hobday


..............


Warning unreferenced functions removed:
FCM_ADCmeasure in: F:\multi-click_axiss1-s4copy4.c
FCD_ADC0_ReadAsByte in: F:\multi-click_axiss1-s4copy4.c

Building CASM file

Memory Usage Report
===================
RAM available:368 bytes, used:99 bytes (27.0%), free:269 bytes (73.0%),
Heap size:269 bytes, Heap max single alloc:95 bytes
ROM available:8192 words, used:1356 words (16.6%), free:6836 words (83.4%)


success

Return code = 0

Launching the programmer...

C:\Program Files\Matrix Multimedia\Common\PPPv3\PPPv3.exe -cs 2 -nogui "multi-click_axiss1-s4copy4.hex"

Sending program...

.............................................................................................

Erasing the PICmicro

....................

Writing program memory
Writing configuration memory
Writing id-locations
Reading program memory
Reading configuration memory
Finished reading PICmicro contents
Programming failed: <config1>
That took 36.032 seconds

Return code = 0

FINISHED
Any ideas?

Jeff

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

Re: Compile to chip error

Post by Steve »

Well, the compilation went well. It's just the programming that has a fault. This could be because the config word is not correct - please open the "chip..configure" window and make sure appropriate settings are selected.

If you're still having problems with this, it could be due to a faulty chip. Do you have another chip you can try?

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

Re: Compile to chip error

Post by medelec35 »

icabjeff wrote:Is there an easy way to find syntax errors in my flowchart. Or could it be in the code for simulated hardware. I'm using switches and a sensor interface. Here is the error report.

File name: F:\multi-click_axiss1-s4copy4.c
Generated by: Flowcode v3.2.2.40
Launching the compiler...

C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\boostc.pic16.flowcode.exe -v -t PIC16F877A "multi-click_axiss1-s4copy4.c"

BoostC Optimizing C Compiler Version 6.70 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2007 Pavel Baranov
Copyright(C) 2004-2007 David Hobday

Licensed to FlowCode User under Single user Pro License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited


multi-click_axiss1-s4copy4.c
Starting preprocessor: "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\pp.exe" F:\multi-click_axiss1-s4copy4.c -i "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\include" -d _PIC16F877A -la -c2 -o multi-click_axiss1-s4copy4.pp -v -d _BOOSTC -d _PIC16


.

F:\multi-click_axiss1-s4copy4.c(764): error: missing right paren
F:\multi-click_axiss1-s4copy4.c(764): error: missing semicolon
F:\multi-click_axiss1-s4copy4.c(764): error: missing right paren
F:\multi-click_axiss1-s4copy4.c(600): 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.

FINISHED

Thank you, Jeff
And
icabjeff wrote:I need help finding my errors. When I look through the code I'm not sure what line number I'm on. Are blank lines couted? Can you take a look. I will post the code here.
Thanks, Jeff


When I compiled Jeffs program I hade the following error:

Licensed to FlowCode User under Single user Pro License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited


multi-click_axiss1-s4copy4.c
Starting preprocessor: "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\pp.exe" C:\Downloads\multi-click_axiss1-s4copy4.c -i "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\include" -d _PIC16F877A -la -c2 -o multi-click_axiss1-s4copy4.pp -v -d _BOOSTC -d _PIC16

C:\Downloads\multi-click_axiss1-s4copy4.c(828): error: missing right paren
C:\Downloads\multi-click_axiss1-s4copy4.c(828): error: missing semicolon
C:\Downloads\multi-click_axiss1-s4copy4.c(828): error: missing right paren
C:\Downloads\multi-click_axiss1-s4copy4.c(664): 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.

I know the problem has been solved by Steve,
However for any one who wants to know which line is causing a compile error:
If you run MPLAB IDE, open c file in editor, then editor will show all the line numbers. If not you can enable line numbers by right clicking on editor page or using Edit menu,
then select Properties, 'C' File Types tab, then select line numbers, and select print line numbers.
Screen Shot MPLAB.jpg
(106.2 KiB) Downloaded 4204 times
Martin

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

Re: Compile to chip error

Post by Steve »

You can do the same thing in a lot of text editors. Even in "notepad", you can use the "edit..goto" menu item to go to the appropriate line in a c file (note: you will need to turn word wrap off for this to work).

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

Re: Compile to chip error

Post by medelec35 »

Thanks Steve, I used MPLAB and an example, since if people are using microcontrollers, they usually instal MPLAB as well.
However Notepad is not an option I thought of, but if u want a small freeware editior which following description form there site:
PSPad - editor for developers for Microsoft Windows systems
The universal freeware editor, useful for people who:
work with plain text - the editor has a wealth of formatting functions, including a spell checker
create web pages - as a web authoring editor, PSPad contains many unique tools that save your time
want to use a good IDE for their compiler - PSPad catches and parses compiler output, integrates external help files, compares versions and much more...
There is no complex installation process, PSPad is ready to work immediately without requiring customization. The editor supports many file types and languages, with syntax highlighting. There are macros, clip files and templates to automate repetative tasks. Integrated HEX Editor, Project support, FTP Client, Macro Recorder, File Search/Replace, Code Explorer, Code page conversion... these are just some of the many features that PSPad offers.

The PSPad editor was tested in the Softpedia labs. Softpedia guarantees that PSPad is 100% FREE, which means it is a freeware product (both for personal and commercial use) that does not contain any form of malware, including but not limited to: spyware, viruses, trojans and backdoors.
At 3.26M, its not a lage download.

Available from:
http://www.pspad.com/

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

Re: Compile to chip error

Post by Steve »

Cheers for the info. I know there are lots of other alternatives around. I personally use Textpad (which is not free, but is cheap and suits my needs very well), and there are others that I know of (UltraEdit, Notepad++, ProgrammersNotepad, etc, etc) and many of these are free.

Post Reply