I have a KIT tms320r2812 and I it doesn´t work even a" helo world"!!!!"
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I have a KIT tms320r2812 and I it doesn´t work even a" helo world"!!!!"
"Doesn't work" is a huge statement...
Without additional details it is almost impossible to make any statement. Is CCS connecting to the board? Is the code loading to the device? Is it running but not having the expected output or is it resetting the device, collapsing CCS or doing a power outage on your lab? If it is just a runtime issue, what do you expect from your code (I assume hello world is not your final application), more specifically how you are allocating code, stack and heap; are you using any specific options?
The R281x device family does not have much memory available, therefore I suggest you starting with some other example code (available here): printf functions use a lot of heap, stack and code, therefore are unsuitable for most F28x devices. To help with that, there is an option mentioned at section 4.1 of the page below:
http://processors.wiki.ti.com/index.php/Tips_for_using_printf
--Rafael
Now, I understand that example dont work with TMS320r2812. But answer you question, I don´t know f the CCs is coneccted to the board, how can I see this? I pluged the board to my PC, but I don´t know if the CCs connected. Is the code load? How can I see it? I only installed the CCS and I followed the steps in the CCs video, in this video only the man selected the board and open the example and debuged. I don´t know what to do because TI does not provide any support for your customers, any starter guide, so, I don´t know what to do. So, now I creat a new project with main and I click and Debug, the message says error file gel...
Hi,
janderson duarte said:I don´t know what to do because TI does not provide any support for your customers, any starter guide, so, I don´t know what to do. So, now I creat a new project with main and I click and Debug, the message says error file gel...
I don't know why you feel this way, but given I am currently providing information and support to you that is a pretty broad statement.
Please check section 3 of the CCS category page on the wiki:
http://processors.wiki.ti.com/index.php/Category:Code_Composer_Studio_v5
I strongly recommend starting reading the CCSv5 Getting Started Guide as it walks through the concepts for project creation and debug (specially section 6), and the CCSv5 Getting Started Guide for C2000 to get acquainted with the specific topics relevant to the C2000 family (some of the information is a repeat of the first Getting Started Guide).
All that said, per your description it seems you are not creating a configuration when launching the debugger, therefore the documents above will give you a better idea on what may be happening in your case and you will be able to be more specific.
Hope this helps,
Rafael
Hi, I have read this document, in fact very poorly written, guide the family c2000 is made to version 5.1 and I have version 5.4. These documents have not helped me at all. I am choose "Spectrum digital DSK-EV -Ezdsp onboard USB emulator" and choose: "TMS320r2812" when i DEbug this message apper: C28xx: GEL: Error while executing OnReset(0): 'Unlock_CSM()' not found at Unlock_CSM() [r2812.gel:40] at OnReset(0) .
What Can I do? I am think that should be the EZDSPr2812 instead TMS320r2812, but ther isnt this option!!!!!
Hi,
janderson duarte said:Hi, I have read this document, in fact very poorly written,
I beg to differ; these getting started guides helped thousands of people get started with CCS throughout the years. However, given the number of boards and devices being continuously released, it becomes impractical these documents mention every single board/device combination available (the case of your R2812 board).
Is this the board you have? If so, the connection seems to be configured correctly and you found a bug in the GEL file provided for this device. CSM stands for "Code Security Module" and is used to protect the Flash memory from being read by unauthorized sources. The R281x devices do not have Flash, therefore this API call is invalid. I will ask Spectrum Digital (the manufacturer of the board and the provider of this file) to update its sources.
Despite this, the error you see does not affect the code execution and you should be able to run the code without problems. If you want to get rid of this error, you can edit line 40 of the GEL file <r2812.gel> and comment/remove the call to Unlock_CSM();
This GEL file is usually located at <CCS_INSTALL_DIR>/ccsv5/ccs_base/emulation/gel
Regards,
Rafael
Hi Rafael, now I got to run the program, I imported my project done in CCS3.1, and it worked. But, I'm in trouble if I modify this program, I do a simple code:
ic++;
if(ic>=100)
{
GpioDataRegs.GPADAT.bit.GPIOA10 =0; //Teste
ig=1;
ic=0;
}
if(ig==1)
{
GpioDataRegs.GPADAT.bit.GPIOA10 =1; //Teste
ig=0;
}
and I debug step by step and the variable ic ins´t incremented, i Watch this variable in watch window and it stay with 0. What could be? the rest origianl parts of the program works well
thanks
Hello, doing some more testing I realized that if I declare the variable as global it does not work, and how to declare local variable it works. Can you tell me why?
Hi,
It is difficult to make a precise assessment on what may be happening only with the snippet of code you sent, but I can imagine a few possibilities:
- Is the compiler optimization turned on? If so, depending on how ic is used throughout your code, it is possible the optimizer is replacing the variable itself with the assumed values it will have during its execution (and therefore it "disappears" completely).
- Is the .bss section (the un-initialized global variable memory section) allocated to RAM? This would prevent any attempts to modify these variables.
- Are you looking at the global variable using the Expressions or the Variables view? This is something that confused me the first time I used Eclipse: the Variables view is for local variables only and is automatically populated, therefore if you have a global ic and a local ic, the Watch window will only show the value of the local variable (as the locally defined ic will take precedence).
I created a simple project with the snippet of code you sent to see how the disassembly and how the variable behave (check the attached screen), and I could not spot any problems.
Hope this helps,
Rafael
So, answers:
About compiler optimization, I did not even know this feature existed, so I dont know.
About this phrase "Is the .bss section (the un-initialized global variable memory section) allocated to RAM? This would prevent any attempts to modify" I didnt understand anything about you said.
I am using Expressions to see, but I am with a osciloscopy testing the pin, and if Ideclare inside the void main its works and if I declare before it doesnt.
Attached go the project.
Hi,
I imported the project and ran it in my F2812 eZdsp board successfully - in other words, irrespective of how ic/ig was defined (global or local) I get almost 300kHz at pin 10 of the GPIOA port, which seems about right (check the attached screenshot and the photo below).
Therefore unfortunately I don't know what is happening in your case, as I can't reproduce the same behaviour here.
Answers to your answers:
- optimization is a pretty standard feature in compilers, and if enabled it can sometimes remove variables and functions that are not being used or always assume a single value throughout the code execution.
- This partially describes how the code is allocated in the DSP memory. If you would like to read additional details, I suggest you to get familiar with the Projects and Build Handbook for CCS - specially section 3.2.2 (Main build) and the link that talks about Files in CCS Projects.
--Rafael
now I'm confused. I also have no idea of what can be. But attached
******************************************************************************
TMS320C2000 Linker PC v6.1.3
******************************************************************************
>> Linked Wed Sep 11 18:26:43 2013
OUTPUT FILE NAME: <E:/Programas DSP/Programa DSP geracao PWM/geracao_PWM/../Debug/Fonte3F.out>
ENTRY POINT SYMBOL: "_c_int00" address: 003f8214
MEMORY CONFIGURATION
name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
PAGE 0:
H0_SARAM 003f8000 00002000 00000486 00001b7a RWIX
BOOTROM 003ff000 00000fc0 00000000 00000fc0 RW
RESET 003fffc0 00000002 00000000 00000002 RWIX
PAGE 1:
M0_SARAM 00000040 000003c0 00000000 000003c0 RWIX
M1_SARAM 00000400 00000400 00000400 00000000 RWIX
DEV_EMU 00000880 00000180 000000d6 000000aa RWIX
FLASH_REGS 00000a80 00000060 00000008 00000058 RWIX
CSM 00000ae0 00000010 00000010 00000000 RWIX
XINTF 00000b20 00000020 00000020 00000000 RWIX
CPU_TIMER0 00000c00 00000008 00000008 00000000 RWIX
CPU_TIMER1 00000c08 00000008 00000000 00000008 RWIX
CPU_TIMER2 00000c10 00000008 00000000 00000008 RWIX
PIE_CTRL 00000ce0 00000020 0000001a 00000006 RWIX
PIE_VECT 00000d00 00000100 00000100 00000000 RWIX
ECAN_A 00006000 00000100 00000000 00000100 RWIX
ECAN_AMBOX 00006100 00000100 00000000 00000100 RWIX
SYSTEM 00007010 00000020 00000020 00000000 RWIX
SPI_A 00007040 00000010 00000010 00000000 RWIX
SCI_A 00007050 00000010 00000010 00000000 RWIX
XINTRUPT 00007070 00000010 00000010 00000000 RWIX
GPIOMUX 000070c0 00000020 00000020 00000000 RWIX
GPIODAT 000070e0 00000020 00000020 00000000 RWIX
ADC 00007100 00000020 0000001a 00000006 RWIX
EV_A 00007400 00000040 00000032 0000000e RWIX
EV_B 00007500 00000040 00000032 0000000e RWIX
SPI_B 00007740 00000010 00000000 00000010 RWIX
SCI_B 00007750 00000010 00000010 00000000 RWIX
MCBSP_A 00007800 00000040 00000025 0000001b RWIX
L0_SARAM 00008000 00001000 000000a2 00000f5e RWIX
L1_SARAM 00009000 00001000 00000000 00001000 RWIX
ZONE6 00100000 00010000 00000000 00010000 RWIX
CSM_PWL 003f7ff8 00000008 00000008 00000000 RWIX
SECTION ALLOCATION MAP
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
.text 0 003f8000 0000036b
003f8000 0000010d Park.obj (.text)
003f810d 00000075 DSP28_Xintf.obj (.text)
003f8182 0000004b rts2800_ml.lib : exit.obj (.text)
003f81cd 00000047 ConfiguraEV.obj (.text)
003f8214 00000046 rts2800_ml.lib : boot.obj (.text)
003f825a 00000042 00Main.obj (.text)
003f829c 00000038 ConfiguraIO.obj (.text)
003f82d4 00000025 Clark.obj (.text)
003f82f9 00000021 DSP28_PieCtrl.obj (.text)
003f831a 0000001f DSP28_SysCtrl.obj (.text)
003f8339 00000014 qmath.lib : qcoslt.obj (.text)
003f834d 00000011 qsinlt.obj (.text)
003f835e 00000009 rts2800_ml.lib : _lock.obj (.text)
003f8367 00000004 DSP28_usDelay.obj (.text)
ramfuncs 0 003f8000 00000015 DSECT
003f8000 00000015 DSP28_SysCtrl.obj (ramfuncs)
SINTBL 0 003f836b 00000101
003f836b 00000101 qmath.lib : sintb360.obj (SINTBL)
.cinit 0 003f846c 0000001a
003f846c 0000000e rts2800_ml.lib : exit.obj (.cinit)
003f847a 0000000a : _lock.obj (.cinit)
003f8484 00000002 --HOLE-- [fill = 0]
.reset 0 003fffc0 00000002 DSECT
003fffc0 00000002 rts2800_ml.lib : boot.obj (.reset)
.stack 1 00000400 00000400 UNINITIALIZED
00000400 00000400 --HOLE--
DevEmuRegsFile
* 1 00000880 000000d6 UNINITIALIZED
00000880 000000d6 DSP28_GlobalVariableDefs.obj (DevEmuRegsFile)
FlashRegsFile
* 1 00000a80 00000008 UNINITIALIZED
00000a80 00000008 DSP28_GlobalVariableDefs.obj (FlashRegsFile)
CsmRegsFile
* 1 00000ae0 00000010 UNINITIALIZED
00000ae0 00000010 DSP28_GlobalVariableDefs.obj (CsmRegsFile)
XintfRegsFile
* 1 00000b20 00000020 UNINITIALIZED
00000b20 00000020 DSP28_GlobalVariableDefs.obj (XintfRegsFile)
CpuTimer0RegsFile
* 1 00000c00 00000008 UNINITIALIZED
00000c00 00000008 DSP28_GlobalVariableDefs.obj (CpuTimer0RegsFile)
PieCtrlRegsFile
* 1 00000ce0 0000001a UNINITIALIZED
00000ce0 0000001a DSP28_GlobalVariableDefs.obj (PieCtrlRegsFile)
PieVectTable
* 1 00000d00 00000100 UNINITIALIZED
00000d00 00000100 DSP28_GlobalVariableDefs.obj (PieVectTable)
SysCtrlRegsFile
* 1 00007010 00000020 UNINITIALIZED
00007010 00000020 DSP28_GlobalVariableDefs.obj (SysCtrlRegsFile)
SpiaRegsFile
* 1 00007040 00000010 UNINITIALIZED
00007040 00000010 DSP28_GlobalVariableDefs.obj (SpiaRegsFile)
SciaRegsFile
* 1 00007050 00000010 UNINITIALIZED
00007050 00000010 DSP28_GlobalVariableDefs.obj (SciaRegsFile)
XIntruptRegsFile
* 1 00007070 00000010 UNINITIALIZED
00007070 00000010 DSP28_GlobalVariableDefs.obj (XIntruptRegsFile)
GpioMuxRegsFile
* 1 000070c0 00000020 UNINITIALIZED
000070c0 00000020 DSP28_GlobalVariableDefs.obj (GpioMuxRegsFile)
GpioDataRegsFile
* 1 000070e0 00000020 UNINITIALIZED
000070e0 00000020 DSP28_GlobalVariableDefs.obj (GpioDataRegsFile)
AdcRegsFile
* 1 00007100 0000001a UNINITIALIZED
00007100 0000001a DSP28_GlobalVariableDefs.obj (AdcRegsFile)
EvaRegsFile
* 1 00007400 00000032 UNINITIALIZED
00007400 00000032 DSP28_GlobalVariableDefs.obj (EvaRegsFile)
EvbRegsFile
* 1 00007500 00000032 UNINITIALIZED
00007500 00000032 DSP28_GlobalVariableDefs.obj (EvbRegsFile)
ScibRegsFile
* 1 00007750 00000010 UNINITIALIZED
00007750 00000010 DSP28_GlobalVariableDefs.obj (ScibRegsFile)
McbspaRegsFile
* 1 00007800 00000025 UNINITIALIZED
00007800 00000025 DSP28_GlobalVariableDefs.obj (McbspaRegsFile)
.bss 1 00008000 00000000 UNINITIALIZED
.ebss 1 00008000 000000a2 UNINITIALIZED
00008000 00000080 rts2800_ml.lib : exit.obj (.ebss)
00008080 00000016 Park.obj (.ebss)
00008096 00000006 Clark.obj (.ebss)
0000809c 00000004 rts2800_ml.lib : _lock.obj (.ebss)
000080a0 00000002 00Main.obj (.ebss)
CsmPwlFile
* 1 003f7ff8 00000008 UNINITIALIZED
003f7ff8 00000008 DSP28_GlobalVariableDefs.obj (CsmPwlFile)
GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name
address name
-------- ----
00008000 .bss
003f8000 .text
003f81a8 C$$EXIT
003f836b SINTAB_360
00007100 _AdcRegs
003f81cd _ConfiguraEVA
003f81fc _ConfiguraEVB
003f829c _ConfiguraIO
00000c00 _CpuTimer0Regs
003f7ff8 _CsmPwl
00000ae0 _CsmRegs
003f8367 _DSP28x_usDelay
00000880 _DevEmuRegs
00007400 _EvaRegs
00007500 _EvbRegs
00000a80 _FlashRegs
000070e0 _GpioDataRegs
000070c0 _GpioMuxRegs
003f8000 _InitFlash
003f82f9 _InitPieCtrl
003f831a _InitSysCtrl
003f810d _InitXintf
00007800 _McbspaRegs
00000ce0 _PieCtrlRegs
00000d00 _PieVectTable
00007050 _SciaRegs
00007750 _ScibRegs
00007040 _SpiaRegs
00007010 _SysCtrlRegs
00007070 _XIntruptRegs
00000b20 _XintfRegs
00000800 __STACK_END
00000400 __STACK_SIZE
ffffffff ___binit__
00008000 ___bss__
ffffffff ___c_args__
003f846c ___cinit__
00008000 ___end__
003f836b ___etext__
ffffffff ___pinit__
003f8000 ___text__
00008004 __cleanup_ptr
00008002 __dtors_ptr
0000809e __lock
003f835e __nop
003f835f __register_lock
003f8363 __register_unlock
0000809c __unlock
0000808d _a_Q14
003f8068 _abc20
003f8000 _abc2d
003f8034 _abc2q
003f81cc _abort
00008096 _alfa16
0000809a _alfa32
00008092 _alfa_16
0000808c _alfa_Q14
003f82d4 _alfa_clark
003f81aa _atexit
00008086 _aux1
00008081 _aux2
00008080 _aux3
00008085 _aux4
00008088 _b_Q14
00008097 _beta16
00008098 _beta32
0000808e _beta_16
00008089 _beta_Q14
003f82e8 _beta_clark
00008087 _c_Q14
003f8214 _c_int00
00008084 _d16
00008090 _d32
003f8076 _dq2a
003f80d8 _dq2alfa
003f8094 _dq2b
003f80f3 _dq2beta
003f80b6 _dq2c
003f8182 _exit
000080a0 _ic
00008082 _idp_Q14
000080a1 _ig
003f8295 _inicia_contador
0000808a _iop_Q14
0000808b _iqp_Q14
003f825a _main
00008083 _q16
00008094 _q32
003f8339 _qcoslt
003f834d _qsinlt
ffffffff binit
003f846c cinit
00008000 end
003f836b etext
ffffffff pinit
GLOBAL SYMBOLS: SORTED BY Symbol Address
address name
-------- ----
00000400 __STACK_SIZE
00000800 __STACK_END
00000880 _DevEmuRegs
00000a80 _FlashRegs
00000ae0 _CsmRegs
00000b20 _XintfRegs
00000c00 _CpuTimer0Regs
00000ce0 _PieCtrlRegs
00000d00 _PieVectTable
00007010 _SysCtrlRegs
00007040 _SpiaRegs
00007050 _SciaRegs
00007070 _XIntruptRegs
000070c0 _GpioMuxRegs
000070e0 _GpioDataRegs
00007100 _AdcRegs
00007400 _EvaRegs
00007500 _EvbRegs
00007750 _ScibRegs
00007800 _McbspaRegs
00008000 .bss
00008000 ___bss__
00008000 ___end__
00008000 end
00008002 __dtors_ptr
00008004 __cleanup_ptr
00008080 _aux3
00008081 _aux2
00008082 _idp_Q14
00008083 _q16
00008084 _d16
00008085 _aux4
00008086 _aux1
00008087 _c_Q14
00008088 _b_Q14
00008089 _beta_Q14
0000808a _iop_Q14
0000808b _iqp_Q14
0000808c _alfa_Q14
0000808d _a_Q14
0000808e _beta_16
00008090 _d32
00008092 _alfa_16
00008094 _q32
00008096 _alfa16
00008097 _beta16
00008098 _beta32
0000809a _alfa32
0000809c __unlock
0000809e __lock
000080a0 _ic
000080a1 _ig
003f7ff8 _CsmPwl
003f8000 .text
003f8000 _InitFlash
003f8000 ___text__
003f8000 _abc2d
003f8034 _abc2q
003f8068 _abc20
003f8076 _dq2a
003f8094 _dq2b
003f80b6 _dq2c
003f80d8 _dq2alfa
003f80f3 _dq2beta
003f810d _InitXintf
003f8182 _exit
003f81a8 C$$EXIT
003f81aa _atexit
003f81cc _abort
003f81cd _ConfiguraEVA
003f81fc _ConfiguraEVB
003f8214 _c_int00
003f825a _main
003f8295 _inicia_contador
003f829c _ConfiguraIO
003f82d4 _alfa_clark
003f82e8 _beta_clark
003f82f9 _InitPieCtrl
003f831a _InitSysCtrl
003f8339 _qcoslt
003f834d _qsinlt
003f835e __nop
003f835f __register_lock
003f8363 __register_unlock
003f8367 _DSP28x_usDelay
003f836b SINTAB_360
003f836b ___etext__
003f836b etext
003f846c ___cinit__
003f846c cinit
ffffffff ___binit__
ffffffff ___c_args__
ffffffff ___pinit__
ffffffff binit
ffffffff pinit
[95 symbols]
Thank you
Janderson
Hello, I've been doing some more tests and still not working. One thing that I changed the dynamic memory allocation, you can see attached. It also follows a figure showing the debug disassembly. Another thing is the error that gave "No source available for" 0x3ffc00 "" is also attached.
I was thinking, could not be in the file .cmd I use? maybe he is not allocating space for global variables in ram.
Thank you
Janderson
Hi. the examples in the CD for this board is made in CCs 3.1. Dont you have a complete example for TMS320r2812 in CCS 5.4? An example with interruption, PWM, ADC? thank you