DSPRelated.com
Forums

plz plz----------------help me,,,toggling GPIO pins,TMS320DM6446......

Started by rich...@tcs.com March 13, 2008
Please someone help me how to toggle GPIO pins .I am getting GPIO symbols as undefined.I am using code composer for this purpose....

Please Please someone help me...............
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Hi,

well it could be because the moon is in libra and the sun is in virgo...

Code or at least an error message would be fine.

I guess an include is missing. Try
#include
or
#include

HTH

Gustl

r...@tcs.com schrieb:
> Please someone help me how to toggle GPIO pins .I am getting GPIO
> symbols as undefined.I am using code composer for this purpose....
>
> Please Please someone help me...............

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Please someone help me how to toggle GPIO pins .I am getting GPIO symbols as undefined.I am using code composer for this purpose....
>
>Please Please someone help me...............
>Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
#include
#include "C6x.h"
#include "csl_gpiohal.h"

//#define chip_6201 1

#if defined(_TMS320C6446)
#define ALIGNED_ARRAY(ptr) _nassert((int) ptr % 8 == 0)

#elif defined( _TMS320C6200) || defined(_TMS320C6700)
#define ALIGNED_ARRAY(ptr) _nassert((int) ptr % 4 == 0)
#else
#define ALIGNED_ARRAY(ptr) /* empty */
#endif

void main()
{
;
GP0EN=1;
GPIO_0=0;
}

IN THIS CODE BEFORE I INCLUDED CSIO_GPIO.H I WAS GETTING UNDEFINED SYMBOLS FOR gpio SYMBOLS BUT RIGHT NOW
I AM GETTING ERROR
csl_chiphal.h", line 267: fatal error: #error NO CHIP DEFINED (use -dCHIP_XXXX where XXXX is chip number, i.e. 6201)
Please help me regarding this?????
Add something like

#define CHIP_6467 1

_BEFORE_ including any CSL files!

r...@tcs.com schrieb:
> IN THIS CODE BEFORE I INCLUDED CSIO_GPIO.H I WAS GETTING UNDEFINED
> SYMBOLS FOR gpio SYMBOLS BUT RIGHT NOW
> I AM GETTING ERROR
> csl_chiphal.h", line 267: fatal error: #error NO CHIP DEFINED (use
> -dCHIP_XXXX where XXXX is chip number, i.e. 6201)
> Please help me regarding this?????
>
the error is no chip defined, you have to define on what chip you are working...C6713 I think
Thanx for your response.I have not read TMS320DM6446 processor extensively.Just my org. has told me to set GPIO pin as Input or Output and then toggle it

But my problem is that i am getting undefined symbols for all my GPIO signals If you have a little code snippet dealing GPIO signals thn please send it to me I am copying my code with this mail.I f you can help me.

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

#if defined(_TMS320C6201)
#define ALIGNED_ARRAY(ptr) _nassert((int) ptr % 8 == 0)

#elif defined( _chip_6201) || defined(_TMS320C6700)
#define ALIGNED_ARRAY(ptr) _nassert((int) ptr % 4 == 0)
#else
#define ALIGNED_ARRAY(ptr) /* empty */
#endif

void main()
{
GP0EN=1; //this signal it is giving as undefined
GP0DIR=1; //this signal it is giving as undefined
}

Please someone help me how to toggle GPIO pins .I am getting GPIO symbols as undefined.I am using code composer for this purpose....
>
>Please Please someone help me...............
>Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
I suggest you should read at least the GPIO section of the DM6446 doku.

If you use TMS320DM6446 ( which I don't know) I think your define should
look like '#define chip_DM6446'. Have a look at CSL_init() in csl.h what
chips are available.

Maybe you have a typo in 'GP0EN' or 'GP0DIR' try to find them in the
include files.

r...@tcs.com schrieb:
> Thanx for your response.I have not read TMS320DM6446 processor
> extensively.Just my org. has told me to set GPIO pin as Input or Output
> and then toggle it
>
> But my problem is that i am getting undefined symbols for all my GPIO
> signals If you have a little code snippet dealing GPIO signals thn
> please send it to me I am copying my code with this mail.I f you can
> help me.
>
> #include
> #define chip_6201
> #include "C6x.h"
> #include "csl_gpiohal.h"
> #include "csl_gpio.h"
> #include "csl_chiphal.h"
>
> #if defined(_TMS320C6201)
> #define ALIGNED_ARRAY(ptr) _nassert((int) ptr % 8 == 0)
>
> #elif defined( _chip_6201) || defined(_TMS320C6700)
> #define ALIGNED_ARRAY(ptr) _nassert((int) ptr % 4 == 0)
> #else
> #define ALIGNED_ARRAY(ptr) /* empty */
> #endif
>
> void main()
> {
> GP0EN=1; //this signal it is giving as undefined
> GP0DIR=1; //this signal it is giving as undefined
> }
>
> Please someone help me how to toggle GPIO pins .I am getting GPIO
> symbols as undefined.I am using code composer for this purpose....
Use

#define CHIP_DM6446

instead of

#define chip_DM6446

!!!!

Bernhard 'Gustl' Bauer schrieb:
> I suggest you should read at least the GPIO section of the DM6446 doku.
>
> If you use TMS320DM6446 ( which I don't know) I think your define should
> look like '#define chip_DM6446'. Have a look at CSL_init() in csl.h what
> chips are available.
>
> Maybe you have a typo in 'GP0EN' or 'GP0DIR' try to find them in the
> include files.
>
> r...@tcs.com schrieb:
>> Thanx for your response.I have not read TMS320DM6446 processor
>> extensively.Just my org. has told me to set GPIO pin as Input or
>> Output and then toggle it
>>
>> But my problem is that i am getting undefined symbols for all my GPIO
>> signals If you have a little code snippet dealing GPIO signals thn
>> please send it to me I am copying my code with this mail.I f you can
>> help me.
>>
>> #include
>> #define chip_6201
>> #include "C6x.h"
>> #include "csl_gpiohal.h"
>> #include "csl_gpio.h"
>> #include "csl_chiphal.h"
>>
>> #if defined(_TMS320C6201)
>> #define ALIGNED_ARRAY(ptr) _nassert((int) ptr % 8 == 0)
>>
>> #elif defined( _chip_6201) || defined(_TMS320C6700)
>> #define ALIGNED_ARRAY(ptr) _nassert((int) ptr % 4 == 0)
>> #else
>> #define ALIGNED_ARRAY(ptr) /* empty */
>> #endif
>>
>> void main()
>> {
>> GP0EN=1; //this signal it is giving as undefined
>> GP0DIR=1; //this signal it is giving as undefined
>> }
>>
>> Please someone help me how to toggle GPIO pins .I am getting GPIO
>> symbols as undefined.I am using code composer for this purpose....
Richa,

The following code snippit may be just what you are looking for.

R. Williams

======================// Include:
#include
// Variable:
GPIO_Handle hGpio;
// somewhere in your main:
unsigned b=0;

hGpio = GPIO_open(GPIO_DEV0,GPIO_OPEN_RESET);
GPIO_pinEnable(hGpio,GPIO_PIN0);
GPIO_pinDirection(hGpio, GPIO_PIN0,GPIO_OUTPUT);

GPIO_pinWrite(hGpio,GPIO_PIN0,b);
======================
---------- Original Message -----------
From: r...@tcs.com
To: c...
Sent: Fri, 14 Mar 2008 06:07:08 -0400
Subject: [c6x] Re: plz plz----------------help me,,,toggling GPIO pins,TMS320DM6446......

> Thanx for your response.I have not read TMS320DM6446 processor extensively.Just my org.
> has told me to set GPIO pin as Input or Output and then toggle it
>
> But my problem is that i am getting undefined symbols for all my GPIO signals If you have
> a little code snippet dealing GPIO signals thn please send it to me I am copying my code
> with this mail.I f you can help me.
>
> #include
> #define chip_6201
> #include "C6x.h"
> #include "csl_gpiohal.h"
> #include "csl_gpio.h"
> #include "csl_chiphal.h"
>
> #if defined(_TMS320C6201)
> #define ALIGNED_ARRAY(ptr) _nassert((int) ptr % 8 == 0)
>
> #elif defined( _chip_6201) || defined(_TMS320C6700)
> #define ALIGNED_ARRAY(ptr) _nassert((int) ptr % 4 == 0)
> #else
> #define ALIGNED_ARRAY(ptr) /* empty */
> #endif
>
> void main()
> {
> GP0EN=1; //this signal it is giving as undefined
> GP0DIR=1; //this signal it is giving as undefined
> }
>
> Please someone help me how to toggle GPIO pins .I am getting GPIO symbols as undefined.I
> am using code composer for this purpose....
> >
> >Please Please someone help me...............
> >Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for
Commercial & Consumer End Equipment: www.ti.com/dm6467
> >
> >
------- End of Original Message -------
Thanks a ton for so many response and your response have actually helped me to move further.
Now the problem i am facing is that i have to make
# define GPIo_support 1 and
# define inline 1,,,,,,,,before i include csl_gpio.h
however i am getting gpio_open ,gpio_pindirection etc as first time referenced symbols

if i do not define gpio_support as 1 then it gives error gpio_handle as undefined....though after making gpio_support as 1 ,,,,i do not get gpio_handle as undefined.....

but i am still confused ,,,,,as after i make usedefs as 1,,,my code starts compiling
#include

//#define chip_6201
#define CHIP_DA610

#include "C6x.h"

#include "csl_chiphal.h"
#define GPIO_SUPPORT 1
#define _INLINE 1
//#define _GPIO_MOD_
//#define USEDEFS 1

#include "csl_gpiohal.h"

#include "csl_gpio.h"
#if defined(_TMS320C6201)
#define ALIGNED_ARRAY(ptr) _nassert((int) ptr % 8 == 0)

#elif defined( _chip_6201) || defined(_TMS320C6700)
#define ALIGNED_ARRAY(ptr) _nassert((int) ptr % 4 == 0)
#else
#define ALIGNED_ARRAY(ptr) /* empty */
#endif

main()
{
unsigned b=0;
GPIO_Handle hGpio;
hGpio = GPIO_open(GPIO_DEV0,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 5: warning: incompatible redefinition of macro "CHIP_DA610"
"toggle.cpp", line 12: warning: incompatible redefinition of macro "GPIO_SUPPORT" (declared at line 313 of "C:/CCStudio_v3.3/C6000/csl/include/csl_chiphal.h")
"toggle.cpp", line 33: warning: return type "int" omitted in declaration of function "main"
"toggle.cpp", line 83: warning: last line of file ends without a newline

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
>> error: symbol referencing errors - './Debug/test_richa.out' not built

>> Compilation failure

Build Complete,
2 Errors, 6 Warnings, 0 Remarks.

Has anyone faced such a problem.....if you want i can share my csl_gpio.h file also.....

Please check this out....

Please someone help me how to toggle GPIO pins .I am getting GPIO symbols as undefined.I am using code composer for this purpose....
>
>Please Please someone help me...............
>Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467