Reply by Bernard Szymanski December 23, 20072007-12-23
Hello,

1 - try do run dsp simulator --> look on the CCstudio setup ...

Regards

Bernard
----- Original Message -----
From: Salih Cihan Tek
To: c...
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
Reply by Salih Cihan Tek December 23, 20072007-12-23
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..., Jan Humpl wrote:
>
> 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... , Jan
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
> > >
> > > POLL, s.r.o.
> > > Křížová 3/3132, 150 00 Praha 5
> > >
> >
>




Reply by Jan Humpl December 20, 20072007-12-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... , Jan 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
> >
> > POLL, s.r.o.
> > Křížová 3/3132, 150 00 Praha 5
> >
Reply by Salih Cihan Tek December 19, 20072007-12-19
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

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?

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.

Any help will be appreciated:)
--- In c..., Jan 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
>
> POLL, s.r.o.
> Křížová 3/3132, 150 00 Praha 5
>




Reply by Jan Humpl December 19, 20072007-12-19
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
Reply by Salih Cihan Tek December 18, 20072007-12-18
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