[mc1322x] _rom_data_init_ branch

Mariano Alvira mar at devl.org
Tue Jul 14 12:29:16 EDT 2009


On Tue, Jul 14, 2009 at 05:56:47PM +0300, Giandomenico Rossi wrote:
> Thank you a lot for your precious advices!
> 

sure. No problem! :)

> > You also need to set up the rom patching vectors. 
>
> Sorry ; could you briefly explain me what do you mean when you say 
> rom vectors ? Exception Vector Table ?  

Sure thing. 

You might have noticed that Freescale advertises that the ROM services
are "patchable". They do this by having some kind of hook/callback
structure where the ROM routines jump back into the ROM patching
vector space (this is a Freescale ROM service specific thing), where
they can insert their "patch".

I set up this space in the following way (in start.S):

   /* these vectors are used for rom patching */
   .org 0x20
   .code 16
   _RPTV_0_START:
           bx lr /* do nothing */

   .org 0x60
   _RPTV_1_START:
           bx lr /* do nothing */

   .org 0xa0
   _RPTV_2_START:
           bx lr /* do nothing */

   .org 0xe0
   _RPTV_3_START:
           bx lr /* do nothing */

which returns control back to the ROM routines without doing anything
else. You need at least this much to have any luck with the ROM
services at all.

 I also have a few comments about this here:
http://freaklabs.org/index.php/Blog/Zigbee/freescale-mc13224-review.html

> 
> > Are you having trouble with calling rom_data_init or with ROM service
> > calls in general?
> both ! But I solved.
> Rom_data_init uses R12 register without save it.
> In forth that's a particular register used for DATA stack, so my calls
> to Rom_data_init never came back.

Yep. That will do it. Nice work on solving the problem.

> ROM service call are coded in Thumb instruction, whereas I use  ARM
> assembler instruction  so I simply had to make a BLX jump in place o a
> BL .

Yeah, I was going to mention that. rom_data_init is ARM, but it
appears that the rest of the ROM services expect that you are in THUMB
mode.

> Giandomenico

Are you making this a public project? It sounds very interesting.

-Mar.



More information about the mc1322x mailing list