Dear All,
I am trying to add a boot loader for my LPC2478 based application. I want to conditionally Branch to my main code at 0x1000 from the boot loader code. When i tried from Startup.s as below
IMPORT __main ; LDR R0, =__main LDR R0, =0x1000 BX R0 it worked fine. Now the problem is that I cannot do the same from main().
This does not compile int main(){
__asm{ LDR R0, =0x1000 B R0 }
}
generating following errors...
boot.c(8): error: #29: expected an expression boot.c(8): error: #1097: Expected a [ or ] boot.c(9): error: #114: label "R0" was referenced but not defined
PLS HELP...THANKS
A jump to an absolute address in C can be as simple as "((void (*)(void))0x1000)();"
Thanks everyone.
Seems that solved my problem...thank you very much
No it did not! As stated above, a simple jump won't get the job done, but you won't immediately feel it.
there is more problems in the project,,,,,,, one is not job done,,,, try balelfish,,,,,
View all questions in Keil forum