Rellocated_software

Hello,
I’m trying to create a software that can be reprogrammable by the RF :
A boot-loader will switch between two versions of this software.
I’m using the sdk and I change a line from the makefile to create a compatible code with the new memory position :

CODE_AREA_APP = --code-loc 0x3c00 --code-size 0x3800

To test the relocated software, I concatenate the two hex files(boot-loader and software) in the same .hex file and I delete EOF line of the boot-loader :00000001FF
When I load the .hex with the wixelconfig tool it’s working fine with a little app like blinking a led.
But when I want to use the RF or the Sleep mode the app doesn’t work.(It’s working fine with the basic memory position( 0x0400) without boot loader).

Boot-loader code :

void main(void)
{
    ///JUMP to address
    __asm
      lcall 0x3c00
    __endasm;
}

Did i miss something ?, does library only working for a software which begins at the address 0x0400?
Any idea ?

Thanks !

Nathan

Hello, Nathan.

This sounds like a cool project! I think the main reason that the more complicated apps didn’t work is because you haven’t remapped the interrupts properly. This is described briefly in the Wixel User’s Guide:

You will need to put ljmp instructions at the proper locations starting at 0x403 to remap the interrupt table to your new application code space. I would probably do it using assembly, but alternatively you could just define your own ISRs in the usual way in C, and put an ljmp instruction in each ISR.

–David

I try with the declaration of all ISR in the file that define my main and my soft seems working fine:

ISR(RFTXRX, 0)
{
    __asm
      ljmp 0x3c03;offset
      __endasm;
}
.
.
.
ISR(WDT, 0)
{
    __asm
      ljmp 0x3c8b;
    __endasm;
}

Thank you for your help
Nathan