MCF5282 startup code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF5282 startup code

1,131 Views
Alessandro
Contributor I
Dear everybody,

I'm experiencing some problems with a very simple MCF5282 startup code
running on the M5282LITE board. My goal is to boot my code from the internal
MCU flash. After these few instructions ...

_Startup:
                   MOVE.W    #0x2700, %SR
                   MOVE.L    #(__IPSBAR+0x00000001), %D0
                   MOVE.L    %D0, __IPSBAR
                   MOVE.L    #(__IFLASH+0x00000621), %D0
                   MOVEC.L   %D0, %RAMBAR0
                   MOVE.L    #(__ISRAM+0x00000021), %D0
                   MOVEC.L   %D0, %RAMBAR1
                   MOVE.L    #(__ISRAM+0x00000200), %D0
                   MOVE.L    %D0, (__IPSBAR+_SCMRAMBAR) */
                   MOVE.L    #__SPINIT, %SP
                   JMP       HAL_Startup

... I never reach the HAL_Startup location where I send a string to the serial
port. My environment is the following:

- jumper EXT_BOOT on the board: OPEN
- vectors linked at address 0x00000000
- first longword of the vector table: __ISRAM + 32K
- second longword of the vector table: 0x00000418
- startup code (_Startup) linked at address 0x00000418

From Coldfire manuals, I've understood the MCU takes the address stored in the
second longword of the vector table and jumps to it where I have stored my startup
routine. But seems it doesn't do it !!

Could anyone suggest me where am I wrong ?

Best Regards

/Alessandro


Labels (1)
0 Kudos
1 Reply

254 Views
bkatt
Contributor IV


Alessandro wrote:

                   MOVE.L    #(__IFLASH+0x00000621), %D0
                   MOVEC.L   %D0, %RAMBAR0


Startup code I've used for the 5282 adds the constant 0x61 to the flash address, not 0x621 as shown in your post. Also, verify that __IFLASH is 0; otherwise you must jump to some non-flash code to actually change the location of flash.



Message Edited by bkatt on 2008-03-06 10:20 PM
0 Kudos