I am trying to write the PIC. I wrote 2 programs in keil. 1 program is residing in the ROM (non PIC). And the second prgram (with-PI) I want to send over UART. I am trying to wrote the program and I also enabled /ropi and /rwpi options, and also tried oputputting the symbol definition file with --symdefs. Somehow I am not able to compile the PIC project. from my inderstanding "main()" is not required and from the startup file I am directly jumping to my_function(). The errors I am getting are pasted below:
toloadAPP.axf: Error: L6241E: toloadapp_startup.o(.text) cannot use the address of 'RWPI (R9 used as SB)' function add2num as the image contains 'USESV6 (R9 used as V6)' functions. toloadAPP.axf: Error: L6248E: toloadapp_startup.o(.text) in PI region 'ER_RO' cannot have address type relocation to add2num in PI region 'ER_RO'. toloadAPP.axf: Error: L6285E: Non-relocatable Load region LR_1 contains R-Type dynamic relocations. First R-Type dynamic relocation found in toloadapp_startup.o(.text) at offset 0xc.
The assembly file is as shown below:
AREA RESET, DATA, READONLY DCD Reset_Handler ; Reset Handler AREA |.text|, CODE, READONLY Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT add2num LDR R0, =add2num BX R0 ENDP END
The C file is as below:
int add2num(int a, int b) { return (a + b); }
Anybody can point to the documentation with which I can proceed further?
Thanks
Hi.
In an attempt to design a fault-proof software update mechanism to be used "in-the-field" by end customers, my plan was to use multiple application flash "partitions". When updating to a newer software release the oldest would simply be overwritten. The new one should only be activated after it had been verified that it was written successfully to flash. If this was not the case there should be a mechanism to fall back to the previous version.
I assumed that I would require to generate position independent code. Is there another way to acheive what I describe above?
And what is the common practice? Having a boot loader that can manage ONE instance of the "application" in flash?
Thanks, Jonas