This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with own bootloader / its application startup

Hi all

I am having problems with application startup. My USB based bootloader needs to start the "real" application if no USB is present. So I got two separate programs in flash residing on different locations. Bootloader starting at 0 (with flash vectors) and the application at say 0x4000, using relocated rambased vectors.

Both applications work fine, if started from within the debugger (PC set to either 0 or 0x4000, then command "go").

USB Bootloder is in Thumb mode, but I issue the BX R0 with R0 set to 4000h from supervisor mode. The application starts, but then ends up in an exception shortly. Any ideas what might be wrong? Does the CPU need some more setup? Or causes the duplicate clock stuff in the startup code some problems?

Funny thing is I checked NXP's app note 10711, which is about an USB bootloader too and they start the application simply that way:

void execute_user_code(void)
{ void (*user_code_entry)(void); user_code_entry = (void (*)(void))USER_FLASH_START; user_code_entry();
}

The bootloader is in Thumb and User mode I guess. Can that generally be a workiing solution? I tried it that way at first, but failed too.

Many thanks in advance
U.B.

Parents
  • hey all again ..

    NO IDEAS ? PLEASE ...

    the job seems so simple but my target crashes and crashes.

    Double-checked several times without result:

    Bootloader leaves its code in supervisor mode, interrupts off, all VIC IRQ disabled
    jumping to 0x4000 (where target was loaded to properly)

    target code is really there and operation starts in the usual way by executing the target startup code INCLUDING copying and remapping of the 64 b vector area.

    the SAME target code works fine if started by debugger. what else might be wrong ?

    many thanks in advance
    Uli B.

Reply
  • hey all again ..

    NO IDEAS ? PLEASE ...

    the job seems so simple but my target crashes and crashes.

    Double-checked several times without result:

    Bootloader leaves its code in supervisor mode, interrupts off, all VIC IRQ disabled
    jumping to 0x4000 (where target was loaded to properly)

    target code is really there and operation starts in the usual way by executing the target startup code INCLUDING copying and remapping of the 64 b vector area.

    the SAME target code works fine if started by debugger. what else might be wrong ?

    many thanks in advance
    Uli B.

Children