DSPRelated.com
Forums

GPIO:::Please check what i am missing in this

Started by rich...@tcs.com March 19, 2008
We have been trying to use GPIO pins as I/O, but we are facing some problems. Even though we have included all include files for GPIO but although my code compiles but while linking it gives errors.

Regarding other settings i have used Device Simulator 6713 in CC setup
and in Build options in -d i have put chip_6713.

Please check the code to see what i am missing that my code is not linking.

#include
#define CHIP_6713
#include "C6x.h"
#include "csl_chiphal.h"
#include "csl_gpiohal.h"
#include "csl_gpio.h"

GPIO_Handle hGpio;
main()
{
unsigned b=0;

hGpio = GPIO_open(GPIO_DEV1,GPIO_OPEN_RESET);
GPIO_pinEnable(hGpio,GPIO_PIN0);
GPIO_pinDirection(hGpio, GPIO_PIN0,GPIO_OUTPUT);
GPIO_pinWrite(hGpio,GPIO_PIN0,b);
}
--------------------------- test_richa.pjt - Debug ---------------------------
[toggle.cpp] "C:\CCStudio_v3.3\C6000\cgtools\bin\cl6x" -g -fr"C:/CCStudio_v3.3/examples/sim64xx/code_coverage/test_richa/Debug" -d"CHIP_DA610" -mv6201 -@"Debug.lkf" "toggle.cpp"
"toggle.cpp", line 3: warning: incompatible redefinition of macro "CHIP_DA610"
"toggle.cpp", line 12: warning: return type "int" omitted in declaration of function "main"

Warning: The project has no cmd file while the Text Linker is selected
[Linking...] "C:\CCStudio_v3.3\C6000\cgtools\bin\cl6x" -@"Debug.lkf"

>> warning: entry point symbol _c_int00 undefined

undefined first referenced
symbol in file
--------- ----------------
_GPIO_open C:\\CCStudio_v3.3\\examples\\sim64xx\\code_coverage\\test_richa\\Debug\\toggle.obj
_GPIO_pinEnable C:\\CCStudio_v3.3\\examples\\sim64xx\\code_coverage\\test_richa\\Debug\\toggle.obj
_GPIO_pinDirection C:\\CCStudio_v3.3\\examples\\sim64xx\\code_coverage\\test_richa\\Debug\\toggle.obj
_GPIO_pinWrite C:\\CCStudio_v3.3\\examples\\sim64xx\\code_coverage\\test_richa\\Debug\\toggle.obj
>> error: symbol referencing errors - './Debug/test_richa.out' not built

>> Compilation failure

Build Complete,
2 Errors, 4 Warnings, 0 Remarks.
richa,

On 3/19/08, r...@tcs.com wrote:

> We have been trying to use GPIO pins as I/O, but we are facing some problems. Even though we have included all include files for GPIO but although my code compiles but while linking it gives errors.
>
> Regarding other settings i have used Device Simulator 6713 in CC setup
> and in Build options in -d i have put chip_6713.
>
> Please check the code to see what i am missing that my code is not linking.
>
> #include
> #define CHIP_6713
> #include "C6x.h"
> #include "csl_chiphal.h"
> #include "csl_gpiohal.h"
> #include "csl_gpio.h"
>
> GPIO_Handle hGpio;
>
> main()
> {
> unsigned b=0;
>
> hGpio = GPIO_open(GPIO_DEV1,GPIO_OPEN_RESET);
> GPIO_pinEnable(hGpio,GPIO_PIN0);
> GPIO_pinDirection(hGpio, GPIO_PIN0,GPIO_OUTPUT);
> GPIO_pinWrite(hGpio,GPIO_PIN0,b);
> }
>
> --------------------------- test_richa.pjt - Debug ---------------------------
> [toggle.cpp] "C:\CCStudio_v3.3\C6000\cgtools\bin\cl6x" -g -fr"C:/CCStudio_v3.3/examples/sim64xx/code_coverage/test_richa/Debug" -d"CHIP_DA610" -mv6201 -@"Debug.lkf" "toggle.cpp"

You need to PAY ATTENTION to what you are doing and to the error messages.
The line above indicates the options that your project fed to the
compiler. Why are you defining 'CHIP_DA610' in your project?? Refer to
to CCS help files or a previous post from Jeff Brower to resolve.

> "toggle.cpp", line 3: warning: incompatible redefinition of macro "CHIP_DA610"
> "toggle.cpp", line 12: warning: return type "int" omitted in declaration of function "main"
>
> Warning: The project has no cmd file while the Text Linker is selected
> [Linking...] "C:\CCStudio_v3.3\C6000\cgtools\bin\cl6x" -@"Debug.lkf"
>
> >> warning: entry point symbol _c_int00 undefined

Are you including the rts library in your project?? You probably should.

mikedunn
>
> undefined first referenced
> symbol in file
> --------- ----------------
> _GPIO_open C:\\CCStudio_v3.3\\examples\\sim64xx\\code_coverage\\test_richa\\Debug\\toggle.obj
> _GPIO_pinEnable C:\\CCStudio_v3.3\\examples\\sim64xx\\code_coverage\\test_richa\\Debug\\toggle.obj
> _GPIO_pinDirection C:\\CCStudio_v3.3\\examples\\sim64xx\\code_coverage\\test_richa\\Debug\\toggle.obj
> _GPIO_pinWrite C:\\CCStudio_v3.3\\examples\\sim64xx\\code_coverage\\test_richa\\Debug\\toggle.obj
> >> error: symbol referencing errors - './Debug/test_richa.out' not built
>
> >> Compilation failure
>
> Build Complete,
> 2 Errors, 4 Warnings, 0 Remarks.
>

--
www.dsprelated.com/blogs-1/nf/Mike_Dunn.php