[coldfire-gnu-discuss] Jump from assembly to C problem with boot code on MCF52233
Nathan Sidwell
nathan at codesourcery.com
Wed Jun 13 08:57:43 UTC 2007
Petter wrote:
> Hello,
>
> I am in the process of making a boot-code for field flash upgrade of the
> MCF52233. The MCF52235EVB is "compatible" with our product, and the
> software without boot-code is similar to this:
> http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&thread.id=2553
> (which is a minimal TCP/IP stack without a RTOS running from flash on
> the MCF52235EVB, and can be compiled with the CodeSourcery toolchain)
>
> My problem occurs when jumping from assembly to C language in the
> application-code (boot-code runs initially and does this "switch"
> flawlessly).
>
> The output from gdb and my debugger (BDI2000) at the problem location:
> ----- 8< ----- 8< -----
> (gdb) monitor rd
> D0 : 00000000 00000000 00000030 00000006
> D4 : 00000018 a661a87d c40f9216 56d33015
> A0 : 00000000 44035a4c 200000fc 401d0024
> A4 : 1d047492 667d0fa0 00000000 20007ff0
> PC : 00027fac SR : 00002704
> (gdb) monitor info
> Target state : debug mode
> Debug entry cause : single step
> Current PC : 0x00027fac
> (gdb) monitor ti
> Target state : debug mode
> Debug entry cause : single step
> Current PC : 0x00000466
> (gdb) monitor rd
> D0 : 00000000 00000000 00000030 00000006
> D4 : 00000018 a661a87d c40f9216 56d33015
> A0 : 00000000 44035a4c 200000fc 401d0024
> A4 : 1d047492 667d0fa0 00000000 20007fe8
> PC : 00000466 SR : 00002704
> (gdb)
> ----- 8< ----- 8< -----
>
> The code at 0x466 is the default vector handler for the boot-code, and
> seems to be related to an exception. The RAM vector table for the
> application-code (with exception "decoding") has not been set up yet.
I'm guessing it's just indirected via an uninitialized vector.
> Did I miss something regarding the linkw instruction in the linker
> script? Or is some assembly magic required before the jump?
I can't see anything obviously wrong. In taking the exception it has pushed
some information onto the stack frame -- what exeption was taken?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan at codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
More information about the coldfire-gnu-discuss
mailing list