#196 code relocation

None
closed
Borut Ražem
None
5
2012-12-11
2010-05-14
Thierry BAZIN
No

Hello,

I am using sdcc for pic16 development, so sdcc uses gputils for assembling et linking operations.
I intend to use a bootloader on a USB device (pic16f4550), and so, the generated code have to begin at absolute address 0x800. This address is pointed by the bootloader program to start the user application after loading.

To obtain a code relocated in the 0x800 address, I tried several things :

  • Using --code-loc and/or --ivt-loc options in sdcc . That seems to have no effect on the command line sent to gplink.
  • Editing 16f4550.lkr script with one or the both following statements :

CODEPAGE NAME=vectors START=0x800 END=0x829
CODEPAGE NAME=page START=0x800 END=0x7FFF

The last statement solution give a code located in the rigth adress 0x800 except the reset vector which stays anyway in 0x0 location.
So I want my program to start after the bootloader leaves the control, not on reset. Anyway, the 0x0 location is protected on the chip to avoid the corruption of the boot loader.

I make a mistake, or is it a bug, or isn't it implemented ?
I submit this problem in the sdcc discussion forum, but I am afraid that it could be a gplink problem.

Where this functionality is implemented in the source code of gplink to propose a patch ?

Thank you.

Discussion

  • Borut Ražem
    Borut Ražem
    2012-11-04

    This is a sdcc problem. Please post the bug report to the sdcc bug tracker.

    Borut

     
  • Borut Ražem
    Borut Ražem
    2012-11-04

    • status: open --> pending
    • assigned_to: Borut Ražem
     
  • Borut Ražem
    Borut Ražem
    2012-12-11

    • status: pending --> closed
     


Anonymous


Cancel   Add attachments