We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I am using uVision 5.15 processor is emf32g222f128. my code(part of bootloader based on silicon lab supplied code) is:
oid BOOT_jump(uint32_t sp, uint32_t pc) { /* Set new MSP, PSP based on SP (r0)*/ __asm("msr msp, r0"); __asm("msr psp, r0"); //goto *Default_PC; /* Jump to PC (r1)*/ __asm("mov pc, r1"); }
causes compiler errors:
compiling Bootloader.c... Bootloader.c(153): warning: #1267-D: Implicit physical register R0 should be defined as a variable __asm("msr msp, r0"); Bootloader.c(153): error: #549: variable "R0" is used before its value is set __asm("msr msp, r0"); Bootloader.c(157): warning: #1267-D: Implicit physical register R1 should be defined as a variable __asm("mov pc, r1"); Bootloader.c(157): error: #549: variable "R1" is used before its value is set __asm("mov pc, r1"); Bootloader.c: 2 warnings, 2 errors
I have tried several variations. msr msp r0 works fine but not the "mov pc, r1" Any ideas?
Thanks
Yash