• AVR Freaks

Hot!Bootloader reset when writing the flash

Author
Blue_Key
Senior Member
  • Total Posts : 133
  • Reward points : 0
  • Joined: 2011/12/20 04:48:22
  • Location: 0
  • Status: offline
2019/08/28 05:56:20 (permalink)
0

Bootloader reset when writing the flash

Read post below first
 
I'm writing a bootloader that uses SPI.
 
Everything seems to work fine, except the chip seems to reset randomly while writing the flash.
 
I couldn't figure out why so far. Data seems correct, the WDT is disabled, interrupt disabled.
 
When I read back the memory, it seems to write until some point.
 
It seems to often reset when start writing at addresses like 0x00A0, 0x00F0
 
 
Interrupts disabled with

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
INTCON1bits.NSTDIS = 1; // disable nesting
mcuAtomicOr(SR, 0x00E0); // disable interrupt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
Flash writing routine

 
 
 
 
 
 
 
#define PM_ROW_SIZE 64 * 8
#define CM_ROW_SIZE 8
#define CONFIG_WORD_SIZE 1
 
 
 
 
 

#define PM_ROW_ERASE 0x4042
#define PM_ROW_WRITE 0x4001
#define CONFIG_WORD_WRITE 0X4000
 
 
 
 
 
 
 
void WritePM(char * ptrData, uReg32 SourceAddr, int len)
{

    
 unsigned int Size,Size1;
 uReg32 Temp;
 uReg32 TempAddr;
 uReg32 TempData;

    if (SourceAddr.Word.LW == 0)
    { // keep bootloader reset address
        ptrData[0] = 0x00;
        ptrData[1] = 0x04;
        ptrData[2] = 0x04;
        ptrData[3] = 0x00;
        ptrData[4] = 0x00;
        ptrData[5] = 0x00;
    }
    
    if (SourceAddr.Word.HW == 0)
    { // protect bootloader
        if ((SourceAddr.Word.LW >= 0x0400) && (SourceAddr.Word.LW < 0x1000))
                return;
    }

    if ((SourceAddr.Word.LW % 0x400) == 0) Erase(SourceAddr.Word.HW,SourceAddr.Word.LW,PM_ROW_ERASE);
    
 for(Size = 0,Size1=0; Size < len; Size++)
 {
  
  Temp.Val[0]=ptrData[Size1+0];
  Temp.Val[1]=ptrData[Size1+1];
  Temp.Val[2]=ptrData[Size1+2];
  Temp.Val[3]=0;
  Size1+=3;

    WriteLatch(SourceAddr.Word.HW, SourceAddr.Word.LW,Temp.Word.HW,Temp.Word.LW);

  /* Device ID errata workaround: Save data at any address that has LSB 0x18 */
       
  if((SourceAddr.Val32 & 0x0000001F) == 0x18)
  {
   TempAddr.Val32 = SourceAddr.Val32;
   TempData.Val32 = Temp.Val32;
  }

  if((Size !=0) && (((Size + 1) % 64) == 0))
  {
   /* Device ID errata workaround: Reload data at address with LSB of 0x18 */
       WriteLatch(TempAddr.Word.HW, TempAddr.Word.LW,TempData.Word.HW,TempData.Word.LW);

   WriteMem(PM_ROW_WRITE);
  }

  SourceAddr.Val32 = SourceAddr.Val32 + 2;
 }

   
}


 
 
Asm, from Microchip
 

.ifdef __dsPIC33F
 .include "p33fxxxx.inc"
.else
 .include "p33exxxx.inc"
.endif



.global _LoadAddr,_WriteMem,_WriteLatch,_ReadLatch,_ResetDevice,_Erase ;C called


_LoadAddr: ;W0=NVMADRU,W1=NVMADR - no return values
 mov W0,TBLPAG
 mov W1,W1
 
 return
 
;***************************************************************
_WriteMem: ;W0=NVMCON - no return values
 mov W0,NVMCON
 mov #0x55,W0 ;Unlock sequence - interrupts need to be off
 mov W0,NVMKEY
 mov #0xAA,W0
 mov W0,NVMKEY
 bset NVMCON,#WR
 nop ;Required
 nop
1: btsc NVMCON,#WR ;Wait for write end
 bra 1b
 
 return
 
;***************************************************************
_WriteLatch: ;W0=TBLPAG,W1=Wn,W2=WordHi,W3=WordLo - no return values
 mov W0,TBLPAG
 tblwtl W3,[W1]
 tblwth W2,[W1]
 
 return
 
;***************************************************************
_ReadLatch: ;W0=TBLPAG,W1=Wn - data in W1:W0
 mov W0,TBLPAG
 tblrdl [W1],W0
 tblrdh [W1],W1
 
 return


;***************************************************************
_ResetDevice:
 
  goto 0x1002

 return

;***************************************************************
_Erase:

 
 push TBLPAG
 mov W2,NVMCON
     
 mov w0,TBLPAG ; Init Pointer to page to be erased
 tblwtl w1,[w1] ; Dummy write to select the row

 
 mov #0x55,W0 ;Unlock sequence - interrupts need to be off
 mov W0,NVMKEY
 mov #0xAA,W0
 mov W0,NVMKEY
 bset NVMCON,#WR
 nop ;Required
 nop

erase_wait:
 btsc NVMCON,#WR ;Wait for write end
 bra erase_wait
 
 pop TBLPAG
 return

;***************************************************************
.end

post edited by Blue_Key - 2019/08/28 07:50:31
#1

3 Replies Related Threads

    Blue_Key
    Senior Member
    • Total Posts : 133
    • Reward points : 0
    • Joined: 2011/12/20 04:48:22
    • Location: 0
    • Status: offline
    Linker bootloader and hex file address issue 2019/08/28 07:46:28 (permalink)
    0
    Going deeper in the debug, it seems the reset issue was due to writing the wrong size of row, it has to be 64.
     
    But now i'm facing a linker issue.
     
     
    The linker put instruction on the hex file at addres 0x2000 which is out of range. I wonder if it's a bug of the linker because if I compile and program, it works fine.
     
    The generated hex 

    :10 2000 00 2f9e20000ebf20000e01880000000000 5f
     
    2000 being the hex address, which is out of the device memory.
     

     
     
     
     
     
     
     
    MEMORY
    {
    data (a!xr) : ORIGIN = 0x800, LENGTH = 0x400
    reset : ORIGIN = 0x0, LENGTH = 0x4
    ivt : ORIGIN = 0x4, LENGTH = 0xFC
    _reserved : ORIGIN = 0x100, LENGTH = 0x4
    aivt : ORIGIN = 0x104, LENGTH = 0xFC
    program (xr) : ORIGIN = 0x0400, LENGTH = 0x1E00
    FBS : ORIGIN = 0xF80000, LENGTH = 0x2
    FGS : ORIGIN = 0xF80004, LENGTH = 0x2
    FOSCSEL : ORIGIN = 0xF80006, LENGTH = 0x2
    FOSC : ORIGIN = 0xF80008, LENGTH = 0x2
    FWDT : ORIGIN = 0xF8000A, LENGTH = 0x2
    FPOR : ORIGIN = 0xF8000C, LENGTH = 0x2
    FICD : ORIGIN = 0xF8000E, LENGTH = 0x2
    FUID0 : ORIGIN = 0xF80010, LENGTH = 0x2
    FUID1 : ORIGIN = 0xF80012, LENGTH = 0x2
    FUID2 : ORIGIN = 0xF80014, LENGTH = 0x2
    FUID3 : ORIGIN = 0xF80016, LENGTH = 0x2
    }
     
     
     
     
     
     
     
    __FBS = 0xF80000;
    __FGS = 0xF80004;
    __FOSCSEL = 0xF80006;
    __FOSC = 0xF80008;
    __FWDT = 0xF8000A;
    __FPOR = 0xF8000C;
    __FICD = 0xF8000E;
    __FUID0 = 0xF80010;
    __FUID1 = 0xF80012;
    __FUID2 = 0xF80014;
    __FUID3 = 0xF80016;
    __NO_HANDLES = 1; /* Suppress handles on this device */
    __CODE_BASE = 0x400;
    __CODE_LENGTH = 0x1E00;
    __IVT_BASE = 0x4;
    __AIVT_BASE = 0x104;
     
     
     
     
     
     
     
    __DATA_BASE = 0x800;
    __DATA_LENGTH = 0x400;
    __YDATA_BASE = 0xA00;
     
     
     
     
     
     
     

     
    I set the user app to start at 0x1000. My program is quite short and isn't supposed to have stuff at 0x2000.
     
    The MPLAB program memory view set the instruction at the correct 0x1000 address, however, the generated .hex file starts the program at 0x2000 ?!?
     

     
     
     
    :020000040000fa
    :080000000010040000000000e4
    :020000040000fa
    :0400080006120000dc
    :020000040000fa
    :04000c0006120000d8
    :020000040000fa
    :0400100006120000d4
    :020000040000fa
    :0400140006120000d0
    :020000040000fa
    :0400180006120000cc
    :020000040000fa
    :04001c0006120000c8
    :020000040000fa
    :0400200006120000c4
    :020000040000fa
    :0400240006120000c0
    :020000040000fa
    :0400280006120000bc
    :020000040000fa
    :04002c0006120000b8
    :020000040000fa
    :0400300006120000b4
    :020000040000fa
    :040034004e11000069
    :020000040000fa
    :0400380006120000ac
    :020000040000fa
    :04003c0006120000a8
    :020000040000fa
    :0400400006120000a4
    :020000040000fa
    :0400440006120000a0
    :020000040000fa
    :04004800061200009c
    :020000040000fa
    :04004c000612000098
    :020000040000fa
    :04005000da110000c1
    :020000040000fa
    :040054000612000090
    :020000040000fa
    :04005800061200008c
    :020000040000fa
    :04005c00d0100000c0
    :020000040000fa
    :040060000612000084
    :020000040000fa
    :040064000612000080
    :020000040000fa
    :04006800061200007c
    :020000040000fa
    :04006c000612000078
    :020000040000fa
    :040070000612000074
    :020000040000fa
    :040074000612000070
    :020000040000fa
    :04007800061200006c
    :020000040000fa
    :04007c000612000068
    :020000040000fa
    :040080000612000064
    :020000040000fa
    :040084000612000060
    :020000040000fa
    :04008800061200005c
    :020000040000fa
    :04008c000612000058
    :020000040000fa
    :040090000612000054
    :020000040000fa
    :040094000612000050
    :020000040000fa
    :04009800061200004c
    :020000040000fa
    :04009c000612000048
    :020000040000fa
    :0400a0000612000044
    :020000040000fa
    :0400a4000612000040
    :020000040000fa
    :0400a800061200003c
    :020000040000fa
    :0400ac000612000038
    :020000040000fa
    :0400b0000612000034
    :020000040000fa
    :0400b4000612000030
    :020000040000fa
    :0400b800061200002c
    :020000040000fa
    :0400bc000612000028
    :020000040000fa
    :0400c0000612000024
    :020000040000fa
    :0400c4000612000020
    :020000040000fa
    :0400c800061200001c
    :020000040000fa
    :0400cc000612000018
    :020000040000fa
    :0400d0000612000014
    :020000040000fa
    :0400d4000612000010
    :020000040000fa
    :0400d800061200000c
    :020000040000fa
    :0400dc000612000008
    :020000040000fa
    :0400e0000612000004
    :020000040000fa
    :0400e4000612000000
    :020000040000fa
    :0400e80006120000fc
    :020000040000fa
    :0400ec0006120000f8
    :020000040000fa
    :0400f00006120000f4
    :020000040000fa
    :0400f40006120000f0
    :020000040000fa
    :0400f80006120000ec
    :020000040000fa
    :0400fc0006120000e8
    :020000040000fa
    :0401000006120000e3
    :020000040000fa
    :0401040006120000df
    :020000040000fa
    :0401080006120000db
    :020000040000fa
    :04010c0006120000d7
    :020000040000fa
    :0401100006120000d3
    :020000040000fa
    :0401140006120000cf
    :020000040000fa
    :0401180006120000cb
    :020000040000fa
    :04011c0006120000c7
    :020000040000fa
    :0401200006120000c3
    :020000040000fa
    :0401240006120000bf
    :020000040000fa
    :0401280006120000bb
    :020000040000fa
    :04012c0006120000b7
    :020000040000fa
    :0401300006120000b3
    :020000040000fa
    :0401340006120000af
    :020000040000fa
    :0401380006120000ab
    :020000040000fa
    :04013c0006120000a7
    :020000040000fa
    :0401400006120000a3
    :020000040000fa
    :04014400061200009f
    :020000040000fa
    :04014800061200009b
    :020000040000fa
    :04014c000612000097
    :020000040000fa
    :040150000612000093
    :020000040000fa
    :0402080006120000da
    :020000040000fa
    :04020c0006120000d6
    :020000040000fa
    :0402100006120000d2
    :020000040000fa
    :0402140006120000ce
    :020000040000fa
    :0402180006120000ca
    :020000040000fa
    :04021c0006120000c6
    :020000040000fa
    :0402200006120000c2
    :020000040000fa
    :0402240006120000be
    :020000040000fa
    :0402280006120000ba
    :020000040000fa
    :04022c0006120000b6
    :020000040000fa
    :0402300006120000b2
    :020000040000fa
    :0402340006120000ae
    :020000040000fa
    :0402380006120000aa
    :020000040000fa
    :04023c0006120000a6
    :020000040000fa
    :0402400006120000a2
    :020000040000fa
    :04024400061200009e
    :020000040000fa
    :04024800061200009a
    :020000040000fa
    :04024c000612000096
    :020000040000fa
    :040250000612000092
    :020000040000fa
    :04025400061200008e
    :020000040000fa
    :04025800061200008a
    :020000040000fa
    :04025c000612000086
    :020000040000fa
    :040260000612000082
    :020000040000fa
    :04026400061200007e
    :020000040000fa
    :04026800061200007a
    :020000040000fa
    :04026c000612000076
    :020000040000fa
    :040270000612000072
    :020000040000fa
    :04027400061200006e
    :020000040000fa
    :04027800061200006a
    :020000040000fa
    :04027c000612000066
    :020000040000fa
    :040280000612000062
    :020000040000fa
    :04028400061200005e
    :020000040000fa
    :04028800061200005a
    :020000040000fa
    :04028c000612000056
    :020000040000fa
    :040290000612000052
    :020000040000fa
    :04029400061200004e
    :020000040000fa
    :04029800061200004a
    :020000040000fa
    :04029c000612000046
    :020000040000fa
    :0402a0000612000042
    :020000040000fa
    :0402a400061200003e
    :020000040000fa
    :0402a800061200003a
    :020000040000fa
    :0402ac000612000036
    :020000040000fa
    :0402b0000612000032
    :020000040000fa
    :0402b400061200002e
    :020000040000fa
    :0402b800061200002a
    :020000040000fa
    :0402bc000612000026
    :020000040000fa
    :0402c0000612000022
    :020000040000fa
    :0402c400061200001e
    :020000040000fa
    :0402c800061200001a
    :020000040000fa
    :0402cc000612000016
    :020000040000fa
    :0402d0000612000012
    :020000040000fa
    :0402d400061200000e
    :020000040000fa
    :0402d800061200000a
    :020000040000fa
    :0402dc000612000006
    :020000040000fa
    :0402e0000612000002
    :020000040000fa
    :0402e40006120000fe
    :020000040000fa
    :0402e80006120000fa
    :020000040000fa
    :0402ec0006120000f6
    :020000040000fa
    :0402f00006120000f2
    :020000040000fa
    :0402f40006120000ee
    :020000040000fa
    :0402f80006120000ea
    :020000040000fa
    :0402fc0006120000e6
    :020000040000fa
    :0403000006120000e1
    :020000040000fa
    :0403040006120000dd
    :020000040000fa
    :0403080006120000d9
    :020000040000fa
    :04030c0006120000d5
    :020000040000fa
    :0403100006120000d1
    :020000040000fa
    :0403140006120000cd
    :020000040000fa
    :0403180006120000c9
    :020000040000fa
    :04031c0006120000c5
    :020000040000fa
    :0403200006120000c1
    :020000040000fa
    :0403240006120000bd
    :020000040000fa
    :0403280006120000b9
    :020000040000fa
    :04032c0006120000b5
    :020000040000fa
    :0403300006120000b1
    :020000040000fa
    :0403340006120000ad
    :020000040000fa
    :0403380006120000a9
    :020000040000fa
    :04033c0006120000a5
    :020000040000fa
    :0403400006120000a1
    :020000040000fa
    :04034400061200009d
    :020000040000fa
    :040348000612000099
    :020000040000fa
    :04034c000612000095
    :020000040000fa
    :040350000612000091
    :020000040000fa
    :102000002f9e20000ebf20000e018800000000005f
    :10201000000020000000e00002003200000120006b
    :102020002002880014000700fa0007000000e0000a
    :1020300003003a00807121000100200002003700f7
    :102040000000200001002000810f7000010032001c
    :1020500014000700000020000000e0000200320031
    :1020600000000200000000004a160200000000000c
    :102070000040da000000fe004440a90000002000fb
    :102080000000e0000300320000002000a0018800f2
    :102090004440a800000006008a1f78008b1f7800cb
    :1020a0000000060091018800800478000000eb0029
    :1020b0001a003700e284440032a0b4009905ba0047
    :1020c000e284440032a0b4009906ba00e2844400dd
    :1020d00032a0b4000006eb00476fde00fd07b2003f
    :1020e000636ce10003003a00ebff07000000eb0027
    :1020f0000a003700606ce10004003a00005deb006c
    :102100008b05e900fdff3e00040037006168e10037
    :10211000010032000086eb000b00070019c7ba006f
    :102120001905ba000e04e00003003a000a00e000be
    :10213000e0ff3a0000000600fe07b2009e018800a2
    :102140008a047800f5ff3700395dba008b05e90095
    :102150000c003200295dba008b05e900080032004e
    :102160000c00e00003003a00e284440032a0b40016
    :10217000f5ff370019ddba008b05e900faff3a00d8
    :102180008904e800e184440032a0b40000000600a5
    :10219000000000000000000000000000000000003f
    :1021a0003600f800809fbe00829fbe00849fbe0064
    :1021b000869fbe003400f80000002000a0018800c7
    :1021c0000000fa0085a0a900e09c20001001be00dc
    :1021d000001880008000eb0002004000838048006f
    :1021e000e29c20000089be00e09c200020019000bd
    :1021f000b0019000101880008000eb000200400049
    :1022000083804800e29c2000200198003101980062
    :10221000c04e80000000e800c04e8800c14e800023
    :10222000f04e8000808f500014003a00e09c2000a7
    :102230001000be00629c20000089be00e09c2000cf
    :10224000b000900020009000629c200020019800c7
    :1022500031019800e29c20006000b8000089be00b7
    :10226000e29c20006000b800200198003101980035
    :10227000d829ef00b04e8000000001000080fa0075
    :102280003400f9004f03be004f02be004f01be00f4
    :102290004f00be003600f900004006003600f8008e
    :1022a000809fbe00829fbe00849fbe00869fbe00ae
    :1022b0003400f80000002000a00188000000fa00af
    :1022c0008460a900c04c80000000e800c04c880079
    :1022d000c14c8000004f800000017800110009000f
    :1022e0008280d8008000fd000000e00001003a007c
    :1022f00039010700c04c8000630060000000e0006e
    :102300001d003a0031408000f0a52e00808f500063
    :1023100019003e00304080000000e8003040880096
    :1023200031408000401f20000001780011000900aa
    :102330008280d8008000fd000000e0000e003a001e
    :10234000101680007000600000f0a7000000ea0096
    :102350000000e9004f00de00004078000080fb0034
    :10236000610060004400dd00111680000140a10002
    :1023700001007000101688003140800000712200ba
    :10238000808f500003003600c05d20000100200057
    :102390008e0107000080fa003400f9004f03be00f0
    :1023a0004f02be004f01be004f00be003600f900d4
    :1023b000004006003600f800809fbe00829fbe00ed
    :1023c000849fbe00869fbe003400f80000002000fd
    :1023d000a00188000000fa008540a90040c2a900c1
    :1023e0004012800000407800e60107000080fa00fb
    :1023f0003400f9004f03be004f02be004f01be0083
    :102400004f00be003600f900004006000040da0030
    :102410000000fe00000005006022b8000602200057
    :102420000000d0008180d2000482d2008582d200d8
    :102430000000a0000202520083825a000300310013
    :102440000202420083824a000000a1000603e90064
    :08245000f3ff3a000000060052
    :020000040000fa
    :102458000200fa00000f78001e0078001040780093
    :102468000080fb00c800dd001e00e8001040780076
    :102478000080fb00010070000080fa0000000600e8
    :102488000200fa00000f78001e00e80010407800f3
    :102498000080fb00c800dd001e00780010407800b6
    :1024a8000080fb00010070000080fa0000000600b8
    :1024b8000800fa0010079800414798003207980072
    :1024c8000000eb00000f78000000eb00000f780020
    :1024d800050037001e0090001e004000ce4090000e
    :1024e800014878001e0fe8003e0090009e0078002a
    :1024f800808f5000f7ff39000080fa0000000600c6
    :102508000400fa00000f7800110798001e019000df
    :102518008040eb001e007800e5ff07000080fa000d
    :10252800000006000400fa00204798002e409000a2
    :10253800e14f50000d003a008540a900411280008b
    :10254800010f78004822ef000000000021048000fd
    :1025580000402000008060000000e000fbff320027
    :10256800401280000040780001003700e0cfb3003f
    :102578000080fa00000006000400fa0020479800d6
    :10258800314798003e409000e14f50000b003a0060
    :102598008540a90041128000010f78002e4090006c
    :1025a8000080fb004012880000000000001280003c
    :1025b800610060000000e000fcff32000080fa00cb
    :1025c800000006000400fa002047980031479800f0
    :1025d8003e409000e14f50000f003a008540a900ae
    :1025e80041128000010f78002e4090000080fb000f
    :1025f80040128800000000002104800000402000f4
    :10260800008060000000e000fbff32004012800004
    :102618000040780001003700e0cfb3000080fa00e6
    :10262800000006000600fa001007980041479800cd
    :102638001100370040002000000f78000300370029
    :10264800ce40900090012000180007001e0078007e
    :102658008000780001f0a7008100ea008100ea000c
    :10266800cf08de00814078000000e900000f780004
    :102678000104e000f2ff3a001e00900000f0a700fd
    :102688000000ea000000ea004f00de000040780089
    :102698009e0090008100e900110798000004e00006
    :1026a800e4ff3a000080fa00000006000800fa0083
    :1026b80020079800614798006e4090000080fb005a
    :1026c8006a00b900000078006101b9002e0090008e
    :1026d8008000eb00009ab90004027800028bb90070
    :1026e80086027800050242000010b800010242008c
    :1026f80084007800008fbe001e00be0064005000f9
    :10270800e0805800008fbe001e00be00e00f5000a1
    :10271800e08f580009003400040037001e00be0096
    :102728006b005000e0805800008fbe001e00be0005
    :10273800e00f5000e08f5800f8ff3c000080fa00de
    :10274800000006000000fa000421ef000421a9009f
    :1027580021088000f0fc2f00008060000050a000dd
    :102768002008880040062000100888002105800005
    :10277800f0ff28000080600000e0a000200588002d
    :102788008460a9009460a80005e1a8000080fa0010
    :10279800000006000200fa00000f78009e00780092
    :1027a800014f8800a0472100c9000700401f2000f2
    :1027b800010020005f0107000000eb00680107002e
    :1027c8004c010700dfff07000080fa000000060048
    :1027d8000800fa000040800011408000e00f50001f
    :1027e800e08f580002003a000428ef003b00370051
    :1027f80031408000b02b2000808f500032003e0016
    :10280800bf000700008fbe0000408000114080001c
    :102818001e0278000001be000400780036000700a0
    :102828008000780020408000008040008000eb009d
    :1028380020079800310798002e019000be019000f3
    :10284800f031200001002000800f5100818f5900d5
    :1028580007003c002e009000be009000e00f5000e2
    :10286800e08f5800020034002e00900020408800bd
    :10287800d04c800021408000000140008080200072
    :102888000000410001087800d04c80001e0178004b
    :102898004106200080804000818140008180200026
    :1028a80081804100820878000000e800d04c880050
    :1028b800d14c800020062000808f50000700340093
    :1028c8009a29ef0005003700314080003038200099
    :1028d800808f5000010036000428ef00204080005f
    :1028e8001f0107000080fa00000006000000fa003f
    :1028f8000080fa00000006000a00fa00200798008d
    :1029080032079800430798002e0090006101b80034
    :102918003e009000ce0090000000510081805900d8
    :10292800008fbe001e0078008000780001f0a7002c
    :102938008100ea00803e2000808f500008003400ab
    :102948001e00be00e00f5000e08f58000200340067
    :10295800b0ff2f000100370050002000170037009b
    :102968001e0078008000780001f0a7008100ea00ce
    :1029780040062000808f5000080034001e00be0072
    :10298800e00f5000e08f5800020034000080eb0098
    :102998000100370010002000080037001e007800f2
    :1029a80000f0a7000000ea00f40f50000200340015
    :1029b8000000eb00010037000000eb000080fa0087
    :1029c800000006000400fa00008fbe000628ef0091
    :1029d800470007008000eb001e0178000191b90054
    :1029e800020178009e019000009ab90084017800e5
    :1029f800030141009e0178000018b8000101410060
    :102a08008200780000408800114088000080fa00a9
    :102a1800000006000000fa002023ef002223ef0048
    :102a28002423ef002143a80011198000f0ff2100a2
    :102a380000806000101988001119800030fc2f00f8
    :102a4800008060000020a000101988002043a80022
    :102a58002063a9002343a8003003a8003023a8005e
    :102a680001198000f0f12f00008060000060a000d4
    :102a78000019880025e3a90030c0b30024e3b7009b
    :102a880085a0a90051058000f0f82f008080600023
    :102a980000032000010070005005880095a0a800e0
    :102aa80021e3a8000080fa00000006000000fa00f8
    :102ab8000a21ef0020182000700888008500a9006e
    :102ac8009500a90013e1a8000080fa0000000600a4
    :102ad8000200fa00000f78009e007800b14e8800ce
    :102ae800f2ff0700cbff07000080fa000000060095
    :102af8000000fa00f04e80000080fa000000060096
    :102b08000000fa00609c20001000be000080fa005f
    :102b1800000006000000fa00609c2000b000900051
    :102b2800200090000080fa00000006000200fa0071
    :102b3800000f78009e007800e14d88004822ef00e1
    :102b48008540a9009540a9004382a9004362a900d5
    :102b58004342a9004322a9004302a80042c2a90097
    :102b680042a2a90040c2a90041e2a8008540a900ec
    :102b78009540a8000080fa00000006000200fa0054
    :102b8800004f7800b0c9b3009e40780080cf500055
    :102b980004003a00f04d80000000e800f04d880085
    :102ba80001003700be29ef00c0c9bf000004e000e3
    :102bb80016003200104e80000000e00003003a00ca
    :102bc8001e80fb00204e880010003700104e800049
    :102bd800c1992000810040009e4878000000e8006c
    :102be800104e8800114e8000204e8000808f5000cb
    :102bf80006003a00e14d8000c09920000100010064
    :102c0800c229ef00c069ef00be29ef00f04d800037
    :102c1800e40f500003003a00c069ef0010c0b30091
    :102c2800c0e9b7000080fa00000006000000fa00c2
    :102c38004135800000fe2f00008060006000b30076
    :102c48004035880041358000f00f2e0080806000fc
    :102c58000070200001007000403588005135800068
    :102c680000fe2f00008060005000b300503588003f
    :102c78002136800000fe2f00008060007000b30045
    :102c8800203688000080fa00000006000000fa00e4
    :102c980090022000303a8800213a800000fe2f0080
    :102ca80000806000203a8800213a8000f0f32f006d
    :102cb800008060000060a000203a8800000000004a
    :102cc800113a800000022000008060000000e0004f
    :102cd800fbff320040a7a9006a00070040a7a80030
    :102ce800d2ff0700460007000060fe00330007001f
    :102cf800fdff37000000fa00d04e8000e14e800052
    :102d080000007800200e880000002800000e8800cf
    :102d1800c801a800c901a800ca21ef00c221ef001c
    :102d2800d621ef00d821ef00da21ef000080fa0069
    :102d3800000006000400fa00008fbe001e01be005d
    :102d4800d24e8800e34e8800d04e8000e14e8000cd
    :102d580000007800200e88000080fa0000000600bd
    :102d68000200fa00000f78001e0078006101b80028
    :102d7800d04e8000e14e8000009ab900040278002d
    :102d8800028bb90086027800050242000010b800e4
    :102d98000102420084007800000040008180480061
    :102da800823e20000300200099fd07000000780003
    :102db800b00e88000080fa00000006000000fa004b
    :102dc8000080fa00000006000200fa00000f7800f8
    :102dd8001e007800104078000080fb00ea0f5000c9
    :102de80005003a001e00e80099fd07008000eb008e
    :102df800f4fe0700000000000080fa000000060052
    :102e08000000fa001000200062fe0700806e21001a
    :102e180046ff070000fa200001002000e9fe070035
    :082e28000080fa000000060022
    :020000040000fa
    :102e3000c60900001400000000000000de090000c8
    :102e4000020000000200000010000000da0900008b
    :102e50000400000002000000f40100000000000077
    :102e6000000800009c01000000000000e0090000d4
    :102e700002000000020000000a0000009c0900009f
    :0c2e80002a00000000000000000000001c
    :020000040000fa
    :102e8c000000fa00c0ff2f0060198800c002a800e3
    :102e9c00c022a800c082a9000080fa000000060031
    :020000040000fa
    :0200000401f009
    :04000000ffff0000fe
    :020000040000fa
    :0200000401f009
    :04000800ffff0000f6
    :020000040000fa
    :0200000401f009
    :04000c00810000006f
    :020000040000fa
    :0200000401f009
    :040010008300000069
    :020000040000fa
    :0200000401f009
    :040014005f00000089
    :020000040000fa
    :0200000401f009
    :04001800f7000000ed
    :020000040000fa
    :0200000401f009
    :04001c00dfff000002
    :00000001FF
     
     
     

    post edited by Blue_Key - 2019/08/28 07:53:27
    #2
    newfound
    Super Member
    • Total Posts : 1846
    • Reward points : 0
    • Joined: 2003/11/07 12:35:49
    • Status: offline
    Re: Linker bootloader and hex file address issue 2019/08/28 08:16:52 (permalink)
    0
    There is nothing wrong with the linker. If you are going to be writing bootloaders and such you really need to understand the difference between the hex file addressing and the PICs addressing. 
     
    Hint: Hex files are byte addresses. The PIC24/dsPIC are word addresses where a word is 16-bits.
    #3
    NKurzman
    A Guy on the Net
    • Total Posts : 17817
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Linker bootloader and hex file address issue 2019/08/28 08:43:27 (permalink)
    0
    Hex file addresses are in Bytes. PIC33 Addresses are 16 bits. Flash Addresses are in 32 words.  make sure the number you are looking at means what you think it means.
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5