Hi,
As we know that harvard architecture has different address lines for data and code. It means that harvard architecture has same address for address for code and data. for example address 0 for RAM has data, while address 0 for flash has code.
TMS320C6713 is based on Harvard architecture. Then how can i write *.cmd file for harvard architecture?
example:
Memory
{ CACHE: origin=0x00000000, len=0x00030000
FLASH: origin=?
}
cmd file of Harvard architecture
-
- Lieutenant
- Posts: 92
- Joined: Tue Oct 27, 2009 7:50 pm
Re: cmd file of Harvard architecture
I think your processing architecture is VelociTI very-long-instruction-word (VLIW) ?
In C6000, you can use each memory section as 'only code', 'only data' or 'both code and data' in these DSPs as you prefer.
As a practice, I used to separate out code and data in to two sections (for safety) though it is not necessary.
Since you are trying to specify something on Flash, I doubt that you misunderstood burning firmware to Flash under DSPs.
If you have enough Internal RAM and External RAM, you can allocate all your code and data to RAM. Then generate the .out file. After that you will write this file using the provided Flashing utility to your Flash. Then you set your boot device as Flash.
At boot time, the bootloader will load the code in Flash to RAM as specified by you and pass the control to RAM (Entry Point).
However, if you are going to run everything from Flash (which not quite usual in C6000 chips as we have enough IRAM and External RAM), then you need to specify the sections to Flash.
A good exercise would be, write a program which is 100% in RAM, Burn it to Flash, Boot from Flash and see how it goes.
In C6000, you can use each memory section as 'only code', 'only data' or 'both code and data' in these DSPs as you prefer.
As a practice, I used to separate out code and data in to two sections (for safety) though it is not necessary.
Since you are trying to specify something on Flash, I doubt that you misunderstood burning firmware to Flash under DSPs.
If you have enough Internal RAM and External RAM, you can allocate all your code and data to RAM. Then generate the .out file. After that you will write this file using the provided Flashing utility to your Flash. Then you set your boot device as Flash.
At boot time, the bootloader will load the code in Flash to RAM as specified by you and pass the control to RAM (Entry Point).
However, if you are going to run everything from Flash (which not quite usual in C6000 chips as we have enough IRAM and External RAM), then you need to specify the sections to Flash.
A good exercise would be, write a program which is 100% in RAM, Burn it to Flash, Boot from Flash and see how it goes.
-
- Lieutenant
- Posts: 92
- Joined: Tue Oct 27, 2009 7:50 pm
Re: cmd file of Harvard architecture
Thanks Neo,
You are right. but suppose if my code is bigger than the internal RAM of DSP. then i have to place the code in flash too. how should i write code for that as DSP is based on Harvard Architecture.
Second thing, if i have burned the code into flash, will this code include the bootloader program for DSP to fetch code from Flash or will it do automatically?
Thanks & Regards
Sukhdeep Singh
You are right. but suppose if my code is bigger than the internal RAM of DSP. then i have to place the code in flash too. how should i write code for that as DSP is based on Harvard Architecture.
Second thing, if i have burned the code into flash, will this code include the bootloader program for DSP to fetch code from Flash or will it do automatically?
Thanks & Regards
Sukhdeep Singh
Re: cmd file of Harvard architecture
If you like you can reserve flash pages for data and code. But I do not see any problem in keeping both code and data in a single page in this architecture. You just need to define the memory addresses to avoid overlapping code and data.
Magneto has done lots of flash based firmwares on C2000 platform. When I had a brief discussion with him, he told me, he stored both code and data on the same flash page on his work without any problem. He will add his comments later hopefully.
Magneto has done lots of flash based firmwares on C2000 platform. When I had a brief discussion with him, he told me, he stored both code and data on the same flash page on his work without any problem. He will add his comments later hopefully.
-
- Lieutenant
- Posts: 92
- Joined: Tue Oct 27, 2009 7:50 pm
Re: cmd file of Harvard architecture
Thanks,
Will DSP automatically pickup the code written into the flash or i need to write code,so that it will start fetching code from flash?
Will DSP automatically pickup the code written into the flash or i need to write code,so that it will start fetching code from flash?
Re: cmd file of Harvard architecture
Dear Friend ,
It seems your DSP have not any internal Flash , so if you want to use Flash memory , you have to connect an external Flash Chip to External Interface of DSP. If you see the memory map of your DSP , it seems there is unique ID range ( 0x0180 0000 to 0x 0183 FFFF ) . So every memory location in your DSP can address with a unique ID whether they are RAM or Flash with in single bus.
Normally there is a boot rom in every TI DSP , so I think your DSP also have that. When you first power up the DSP , it will jump to this Boot ROM and then according to few GPIO settings it will jump to the first address of RAM or External Interface ( in your case FLASH). You have to find this GPIO HIGH LOW settings , which want to jump your DSP to External interface ( Flash). It should contain in the data sheet.
So then you have to keep the first instruction of your program , at the beginning address of external interface ( i.e. 0x0180 0000 ). Then after power up , it will execute instructions from the beginning of the flash
Regards,
Magneto
It seems your DSP have not any internal Flash , so if you want to use Flash memory , you have to connect an external Flash Chip to External Interface of DSP. If you see the memory map of your DSP , it seems there is unique ID range ( 0x0180 0000 to 0x 0183 FFFF ) . So every memory location in your DSP can address with a unique ID whether they are RAM or Flash with in single bus.
Normally there is a boot rom in every TI DSP , so I think your DSP also have that. When you first power up the DSP , it will jump to this Boot ROM and then according to few GPIO settings it will jump to the first address of RAM or External Interface ( in your case FLASH). You have to find this GPIO HIGH LOW settings , which want to jump your DSP to External interface ( Flash). It should contain in the data sheet.
So then you have to keep the first instruction of your program , at the beginning address of external interface ( i.e. 0x0180 0000 ). Then after power up , it will execute instructions from the beginning of the flash
Regards,
Magneto
-
- Lieutenant
- Posts: 92
- Joined: Tue Oct 27, 2009 7:50 pm
Re: cmd file of Harvard architecture
Thanks Magneto and Neo,
I am using TMS320C6713B DSP processor and it has
1) EMIF CE0 0x80000000
2) EMIF CE0 0x90000000
3) EMIF CE0 0xA0000000
4) EMIF CE0 0xB0000000
where suppose external flash is connected to EMIF CE1.
c code
#include.......
int main()
{
.........
}
Now Cmd file
MEMORY
{ FLASH: origin=0x90000000 len=0x00080000
RAM: origin=0x00000000 len=0x00030000
}
SECTIONS
{ .text > FLASH
.cinit > RAM
}
Am i right? if wrong, please correct me.
Regards
I am using TMS320C6713B DSP processor and it has
1) EMIF CE0 0x80000000
2) EMIF CE0 0x90000000
3) EMIF CE0 0xA0000000
4) EMIF CE0 0xB0000000
where suppose external flash is connected to EMIF CE1.
c code
#include.......
int main()
{
.........
}
Now Cmd file
MEMORY
{ FLASH: origin=0x90000000 len=0x00080000
RAM: origin=0x00000000 len=0x00030000
}
SECTIONS
{ .text > FLASH
.cinit > RAM
}
Am i right? if wrong, please correct me.
Regards
Re: cmd file of Harvard architecture
Seems correct. Are you using the DSK from Spectrum Digital?
-
- Lieutenant
- Posts: 92
- Joined: Tue Oct 27, 2009 7:50 pm
Re: cmd file of Harvard architecture
Thanks.
Yes, i am using DSK for TMS320C6713.
Yes, i am using DSK for TMS320C6713.
Re: cmd file of Harvard architecture
Is it having a 16 MB RAM connected on CE0 ? If that is the case, are you going to remove it from your final design?