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.