DSPRelated.com
Forums

6701 boot from flash problem

Started by mm_k...@yahoo.com May 13, 2008
Hi, My firends
I desing a 6701 board and try to generate a binery file for flash boot.
but when i try to use hex6x, i don't recieve any warninig but my binery file dosen't work. but if i load my .out file with Emulator, it is ok.
please help me.

My command line for compile and link C program is:

cl6x -c -k -al tst6x.c
lnk6x tst6x.cmd
My .cmd file for linker is:
***************************************
-c
-m tst6x.map
vectors.obj
tst6x.obj
-o tst6x.out
-heap 0x200
-stack 0x200
-l rts6700.lib
MEMORY
{
VECS: o = 00000000h l = 00000200h
PMEM: o = 00000200h l = 0000Fa00h
DMEM: o = 80000000h l = 00010000h
CE0: o = 00400000h l = 01000000h
CE1VECS: o = 01400000h l = 00000200h
CE1PMEM: o = 01400200h l = 0000FC00h
CE1init: o = 01410000h l = 003F0000h
CE2: o = 02000000h l = 01000000h
CE3: o = 03000000h l = 01000000h
}
SECTIONS
{
.vectors : loadVECS, run=VECS
.text : loadPMEM, run=PMEM
.cinit : loadinit, run=DMEM
.const : loadinit, run=DMEM
.data : loadinit, run=DMEM
.cio > DMEM
.far > DMEM
.stack > DMEM
.bss > DMEM
.sysmem > DMEM
}
************************************

and my .cmd file for Hex6x utility is:
************************************
tst6x.out
-b
-byte
-image
-memwidth 8
-romwidth 8
-order L
-map hex.map
ROMS
{
EPROM: org = 0x01400000, length = 0x20000,
files = {tst6x.rom}
}
*************************************

also i want use global initialized variable (like: int a0;) in my C program.

best regards,
kashi
How do you flash your file after generating with he6x?

When you say your file is working, Did you include bootloader in you executable file? do you execute it from address 0 ?
kashi,

Amongst other things, the TMS 320 family is 15 bits wide, not 8 bits
So the options to the Hex6x utility should have (at least) the following changes:
-memwidth 16
-romwidth 16

R. Williams

---------- Original Message -----------
From: m...@yahoo.com
To: c...
Sent: Tue, 13 May 2008 02:41:59 -0400
Subject: [c6x] 6701 boot from flash problem

> Hi, My firends

******************************
>
> and my .cmd file for Hex6x utility is:
> ************************************
> tst6x.out
> -b
> -byte
> -image
> -memwidth 8
> -romwidth 8
> -order L
> -map hex.map
> ROMS
> {
> EPROM: org = 0x01400000, length = 0x20000,
> files = {tst6x.rom}
> }
> *************************************
>
> also i want use global initialized variable (like: int a0;) in my C program.
>
> best regards,
> kashi
------- End of Original Message -------
OOPS,

The memory width is 16, not 15 bits.

(slip of the fingers)

R. Williams
---------- Original Message -----------
From: m...@yahoo.com
To: c...
Sent: Tue, 13 May 2008 02:41:59 -0400
Subject: [c6x] 6701 boot from flash problem

> Hi, My firends
> I desing a 6701 board and try to generate a binery file for flash boot.
> but when i try to use hex6x, i don't recieve any warninig but my binery file dosen't work.
> but if i load my .out file with Emulator, it is ok. please help me.
>
> My command line for compile and link C program is:
>
> cl6x -c -k -al tst6x.c
> lnk6x tst6x.cmd
>
> My .cmd file for linker is:
> ***************************************
> -c
> -m tst6x.map
> vectors.obj
> tst6x.obj
> -o tst6x.out
> -heap 0x200
> -stack 0x200
> -l rts6700.lib
> MEMORY
> {
> VECS: o = 00000000h l = 00000200h
> PMEM: o = 00000200h l = 0000Fa00h
> DMEM: o = 80000000h l = 00010000h
> CE0: o = 00400000h l = 01000000h
> CE1VECS: o = 01400000h l = 00000200h
> CE1PMEM: o = 01400200h l = 0000FC00h
> CE1init: o = 01410000h l = 003F0000h
> CE2: o = 02000000h l = 01000000h
> CE3: o = 03000000h l = 01000000h
> }
> SECTIONS
> {
> .vectors : loadVECS, run=VECS
> .text : loadPMEM, run=PMEM
> .cinit : loadinit, run=DMEM
> .const : loadinit, run=DMEM
> .data : loadinit, run=DMEM
> .cio > DMEM
> .far > DMEM
> .stack > DMEM
> .bss > DMEM
> .sysmem > DMEM
> }
> ************************************
>
> and my .cmd file for Hex6x utility is:
> ************************************
> tst6x.out
> -b
> -byte
> -image
> -memwidth 8
> -romwidth 8
> -order L
> -map hex.map
> ROMS
> {
> EPROM: org = 0x01400000, length = 0x20000,
> files = {tst6x.rom}
> }
> *************************************
>
> also i want use global initialized variable (like: int a0;) in my C program.
>
> best regards,
> kashi
------- End of Original Message -------
The compiler or linker will not include bootloader, if you don't tell it to.
When you say you program it by programmer, what kind of programmer do you use?

If your file doesn't have a bootloader that is 1024 bytes long and that will be transferred automatically to internal DSP RAM at startup, then your application won't start.
those 1024 bytes are supposeed to load your whole application into RAM afterwards (if you intend to execute from RAM).
When you load your application through XDS560, what is the mapping? you must have everything in RAM...

DSP has no magic
> Date: Sun, 18 May 2008 13:16:48 +0000
> From: m...@yahoo.com
> To: c...@hotmail.com
> Subject: Re: 6701 boot from flash problem
>
> Dear christophe
>
> Very tanks for your attention and i'm sory for my late.
> My flash rom is 29lv040 and i program it by programmer . Also i have a
> xds560 Emulator and when i load my .out file via jtag, it is successful.
> I do'nt include bootloader to my file, I think compiler or linker do it.
> Please help me about bootloader.
>
> kashi
>
> --- In c..., christophe blouet
> wrote:
> >
> >
> > How do you flash your file after generating with he6x?
> >
> > When you say your file is working, Did you include bootloader in you
> executable file? do you execute it from address 0 ?
> >
kashi and christophe,

On Sun, May 18, 2008 at 8:34 AM, christophe blouet
wrote:
>
> The compiler or linker will not include bootloader, if you don't tell it to.
> When you say you program it by programmer, what kind of programmer do you
> use?
>
> If your file doesn't have a bootloader that is 1024 bytes long and that will
> be transferred automatically to internal DSP RAM at startup, then your
> application won't start.
> those 1024 bytes are supposeed to load your whole application into RAM
> afterwards (if you intend to execute from RAM).

FYI -
Although newer c6x devices use a 1k boot block, the c620x and c670x
devices use a 64k boot block.

If your app is greater than 64k, you will have to copy the remaining
data to RAM. I suggest that you get it working with an app smaller
than 64k before you worry about a secondary boot loader.

mikedunn

> When you load your application through XDS560, what is the mapping? you must
> have everything in RAM...
>
> DSP has no magic
>> Date: Sun, 18 May 2008 13:16:48 +0000
>> From: m...@yahoo.com
>> To: c...@hotmail.com
>> Subject: Re: 6701 boot from flash problem
>>
>> Dear christophe
>>
>> Very tanks for your attention and i'm sory for my late.
>> My flash rom is 29lv040 and i program it by programmer . Also i have a
>> xds560 Emulator and when i load my .out file via jtag, it is successful.
>> I do'nt include bootloader to my file, I think compiler or linker do it.
>> Please help me about bootloader.
>>
>> kashi
>>
>> --- In c..., christophe blouet
>> wrote:
>> >
>> >
>> > How do you flash your file after generating with he6x?
>> >
>> > When you say your file is working, Did you include bootloader in you
>> executable file? do you execute it from address 0 ?
>> >
>>
>
--
www.dsprelated.com/blogs-1/nf/Mike_Dunn.php