Technical discussions about the TI C28x DSPs (including the C2810, C2811, C2812, F2801, F2806, F2808, F2810,, F2811, F2812, R2811 and R2812).
Hi, I'm trying to learn programming the F2812 using my DSP Board (eZdspF2812 from Spectrum Digital) for my Term Project. I need to use its PWM generators and ADC. I looked at the PWM Example of TI (sprc097) and ran it on the Board succesfully. My questions are: 1- What do i need to do in order to make the DSP run the example while the Board isn't connected to a computer?(The code should be written to Flash and it should execute when i apply power to the board) 2- How can i write a linker command file? I can't understand how they're written. Thank you in advance You can post a message or access and search the archives of this group on DSPRelated.com: http://www.dsprelated.com/groups/c28x/1.php _____________________________________
1 - try SPRA958 document from TI. Be sure that you place your "reset jump" to correct address (I think 0x3F7F7E). Be sure that the bootloader mode is set to flash (there should be some jumpers on the board). 2 - I think there are some exmaples in SPRA958. You can also refer to CGT (Code Generation Tools) manual - you can found it in CCS IDE help. If you will have still problems with cmd files, please send an example :). JkH Salih Cihan Tek napsal(a): > Hi, > > I'm trying to learn programming the F2812 using my DSP Board > (eZdspF2812 from Spectrum Digital) for my Term Project. I need to use > its PWM generators and ADC. I looked at the PWM Example of TI (sprc097) > and ran it on the Board succesfully. My questions are: > > 1- What do i need to do in order to make the DSP run the example while > the Board isn't connected to a computer?(The code should be written to > Flash and it should execute when i apply power to the board) > > 2- How can i write a linker command file? I can't understand how > they're written. > > Thank you in advance -- Ing. Jan Humpl vývojový pracovník / development engineer tel.: (+420) 251 115 266, (+420) 777 343 884 fax: (+420) 251 115 255 e-mail: h...@poll.cz http://www.poll.cz POLL, s.r.o. Křížová 3/3132, 150 00 Praha 5 You can post a message or access and search the archives of this group on DSPRelated.com: http://www.dsprelated.com/groups/c28x/1.php _____________________________________
Thanks for the response! I looked at the CGT docs and they were very helpful. I have one more=20 question. In the docs it says: .text section usually contains executable code and mapped to ROM .data section usually contains initialized data and mapped to EEPROM .bss section usually reserves space for uninitialized variables=20 and mapped to ROM According to these explanations, if i write the code below without=20 specifying any other mapping rule=20 Uint16 a =3D 100; Unit16 b;=20 ... b =3D result of some calculation Will the linker save the code to ROM and put the variables a and b in=20 EEPROM and ROM respectively (by giving them appropriate adresses in=20 the asm code)?=20 The variables will be put in RAM or EEPROM when the program is=20 running on the dsp right?=20 If i understand it correctly, the only thing this mapping stuff does=20 for the variables is to change their adresses in the asm code (Which=20 will be in ROM). Please tell me if i'm thinking wrong. Any help will be appreciated:)=20 --- In c...@yahoogroups.com, Jan Humpl <humpl@...> wrote: > >=20 > 1 - try SPRA958 document from TI. Be sure that you place=20 your "reset=20 > jump" to correct address (I think 0x3F7F7E). Be sure that the=20 bootloader=20 > mode is set to flash (there should be some jumpers on the board). >=20 > 2 - I think there are some exmaples in SPRA958. You can also refer=20 to=20 > CGT (Code Generation Tools) manual - you can found it in CCS IDE=20 help.=20 > If you will have still problems with cmd files, please send an=20 example :). >=20 > JkH >=20 >=20 > Salih Cihan Tek napsal(a): > >=20 > >=20 > > Hi, > >=20 > > I'm trying to learn programming the F2812 using my DSP Board > > (eZdspF2812 from Spectrum Digital) for my Term Project. I need to=20 use > > its PWM generators and ADC. I looked at the PWM Example of TI=20 (sprc097) > > and ran it on the Board succesfully. My questions are: > >=20 > > 1- What do i need to do in order to make the DSP run the example=20 while > > the Board isn't connected to a computer?(The code should be=20 written to > > Flash and it should execute when i apply power to the board) > >=20 > > 2- How can i write a linker command file? I can't understand how > > they're written. > >=20 > > Thank you in advance > >=20 > >=20 >=20 > --=20 > Ing. Jan Humpl > v=C3=BDvojov=C3=BD pracovn=C3=ADk / development engineer > tel.: (+420) 251 115 266, (+420) 777 343 884 > fax: (+420) 251 115 255 > e-mail: humpl@... > http://www.poll.cz >=20 > POLL, s.r.o. > K=C5=99=C3=AD=C5=BEov=C3=A1 3/3132, 150 00 Praha 5 > You can post a message or access and search the archives of this group on D= SPRelated.com: http://www.dsprelated.com/groups/c28x/1.php _____________________________________ =20
Se my comments in your text bellow:
Salih Cihan Tek napsal(a):
> Thanks for the response!
>
> I looked at the CGT docs and they were very helpful. I have one more
> question. In the docs it says:
>
> .text section usually contains executable code and mapped to ROM
> .data section usually contains initialized data and mapped to EEPROM
> .bss section usually reserves space for uninitialized variables
> and mapped to ROM
>
The docs says "usually", that means the section is mapped to the memory
block, which you define in cmd file. For example:
MEMORY
{
PAGE 0 :
AP_PFLASH : origin = 0x3E8024, length = 0x00BFDA
PAGE 1 :
AP_DRAM : origin = 0x008000, length = 0x001000
}
SECTIONS
{
.text : > AP_PFLASH, PAGE = 0
.bss : > AP_DRAM, PAGE = 1
}
means .text section will be in FLASH, because address 0x3E8024 is flash
:). And .bss section will be in L0 RAM.
> According to these explanations, if i write the code below without
> specifying any other mapping rule
>
> Uint16 a = 100;
> Unit16 b;
> ...
> b = result of some calculation
>
> Will the linker save the code to ROM and put the variables a and b in
> EEPROM and ROM respectively (by giving them appropriate adresses in
> the asm code)?
> The variables will be put in RAM or EEPROM when the program is
> running on the dsp right?
>
No. The linker put the code to .text section and a and b variables to
.bss section. It also put "100" to .data section, which will be used to
initialize b.
It is essential to put .bss section to RAM, because if you put it to
FLASH, the variables will not be writeable :). The best location for
.data is flash (there is no EEPROM on F2812). And .text section should
be put in flash (although you can run code from RAM, but you must
initialize if from flash before that).
> If i understand it correctly, the only thing this mapping stuff does
> for the variables is to change their adresses in the asm code (Which
> will be in ROM). Please tell me if i'm thinking wrong.
>
Yes. The compiler generates code which contains symbols instead
addresses. And linker replace symbols with addresses according to
section definitions.
It is also essential to initialize flash registers correctly if you want
to run your code from flash. The dafault setting is safe but very slow
:). You must change the setting according to your oscilator and PLL
configuration. Please refer to SPRA958. Although the TI documentation is
not very "human-readable", it is sometimes usefull :).
I'm sorry, I will not be in work next two weeks and I can't ensure, that
I will reply your emails. So if you have any questions yet, I will reply
after 7th January.
have a nice holidays :)
> Any help will be appreciated:)
>
> --- In c...@yahoogroups.com <mailto:c28x%40yahoogroups.com>, Jan Humpl
> <humpl@...> wrote:
> >
> >
> > 1 - try SPRA958 document from TI. Be sure that you place
> your "reset
> > jump" to correct address (I think 0x3F7F7E). Be sure that the
> bootloader
> > mode is set to flash (there should be some jumpers on the board).
> >
> > 2 - I think there are some exmaples in SPRA958. You can also refer
> to
> > CGT (Code Generation Tools) manual - you can found it in CCS IDE
> help.
> > If you will have still problems with cmd files, please send an
> example :).
> >
> > JkH
> >
> >
> > Salih Cihan Tek napsal(a):
> > >
> > >
> > > Hi,
> > >
> > > I'm trying to learn programming the F2812 using my DSP Board
> > > (eZdspF2812 from Spectrum Digital) for my Term Project. I need to
> use
> > > its PWM generators and ADC. I looked at the PWM Example of TI
> (sprc097)
> > > and ran it on the Board succesfully. My questions are:
> > >
> > > 1- What do i need to do in order to make the DSP run the example
> while
> > > the Board isn't connected to a computer?(The code should be
> written to
> > > Flash and it should execute when i apply power to the board)
> > >
> > > 2- How can i write a linker command file? I can't understand how
> > > they're written.
> > >
> > > Thank you in advance
> > >
> > >
> >
> > --
> > Ing. Jan Humpl
> > vývojový pracovník / development engineer
> > tel.: (+420) 251 115 266, (+420) 777 343 884
> > fax: (+420) 251 115 255
> > e-mail: humpl@...
> > http://www.poll.cz <http://www.poll.cz>
> >
> > POLL, s.r.o.
> > Křížová 3/3132, 150 00 Praha 5
> >
You can post a message or access and search the archives of this group on DSPRelated.com:
http://www.dsprelated.com/groups/c28x/1.php
_____________________________________
Thank you very much for taking your time to answer my questions.
I don't have anthing else to ask for now.
Happy holidays:)
--- In c...@yahoogroups.com, Jan Humpl <humpl@...> wrote:
>
> Se my comments in your text bellow:
>=20
> Salih Cihan Tek napsal(a):
> >=20
> >=20
> > Thanks for the response!
> >=20
> > I looked at the CGT docs and they were very helpful. I have one=20
more
> > question. In the docs it says:
> >=20
> > .text section usually contains executable code and mapped to ROM
> > .data section usually contains initialized data and mapped to=20
EEPROM
> > .bss section usually reserves space for uninitialized variables
> > and mapped to ROM
> >=20
>=20
> The docs says "usually", that means the section is mapped to the=20
memory=20
> block, which you define in cmd file. For example:
>=20
> MEMORY
> {
> PAGE 0 :
> AP_PFLASH : origin =3D 0x3E8024, length =3D 0x00BFDA
> PAGE 1 :
> AP_DRAM : origin =3D 0x008000, length =3D 0x001000
> }
>=20
> SECTIONS
> {
> .text : > AP_PFLASH, PAGE =3D 0
> .bss : > AP_DRAM, PAGE =3D 1
> }
>=20
> means .text section will be in FLASH, because address 0x3E8024 is=20
flash=20
> :). And .bss section will be in L0 RAM.
>=20
> > According to these explanations, if i write the code below without
> > specifying any other mapping rule
> >=20
> > Uint16 a =3D 100;
> > Unit16 b;
> > ...
> > b =3D result of some calculation
> >=20
> > Will the linker save the code to ROM and put the variables a and=20
b in
> > EEPROM and ROM respectively (by giving them appropriate adresses=20
in
> > the asm code)?
> > The variables will be put in RAM or EEPROM when the program is
> > running on the dsp right?
> >=20
>=20
> No. The linker put the code to .text section and a and b variables=20
to=20
> .bss section. It also put "100" to .data section, which will be=20
used to=20
> initialize b.
>=20
> It is essential to put .bss section to RAM, because if you put it=20
to=20
> FLASH, the variables will not be writeable :). The best location=20
for=20
> .data is flash (there is no EEPROM on F2812). And .text section=20
should=20
> be put in flash (although you can run code from RAM, but you must=20
> initialize if from flash before that).
>=20
> > If i understand it correctly, the only thing this mapping stuff=20
does
> > for the variables is to change their adresses in the asm code=20
(Which
> > will be in ROM). Please tell me if i'm thinking wrong.
> >=20
>=20
> Yes. The compiler generates code which contains symbols instead=20
> addresses. And linker replace symbols with addresses according to=20
> section definitions.
>=20
>=20
> It is also essential to initialize flash registers correctly if you=20
want=20
> to run your code from flash. The dafault setting is safe but very=20
slow=20
> :). You must change the setting according to your oscilator and PLL=20
> configuration. Please refer to SPRA958. Although the TI=20
documentation is=20
> not very "human-readable", it is sometimes usefull :).
>=20
>=20
> I'm sorry, I will not be in work next two weeks and I can't ensure,=20
that=20
> I will reply your emails. So if you have any questions yet, I will=20
reply=20
> after 7th January.
>=20
> have a nice holidays :)
>=20
> > Any help will be appreciated:)
> >=20
> > --- In c...@yahoogroups.com <mailto:c28x%40yahoogroups.com>, Jan=20
Humpl=20
> > <humpl@> wrote:
> > >
> > >
> > > 1 - try SPRA958 document from TI. Be sure that you place
> > your "reset
> > > jump" to correct address (I think 0x3F7F7E). Be sure that the
> > bootloader
> > > mode is set to flash (there should be some jumpers on the=20
board).
> > >
> > > 2 - I think there are some exmaples in SPRA958. You can also=20
refer
> > to
> > > CGT (Code Generation Tools) manual - you can found it in CCS=20
IDE
> > help.
> > > If you will have still problems with cmd files, please send an
> > example :).
> > >
> > > JkH
> > >
> > >
> > > Salih Cihan Tek napsal(a):
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I'm trying to learn programming the F2812 using my DSP Board
> > > > (eZdspF2812 from Spectrum Digital) for my Term Project. I=20
need to
> > use
> > > > its PWM generators and ADC. I looked at the PWM Example of TI
> > (sprc097)
> > > > and ran it on the Board succesfully. My questions are:
> > > >
> > > > 1- What do i need to do in order to make the DSP run the=20
example
> > while
> > > > the Board isn't connected to a computer?(The code should be
> > written to
> > > > Flash and it should execute when i apply power to the board)
> > > >
> > > > 2- How can i write a linker command file? I can't understand=20
how
> > > > they're written.
> > > >
> > > > Thank you in advance
> > > >
> > > >
> > >
> > > --
> > > Ing. Jan Humpl
> > > v=C3=BDvojov=C3=BD pracovn=C3=ADk / development engineer
> > > tel.: (+420) 251 115 266, (+420) 777 343 884
> > > fax: (+420) 251 115 255
> > > e-mail: humpl@
> > > http://www.poll.cz <http://www.poll.cz>
> > >
> > > POLL, s.r.o.
> > > K=C5=99=C3=AD=C5=BEov=C3=A1 3/3132, 150 00 Praha 5
> > >
> >=20
>
You can post a message or access and search the archives of this group on D=
SPRelated.com:
http://www.dsprelated.com/groups/c28x/1.php
_____________________________________
=20
Hello, 1 - try do run dsp simulator --> look on the CCstudio setup ... Regards Bernard ----- Original Message ----- From: Salih Cihan Tek To: c...@yahoogroups.com Sent: Monday, December 17, 2007 7:58 PM Subject: [c28x] How to run F2812 examples while the board isn't connected to a PC Hi, I'm trying to learn programming the F2812 using my DSP Board (eZdspF2812 from Spectrum Digital) for my Term Project. I need to use its PWM generators and ADC. I looked at the PWM Example of TI (sprc097) and ran it on the Board succesfully. My questions are: 1- What do i need to do in order to make the DSP run the example while the Board isn't connected to a computer?(The code should be written to Flash and it should execute when i apply power to the board) 2- How can i write a linker command file? I can't understand how they're written. Thank you in advance