Problem with MPALB and ICD3

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Problem with MPALB and ICD3

Post by Steff »

I make my first steps with Flowcode4 and I am really inspired from the
possibilities.

Now I will programming the Pic18 with MPlab ICD 3(I do not have other possibilities) :roll: .

I write a smal Program in Flowcode4 (set only one output), compile the C-Code in FC4, and import this file in MPLAB.
i added into MPLAB: Internals.h(flowcode), float.pic18.lib and libc.pic18.lib (sourceboost).

The Testboard is programmable with the "normal" C-Progs and settings in MPLAB.
Flowcode Version : 4.3.7.63
MPlAb Version : 8.56.00.00
Sourceboost IDE Version : 7.00

I did the instruction of the Forum to set MPLAB ICD3, but it doesn't work. The followed
Errors has appeared.

Test18k44.c

success
Executing: "C:\Programme\SourceBoost\boostlink_pic.exe" "C:\Pic\Test\Test18k44.obj" "C:\Programme\SourceBoost\Lib\libc.pic18.lib" "C:\Programme\SourceBoost\Lib\float.pic18.lib" -O1 -p "MusterProjektFlowcode4" -t 18F44K20 -ld "C:\Programme\SourceBoost\Lib"
BoostLink Optimizing Linker Version 7.00
http://www.sourceboost.com
Copyright(C) 2004-2010 Pavel Baranov
Copyright(C) 2004-2010 David Hobday

Optimisation level:1
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external symbol, function:FCI_TOSTRING

failure
Link step failed.
BUILD FAILED: Mon Oct 18 07:53:55 2010




Something wrong ....but what ? :shock:

Sorry for my bad English, i hope you understand it :oops:

Thanks for your Help.

Regards Steff

Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Problem with MPALB and ICD3

Post by Steff »

A Result and new Questions !

I have reinstalled Flowcode V3 and take the same small sampel Program, compile it an import in MPLAB...AND.....no Errors... no problem ! :shock:
The same Prog compiled in FCV4....an the Errors in MPLAB build are back !!! :evil:
The Settings in MPLAB are the same, i only compile the source file one time with the FCV3 and other time with FCV4 .

Is there a Bug in FCV4 ? Or I make a mistake ? or am I blind ? :?:

Thanks for your Help.

Regards Steff

Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Problem with MPALB and ICD3

Post by Steff »

http://www.matrixmultimedia.com/mmforum ... =30&t=7491

Those are similar problems as I them describe. Or is it the same problem? If yes.... is there already a solution ?

Regards Steff

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: Problem with MPALB and ICD3

Post by Benj »

Hello Steff,

It looks like MPLAB cannot find the FCI_TOSTRING function. If your not using this function in yur program then you can simply provide a dummy function in your C code.

eg.
FCI_TOSTRING(signed short a,unsigned char* b,unsigned char c)
{
Nop();
}

Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Problem with MPALB and ICD3

Post by Steff »

Thanks for your Help...But i need this function on my real Project :cry: .

But i also can't find this Function nowhere! I only find a other similar Function => char FCI_TOSTRING(int iSrc1, char* sDst, char iDst_len); in the Internals.h file.
But ....Where must this "lost" 8) Function have to be found? FCI_TOSTRING(signed short a,unsigned char* b,unsigned char c)

And another function i can't find => FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)
And again I find only a similar header => char FCI_CONCATENATE(char* sSrc1, char iSrc1_len, char* sSrc2, char iSrc2_len, char* sDst, char iDst_len)

is it possible i have a wrong internals.h file ?

Regards Steff

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: Problem with MPALB and ICD3

Post by Benj »

Hello Steff,

The functions are indeed the functions in the internals.h file. Can you simply include the internals.h file as is into your MPLAB project?

Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Problem with MPALB and ICD3

Post by Steff »

Benj wrote:Hello Steff,

The functions are indeed the functions in the internals.h file. Can you simply include the internals.h file as is into your MPLAB project?

Hello Benji
Now i have the "internal.h" and the "definitions.h" file copy in the Source directory and change the program line to #include "internal.h"...aaaaand nooooow :

Clean: Deleting intermediary and output files.
Clean: Deleted file "Testfcv4a.OBJ".
Clean: Done.
Executing: "C:\Programme\SourceBoost\boostc_pic18.exe" Testfcv4a.c -O1 -W1 -t 18F44K20
BoostC Optimizing C Compiler Version 7.00 (for PIC18 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2010 Pavel Baranov
Copyright(C) 2004-2010 David Hobday

Single user Lite License (Unregistered) for 0 node(s)
Limitations: PIC18 max code size:8192 bytes, max RAM banks:2, Non commercial use only


Testfcv4a.c

success
Executing: "C:\Programme\SourceBoost\boostlink_pic.exe" "C:\Flowcodcsource\Testfcv4a.obj" "C:\Programme\SourceBoost\Lib\float.pic18.lib" "C:\Programme\SourceBoost\Lib\libc.pic18.lib" -O1 -p "Testflowcode4" -t 18F44K20
BoostLink Optimizing Linker Version 7.00
http://www.sourceboost.com
Copyright(C) 2004-2010 Pavel Baranov
Copyright(C) 2004-2010 David Hobday


Optimisation level:1
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external function:'FCI_TOSTRING(signed short,unsigned char*,unsigned char)'
Error: Unresolved external symbol, function:FCI_TOSTRING
Error: Unresolved external function:'FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char)'
Error: Unresolved external symbol, function:FCI_CONCATENATE


failure
Link step failed.
BUILD FAILED: Thu Oct 21 10:13:37 2010


The same error's !!!!
Or did you mean something else?

Now ...I need tranquilizers ! :shock:
My Boss is not any more with very good mood. :roll: :roll:

Regards Steff

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: Problem with MPALB and ICD3

Post by Benj »

Hello Steff,

What about if you add this near the top of your C code file containing the main routine.

Code: Select all

extern FCI_TOSTRING(signed short,unsigned char*,unsigned char);
extern FCI_CONCATENATE(unsigned char*,unsigned char,unsigned char*,unsigned char,unsigned char*,unsigned char);
The error "unresolved external function" is saying that the function still cannot be found. Hopefully labelling the functions as external will allow them to be found correctly.

Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Problem with MPALB and ICD3

Post by Steff »

I have copy this 2 Lines at the Top of my C-Code and thats the Result. :|

Clean: Deleting intermediary and output files.
Clean: Deleted file "Testfcv4.OBJ".
Clean: Done.
Executing: "C:\Programme\SourceBoost\boostc_pic18.exe" Testfcv4.c -O1 -W1 -t 18F44K20
BoostC Optimizing C Compiler Version 7.00 (for PIC18 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2010 Pavel Baranov
Copyright(C) 2004-2010 David Hobday

Single user Lite License (Unregistered) for 0 node(s)
Limitations: PIC18 max code size:8192 bytes, max RAM banks:2, Non commercial use only


Testfcv4.c
Testfcv4.c(143:8): error: function with the same name 'FCI_CONCATENATE' but different return type already exists

failure
BUILD FAILED: Thu Oct 21 13:07:42 2010


I'm not a C Professional. But in the File "Internal.h" this functionen stands after the "#ifdef HI_TECH_C" . Is that correct ?
I'm setting MPlab at Sourceboost.

Regards Steff

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: Problem with MPALB and ICD3

Post by Benj »

Hi Steff,

Ah ok I see yes it is the ifdef that is causing you problems. If you comment out the ifdef and then remove the corresponding endif then the program should then compile correctly. I think that in Flowcode these BoostC functions are included as part of the library we call during compilation. The HiTech versions fo the functions should work fine under BoostC.

Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Problem with MPALB and ICD3

Post by Steff »

OOOk !!!
With much good will I will be able to correct that. But if I obey your
instructions, generate that again many different errors.

Unfortunately I have only now noticed that my real project already is too
large for the sourceboost compiler. :x :roll:
I also tried the same with the h-t-compiler. In addition, with this
compiler, there are many errors which I does not understand.

Are these errors corrected by matrix Multimedia in a update?
I hope much.

Resigning :cry: Steff

Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Problem with MPALB and ICD3

Post by Steff »

The Neverending Story ! :roll:
The last chance for my project with Flowcode4.
I would like to burn a Program with the COMMAND LINE tool over the
MPLAB ICD3 on the Pic18F44k20.
Although I defined at start of the new test project the 18F44k20 as target, everywhere in the compil/link option's, Pic16 is located !
I don't think that's correct. => I corrected for Pic 18.

Is there an instruction how to set the compiler and the linker correct ?

The settings Now :
C-Compiler Location : C:\Programme\Matrix Multimedia\Flowcode V4\BoostC\boostc.pic18.flowcode.exe
Parameter : -v -t PIC%p "%f.c"

Linker Assmebler Location : C:\Programme\Matrix Multimedia\Flowcode V4\BoostC\boostlink.pic.exe
Parameter : -ld "C:\Programme\Matrix Multimedia\Flowcode V4\BoostC\lib" libc.pic18.lib flowcode.pic18.lib rand.pic18.lib float.pic18.lib "%f.obj" -t PIC%p -d "%d" -p "%f"

Programmer Location : C:\Programme\Matrix Multimedia\Flowcode V4\Tools\PPP\PPPv3.exe
Parameter : -cs 2 -chip PIC%p -nogui "%f.hex"

Programmer : C:\Programme\Matrix Multimedia\Flowcode V4\Tools\PPP\PPPv3.exe
Parameter : -cs 2 -chip PIC%p -config




Regards Steff

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: Problem with MPALB and ICD3

Post by Benj »

Hello Steff,
everywhere in the compil/link option's, Pic16 is located !
I don't think that's correct. => I corrected for Pic 18.
Flowcode will do this automatically for you. Therefore the original 16's were correct.

You would have to change the first occurance of the programmer location and parameters to call the ICD 3 programming tool. The second occurance should be left as is as this takes care of the chip configurations. You will have to download the ICD3 command line programming tool and then use the appropriate parameters for what you require.

eg.

Location = C:\Program Files\Microchip\MPLAB IDE\Programmer Utilities\ICD3\ICD3CMD.exe

Parameters = %f.hex

This FAQ topic may also be of some use to you.
http://www.matrixmultimedia.com/support ... =ICD#p1186

Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Problem with MPALB and ICD3

Post by Steff »

Thank you for the assistance, I will try it.

Still as reference.
I determined, that it is possible to transfer assembler files from FC4 to MPLAB and to burn the Pic chip onboard with the ICD3 .
With a small test routine it functioned. I hope that it with the
real project also functioned.
Or is there possibly somewhat which I must to consider?

Regards Steff

Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Problem with MPALB and ICD3

Post by Steff »

The Never Ending Story ? :wink:

I tried Burning the Pic Chip over the ICD3 directly from the Flowcode 4 .
After a few adjustments into the compiler options now Flowcode4 recognizes the ICD3 Programmer and starts
But the chip is not Burned.
What wrong do I make?

The Compiler Otions :

Location : C:\Programme\Microchip\MPLAB IDE\Programmer Utilities\ICD3\ICD3CMD.exe
Parameters : -P18f4620 "%f.hex"

Location : C:\Programme\Matrix Multimedia\Flowcode V4\Tools\PPP\PPPv3.exe
Parameters : -cs 2 -chip PIC%p -config


Her is the Message from Flowcode4 :

"Launching the programmer...
C:\Programme\Microchip\MPLAB IDE\Programmer Utilities\ICD3\ICD3CMD.exe -P18f4620 Progtest1.hex

Connecting...
MPLAB ICD 3 detected
Connecting to MPLAB ICD 3...
Firmware Suite Version...... 01.26.26
Firmware type......................PIC18F
MPLAB ICD 3 Connected.
...


Target Detected
Device ID Revision = 00000007
Return code = 0

FINISHED "

I think its Looks good but something is wrong :roll:

Thanks for your Help.

Regards Steff

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: Problem with MPALB and ICD3

Post by Benj »

HI Steff,

Ok there is a readme for the ICD3 command tool available from here.

C:/Program Files/Microchip/MPLAB IDE/Readmes/Readme for RealICECMD_ICD3CMD.txt

It looks like to specify a hex file you have to use the -F switch.

Here is a better parameter list after looking at the readme file.

Parameters = -I -E -C -P%p -F%f.hex -Y

Parameters should do the following.

High Voltage MCLR
Erase Flash
Blank Check
PIC selection
File Specification
Verify

Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Problem with MPALB and ICD3

Post by Steff »

Thanks for your Help
I have tested it. But there are still problems.

But these are not problems of flow code. I will check with Microchip also.
But if anyone knows what I'm doing wrong, I'm glad for every hint.

Her the Message from Flowcode:

Launching the programmer...
C:\Programme\Microchip\MPLAB IDE\Programmer Utilities\ICD3\ICD3CMD.exe -I -E -C -P18F4620 -FProgtest1.hex -Y

Connecting...
MPLAB ICD 3 detected
Connecting to MPLAB ICD 3...
Firmware Suite Version...... 01.26.26
Firmware type......................PIC18F
MPLAB ICD 3 Connected.
...


Target Detected
Device ID Revision = 00000007

Failed to Set High Voltage MCLR !!!
Return code = 3

Flowcode konnte das Flussdiagramm nicht in den Microcontroller übertragen. Überprüfen Sie die Optionen der Programmer-Software und die physikalischen Verbindungen.

FINISHED

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: Problem with MPALB and ICD3

Post by Benj »

Hello,

Maybe try dropping the -I parameter from the command line call.


Parameters = -E -C -P%p -F%f.hex -Y

Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Problem with MPALB and ICD3

Post by Steff »

I tried the Following Compiler Parameters.

Parameters: -E -P%p -F%f.hex -M -Y

And Woooow :D

The Compiler Massage :

Launching the programmer...
C:\Programme\Microchip\MPLAB IDE\Programmer Utilities\ICD3\ICD3CMD.exe -E -P18F4620 -FProgtest1.hex -M -Y

Connecting...
MPLAB ICD 3 detected
Connecting to MPLAB ICD 3...
Running self test...
......................
Self test completed
Firmware Suite Version...... 01.26.26
Firmware type......................PIC18F
MPLAB ICD 3 Connected.
Target Detected
Device ID Revision = 00000007
................
Erasing ...
Erase device complete
.......................................
Programming Device ...
Programming/Verify complete
....
Verifying Device ...
Verify complete
Return code = 0

FINISHED


But....the Pic still not burned :cry: :roll:

Strangely, however: When I burn the test program from the MPLAB ICD 3 on the Pic chip it works. (The assembler code by Flowcode, on the same board)

I'll keep trying and look forward what it says Microchip

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: Problem with MPALB and ICD3

Post by Benj »

Hello,

Are you powering the board from the ICD3? Could be that your either not powering the device or your not releasing the reset pin correctly.

I would have a look through the help file I mentioned before and have a play around with the settings to see if you can make it work. If you get it to fire up then please let us know.

If you get stuck and cannot proceed then post again and I will have another crack at putting together a command line parameter set for you.

Steff
Posts: 46
Joined: Wed Jun 23, 2010 1:26 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Problem with MPALB and ICD3

Post by Steff »

Hello Benj
No, I have an external 5V power supply for the test board.
But Ihave overlooked something. And now it works :D .
I'm not quite sure why :? , but one reason certainly is the following:
If you burn with MPLAB and ICD3 a test board, you can leave the ICD3 plugged in, the program starts. If you burn with Flowcode4 and ICD3 a test board, you need to disconnect after burning the ICD3. Then the program starts too :mrgreen: ! The others are correct configuration for a program running properly :roll: :oops: !

With this Programmer Parameters it's works : -E -P%p -F%f.hex -M

Thank you for your help and your patience.

Regards Steff

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: Problem with MPALB and ICD3

Post by Benj »

Hi Steff,

Glad you got it all working ok. Thanks for letting us know the valid settings.

Post Reply