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

Starting execution from an address, AppEntry() function

Hi,

My boot code is booted from the SPI flash and it copies the application code to the 0x80000000 address, where the SDRAM starts.

The NAND and NOR bootloader codes written by KEIL has an AppEntry function which is below:

#define EXT_SDRAM   0x80000000
typedef void (*fnc) (void);
const fnc AppEntry = (fnc)EXT_SDRAM;

int main()
{
-
-
AppEntry();
}

I use this function in my code to start execution from 0x80000000 address. However, it does not work! The program counter does not jump to my location, instead, it continues executing in its own function.

I also tried to stop at a breakpoint and change the value of the PC by hand. But, it had the same affect, no jump occured.

The same code works in NOR bootloader, so maybe I have something in the project options to fix?

Besides, in the NOR bootloader, the mode is "supervisor mode". I also switched to this mode in my code, but I still have the same result.

Can someone please help me out of this issue?

Thanks

0