Morpheus - 2018-08-21

Hello, I hope to be in the right place. I am using sdcc to produce .hex that I load to PICs through UART and a bootloader (http://tinypicbootload.sourceforge.net/). It is working, but the control PC sw, while programming, always complains that the first 4 instructions are not "nop" as should be the request for that particular bootloader. I wanted to have a clean and safe setup so I tried everything with no success at all:

-adding 4x nop at the beginning of the main()

-adding --code-loc 0x4

-modifying the linker script as follows (with the switch -Wlmy.lkr):

// File: 12f1840_g.lkr
// Generic linker script for the PIC12F1840 processor
LIBPATH .
CODEPAGE   NAME=vectors    START=0x0               END=0x3            PROTECTED
CODEPAGE   NAME=page0      START=0x4               END=0x7FF
CODEPAGE   NAME=page1      START=0x800             END=0xFFF
...

-adding to the main .c file the following:

void _sdcc_gsinit_startup(void)
{
  __asm nop __endasm;
  __asm nop __endasm;
  __asm nop __endasm;
  __asm nop __endasm;
  __asm pagesel _main __endasm;
  __asm goto _main __endasm;
}

But nothing changes, the first instructions are always similar to the following:

      Line    Address     Opcode    Label            DisAssy
       1   000         0000                NOP
       2   001         3186                MOVLP 0x6
       3   002         2E8A                GOTO 0x68A
       4   003         0020                MOVLB 0x0
       5   004         00D5                MOVWF 0x55
       6   005         00D3                MOVWF 0x53
       7   006         087F                MOVF 0x7F, W
       8   007         00D2                MOVWF 0x52
       9   008         00D4                MOVWF 0x54
      10   009         1FD5                BTFSS 0x55, 0x7
...

Any suggestion?

 

Last edit: Morpheus 2018-08-21