Flowkit causes compiler error

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
PaulXPC
Posts: 12
Joined: Sun Jun 29, 2008 12:35 pm
Location: The Netherlands
Contact:

Flowkit causes compiler error

Post by PaulXPC »

Hi everybody,

Last week I finally received my very own FlowKit and today I tried to debug a hardware prototype I've been working on. This is custom hardware and to make debugging easier, I wanted to use pins A0 and D4 as ICD clock and data pins.
I have adjusted the settings in the 'Project options'-window, but now my Flowcode program won't compile anymore.
This is the compiler message window output:

Code: Select all


File name:     X:\xxx\test 20.c
Generated by:  Flowcode v4.3.7.63
Date:          Tuesday, June 01, 2010 11:51:33
Licence:       Professional
Registered to: xxx


http://www.matrixmultimedia.com


Launching the compiler...
C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\BoostC\boostc.pic18.flowcode.exe -v -t PIC18F4685 "test 20.c"

................................................................................................
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
Something's wrong, but what could it be? I've attached the fcf-file to this post.
I also tried looking for an updated driver for my Flowkit, but I can't find it anywhere on the site. The HP299 is only mentioned in PDF-files, there is no dedicated page. :?:

Thanks in advance for your help.

Paul
Attachments
test 20.fcf
The test file
(23.18 KiB) Downloaded 310 times

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: Flowkit causes compiler error

Post by Benj »

Hello Paul,

Please can you postin the Flowcode v4 forum section by signing up using the online resources link in the Flowcode help menu, otherwise we will assume you are a pirate user.

The return code 1 problem is normally due to restricted file permissions in Windows 7. Please move your Flowcode project file into a library such as my documents and the program should compile correctly for you.

PaulXPC
Posts: 12
Joined: Sun Jun 29, 2008 12:35 pm
Location: The Netherlands
Contact:

Re: Flowkit causes compiler error

Post by PaulXPC »

Hi Ben,

Thanks for your reply; should I make a new topic in the v4 forum and link to this one or just repeat everything and have this one deleted/closed?
By the way: the original file was on a NAS, so to make sure it's not a file permission problem I copied it to a local folder (with full access rights for everyone). Still the same error however :cry:

Paul

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: Flowkit causes compiler error

Post by Benj »

Hello Paul,

If your using win 7 then "local folder (with full access rights for everyone)" is unfortunatley not enough. I did a fair bit of testing on this on my 64-bit Win 7 machine.

Moving the file to your documents folder or another defined library folder should hopefully remove the return code 1 error.

PaulXPC
Posts: 12
Joined: Sun Jun 29, 2008 12:35 pm
Location: The Netherlands
Contact:

Re: Flowkit causes compiler error

Post by PaulXPC »

Hi Ben,

I've done some experiments and I'm pretty sure it has something to do with the 'override ICD pins' option. As soon as you restore it to the default pins (B6 for clock and B7 for data) the program does compile.
If you choose any other pins than B6 and B7, you'll get an error when you try to compile it.
Copying the file to 'My documents' doesn't help.

Paul

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: Flowkit causes compiler error

Post by Benj »

Hello Paul,

Please could you send me your program via the forums or via a PM if you do not want it publically available and I will have a look and see if I can find out whats going wrong.

What OS, Antivirus, Firewall, version of Flowcode are you using? Anything else that may be effecting things.

PaulXPC
Posts: 12
Joined: Sun Jun 29, 2008 12:35 pm
Location: The Netherlands
Contact:

Re: Flowkit causes compiler error

Post by PaulXPC »

Hello Ben,

The program is attached to my first post in this topic 8)
I'm running Windows 7 64-bit, Windows Security Essentials as anti-virus/firewall and use Flowcode for PIC version 4.3.7.63.
I know that 64-bit operating systems can cause all kinds of errors, but I never had problems like this with Flowcode until I tried to enable ICD for FlowKit.

Paul

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: Flowkit causes compiler error

Post by Benj »

Hello Paul,

I have managed to compile your program and I think I have found the reason why it is nt compiling correctly on your system.

Please go into the "Flowcode v4/FCD" directory and replace the "internals.h" file with the file attached here.
Attachments
internals.h
(35.7 KiB) Downloaded 340 times

PaulXPC
Posts: 12
Joined: Sun Jun 29, 2008 12:35 pm
Location: The Netherlands
Contact:

Re: Flowkit causes compiler error

Post by PaulXPC »

Hello Ben,

Thank you for the file. The new header file does the trick; apparently "porta" should have been "PORTA" in line 644.
FlowKit works and I'm able to step through my program, but I'm a bit worried about this compiler message:

Code: Select all

Serious Warning: Possible sw stack corruption, function 'FC_MARKER' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'ICD_PUSH' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Serious Warning: Possible sw stack corruption, function 'ICD_POP' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)
Can I ignore this warning, or should I avoid using interrupts (that might conflict with the ICD code) in my program?

Paul

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: Flowkit causes compiler error

Post by Benj »

Hello Paul,

The warnings are not the end of the world and you will certainly not damage anything. However if you notice that the ICD functionality is a bit unreliable then you could try removing some of your interrupt functionality.

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: Flowkit causes compiler error

Post by medelec35 »

I am also experiencing an error when ICD is enabled, which is not present when disabled.
Thank you in advance.

Code: Select all

18f2523 test.c

Starting preprocessor: C:\PROGRA~1\MATRIX~1\FLOWCO~1\BoostC\pp.exe "K:\Latest Versions only\18f2523 test.c" -i C:\PROGRA~1\MATRIX~1\FLOWCO~1\BoostC\include -d _PIC18F2523 -la -c2 -o "K:\Latest Versions only\18f2523 test.pp" -v -d _BOOSTC -d _PIC18 





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



C:\Program Files\Matrix Multimedia\Flowcode V4\FCD\internals.h(1237:2): error: unknown identifier 'trise'

C:\Program Files\Matrix Multimedia\Flowcode V4\FCD\internals.h(1237:2): error: invalid operand 'trise'

C:\Program Files\Matrix Multimedia\Flowcode V4\FCD\internals.h(1237:8): error: failed to generate expression

18f2523 test.c success



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.
Attachments
18f2523 test.fcf
(4.5 KiB) Downloaded 312 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: Flowkit causes compiler error

Post by Benj »

Hello Medelec,

Hm thats a strange one i'm having the same problem on my PC here.

The problems comes from the following section of code inside the rst_dev() function in the internals.h file that lives inside the FCD folder.

Code: Select all

#ifdef PORTE | porte
	trise = 0xff;
	porte = 0x00;
#endif
You could try manually editing this file to see if that solves the problem.

Code: Select all

#ifdef PORTE | porte
	//trise = 0xff;
	//porte = 0x00;
#endif
I will look into this and try and figure out whats going wrong.

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: Flowkit causes compiler error

Post by medelec35 »

Thank you Ben.
It compiles OK now with your suggestion.
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: Flowkit causes compiler error

Post by Benj »

Hello Medelec,

Right I found the problem that is causing this.

The BoostC definition file for the 18F2523 device has this:

#define PORTE 0x00000F84

The 28-pin devices in the family eg the 18F2523 device do not have the PortE register but due to the definition the internals file thinks that the device does have a PortE. If this starts to be a major problem then I will have to look at redoing the port detection routine to allow this to work a bit better.

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: Flowkit causes compiler error

Post by medelec35 »

Its't great that you have found the issue causing the problem.
Benj wrote:Hello Medelec,
The 28-pin devices in the family eg the 18F2523 device do not have the PortE register .
I thought 18F2523 has RE3 which can be set as a digital input if not used as MCLR?
Martin

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: Flowkit causes compiler error

Post by medelec35 »

Ah, Just look more carefully at the datasheet, Although 2523 has port RE3, on page 63 it states 'register is not available on 28-pin devices'
Port E3 is selectable using an input icon which i believe is correct, since i/p only. The reason there can be porte without trise is is because porte is a digital i/p only. Whereas tris is used when there is a digital i/p or digital output to select direction.
I can see how its caused confusion...Only E port is E3, which is digital input only, Enabled/disabled in config, and no trise. Hmmm :shock:
Martin

keshav@solus.in
Posts: 19
Joined: Tue Sep 07, 2010 7:03 am
Contact:

Flowkit debugger not connecting

Post by keshav@solus.in »

Hi

I am using HP299- flowkit programmer to download the code into third party PIC 18F8722 Microcontroller target board directly,

Flowkit programmer switch is in ICD mode, using single pin wire connection ICD pins connected to the target board,

but i was facing problem to download the code into PIC microcontrller through flowkit programmer,

1) USB cable not connecting properly,

2) I installed driver correctly but still it is not working,

3) I have one more doubt about programmer,

a) +5v power supply is coming from the flowkit programmer when i connected folwkit programmer to the computer,

b) Can I connect external +5v power supply to target board presently i am not connecting external power supply,

Regarding this issue i attached flowkit.image file,

please go through reply as soon as possible,


i am expecting your reply,
Attachments
flowkit.zip
(87.48 KiB) Downloaded 205 times

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: Flowkit causes compiler error

Post by Benj »

Hello,

The Flowkit is not a programming device. You should use your usual programmer to load your program onto the device and then use the FlowKit to debug with Flowcode.

Flowcode can work with a PICkit programmer or other command line programmer. For PICkit setting please see here.

PICkit2 - http://www.matrixmultimedia.com/support ... f=22&t=672

PICkit3 - http://www.matrixmultimedia.com/support ... f=22&t=565

Frank123
Posts: 36
Joined: Fri Jan 15, 2010 5:17 pm
Location: Saint-Nazaire - France
Has thanked: 1 time
Contact:

Re: Flowkit causes compiler error

Post by Frank123 »

The Flowkit is not a programming device.
Then What is the switch ICD / PROG?
You should use your usual programmer to load your program onto the device and then use the FlowKit to debug with Flowcode
Really? This is not very functional !
Frank
Electronics teacher

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: Flowkit causes compiler error

Post by Benj »

Hello Frank,

If you look at the datasheet for the Flowkit then it explains all of this including the function of the onboard switch.

FlowKIT is a great tool but is not and never will be a Programmer.

Post Reply