Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Bootloader on TMS320F2812

Status
Not open for further replies.

vhn

Member level 4
Joined
Sep 20, 2006
Messages
74
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,288
Activity points
1,776
tms320f2812 bootloader download

Hi,
I'm working on TI TMS320F2812 DSP. I want to modify the existing boot loader provided by TI and burn it into boot Rom. I searched in TI website. They talk of customizing the boot code but they never explain about how to download the modified code into boot Rom.
Is this possible? Has anyone ever done this before?

Thanks,
vhn
 

tms320f2812 bootloader

You can not modify existing bootloader code in ROM.

You may "tell" uP to start up from somewhere else but not from bootloader ROM.
See document SPRU095 for details :) - it's easily obtainable from google :)
 

Hi Misiek.power,
Thanks for the reply.
If we're not able to modify the boot code, then can we have our own boot code existing in one of the sectors and ensure that it is not overwritten any time?
I want do this because my application calls for maintaining two versions of software in the flash. At runtime, the bootloader should decide which one of them to execute.
One more problem I'm facing is about the compiler pragma directives. If I write in the code "#pragma CODE_SECTION / DATA_SECTION..." and compile, will it attach absolute address to them? If this is the case, my application may not work.
Please suggest.

Thanks,
vhn
 

In one of my projects, where main prog in flash is upgradeable, i prepared code
that i stored in last sector (origin = 0x3F6000, length = 0x001F80). This code ("bootloader") is executed everytime processor starts up.

If specific conditions are met (depends on what value is stored under FLAGA_FLASH address in flash), program waits for data, which are programmed into flash (address range 0x380000 - 0x3F5FFF only - can not overwrite my bootloader :) ).
in other case - it jumps into the main program (which starts from 0x380000).

Such "bootloader" is being written as common program. All You need to do is to tell linker where to store it (you gotta edit *.cmd file related to your project).

Example file is presented below (pay attenttion where *.text section is put (into section named FLASH, which is defined as origin = 0x3F6000, length = 0x001F80):
Code:
/****************************************************************************/
/*   Linker command file for TMS320F2812                                    */
/*   Prepared for standalone-FLASH application                              */
/*   Code stored in FLASH and copied to secure RAM during start-UP          */
/****************************************************************************/
-m pstn.map /*generowanie pliku z mapą symboli w pamięci */

MEMORY
{

PAGE 0:    
   RAML0L1(RWX)     : origin = 0x008000, length = 0x002000  /*==L0L1 SARAM protected */
   FLAGA(RW)		: origin = 0x3F5FFF, length = 0x000001
   FLASH(RWX)		: origin = 0x3F6000, length = 0x001F80
   CSM_RSVD(R)		: origin = 0x3F7F80, length = 0x000076     
   BEGIN_FLASH(RX) 	: origin = 0x3F7FF6, length = 0x000002     
   PASSWORDS(R)   	: origin = 0x3F7FF8, length = 0x000008     
   RESET(RX)       	: origin = 0x3FFFC0, length = 0x000002     

 PAGE 1 :  
   RAMM0(RW)       : origin = 0x000000, length = 0x000400     
   RAMM1(RW)       : origin = 0x000400, length = 0x000400     
   RAMH0(RW)   	   : origin = 0x3F8002, length = 0x001FFE     
   PIEVT(RW)   	   : origin = 0x000d02, length = 0xfe            
}
 
SECTIONS
{

   Flash28_API:
   {
        -lFlash2812_API_V210.lib(.econst) 
        -lFlash2812_API_V210.lib(.text)
   }                   LOAD = FLASH, 
                       RUN = RAML0L1, 
                       LOAD_START(_Flash28_API_LoadStart),
                       LOAD_END(_Flash28_API_LoadEnd),
                       RUN_START(_Flash28_API_RunStart),
                       PAGE = 0

/*domyslna lokalizacja sekcji, gdy brak dla nich pragm xxxx_SECTION*/
/*opisy obszarów skopiowane z PDFów różnych SPRUxxx*/
   .text             : > FLASH,         PAGE = 0 /*Executable code and floating-point constants*/
   .cinit            : > FLASH,         PAGE = 0  /*Tables for explicitly initialized global and static variables*/
   .reset            : > RESET,         PAGE = 0, TYPE = DSECT  /* DSECT = DUMMY SECTION*/
   .cio              : > RAMM0,            PAGE = 1		/*Data Section (.cio) RAM*/
   .ebss             : > RAMH0             PAGE = 1   /*Far global/static variables*/
   .econst           : > FLASH, 		   PAGE = 0     /*Far constant variables*/
   .stack            : > RAMM1,            PAGE = 1   /*Stack space*/
   .esysmem          : > RAMM0,            PAGE = 1   /*for far_malloc functions*/
   codestart         : > BEGIN_FLASH,      PAGE = 0		/*contains a long branch to the C-environment setup routine.*/
   csm_rsvd          : > CSM_RSVD,         PAGE = 0    /*obszar,który musi być wyzerowany, aby CSM chronił układ*/         
   passwords         : > PASSWORDS,        PAGE = 0    


   RAM_Code	 :		     LOAD = FLASH,    PAGE = 0
                         RUN = RAML0L1,   PAGE = 0
                         LOAD_START(_RAM_Code_loadstart),
                         LOAD_END(_RAM_Code_loadend),
                         RUN_START(_RAM_Code_runstart)

	FLAGA_FLASH: LOAD=FLAGA, PAGE=0
}

About pragmas: Yes, this will force linker to put Your code / data into specific memory locations (both ram and flash) which must be specified in *.cmd file.

Hope it helps :)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top