Reputation: 1
Can someone please help me.
I am using PIC18F26Q10 mcu bootloader code starts from 0xF00 and application code starts from 0x4000 The below code is what I tried out but the switch doesn't seem to happen. In debug I could observe the breakpoint hitting at 0x4000 but it dint work. when I read the target hex using MPLAB IDE all the code is in correct address location.
MPLAB IDE v5.45 and xc8 v2.45
where am I going wrong?
I have used the same code in PIC18F26K22 and PIC18F26K42 it works there
I am using :
`STKPTR = 0x00;
PCLATU = 0x00;
PCLATH = 0X41;
PCL = 00;`
I tried this as well:
#define RESET_ADDRESS_APPLICATION 0x004000UL STKPTR = 0x00; asm("GOTO " ___mkstr(RESET_ADDRESS_APPLICATION));
Upvotes: 0
Views: 176
Reputation: 1
I was running into a similar problem. It looks like it doesn't like UL defined constant.
#define RESET_ADDRESS_APPLICATION 0x4000
...
asm("GOTO " ___mkstr(RESET_ADDRESS_APPLICATION));
Upvotes: 0