THANKS! As I mentioned before, I find linker scripts pretty cryptic. I'll see if I can figure out what you're suggesting. Yes, this is for a bootloader. What I need is to ensure that my function that copies firmware from external flash to internal flash is always at the same address in the boot section. I originally put a jump table in, but it ended up in the application area instead of the boot area, so I cannot rely on it. I need to ensure my function stays at the correct address. So far, I've done this by having the application send an error message to the UART I'm watching during debug if the function is not at the right address. I then add or subtract nops to fix it (ideally it would not move anyway, but sometimes things change). I adapted the default linker script back in 2010 for this. It does not have a MEMORY section, but, instead, includes ProcDefs.ld, which I modified and renamed, and which DOES have a MEMORY section. I have: kseg0_boot_mem : ORIGIN =3D 0x9FC00490, LENGTH =3D 0x970 BootJumpTable_mem : ORIGIN =3D 0x9FC01000, LENGTH =3D 0x1000 However, it looks like I never made a section that used BootJumpTable_mem, so that's probably why the jump table ended up in the application flash. My current thinking is that I need to create a small MEMORY section at the address I want my function to end up at, then create a SECTIONS with an ORIGIN with the MEMORY section name. Does that sound about right? It would sure be easier if the address attribute worked! THANKS! Harold > Harold, > > I used assembly just because I wanted to ensure that the entry-point had > a fixed length. I have an array of them. > > You can use "__attribute__((section(...),keep))" in a C function. > > Cheers, > > Isaac > > > > Em 09/01/2018 15:38, Isaac M. Bavaresco escreveu: >> Oops! Forgot some pieces... And used a wrong address... >> >> >> In the linker-script: >> >> _SECONDARY_ENTRY_PT =3D 0xBFC02F00; >> MEMORY >> { >> ... >> /* Do not forget to reduce kseg0_program_mem to exclude the bytes of >> the section below */ >> secondary_entry_pt : ORIGIN =3D 0xBFC02F00, LENGTH =3D=C2=A0=C2=A0=C2= =A0=C2=A0 0x10 >> ... >> } >> SECTIONS >> { >> ... >> .secondary_entry_pt _SECONDARY_ENTRY_PT : >> { >> KEEP(*(.secondary_entry_pt.*)) >> KEEP(*(.secondary_entry_pt)) >> } > secondary_entry_pt >> ... >> } >> >> >> EntryPoint.S: >> >> /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D*/ >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .set=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 nomips16 >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .set=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 noreorder >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .set =C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 noat >> /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D*/ >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .extern=C2=A0=C2=A0=C2=A0 EntryPoi= nt >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .global=C2=A0=C2=A0=C2=A0 Secondar= yEntryPoint >> >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .section .secondary_entry_pt,code,= keep >> >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .ent=C2=A0=C2=A0=C2=A0 SecondaryEn= tryPoint >> >> SecondaryEntryPoint: >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 la=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 $k0,EntryPoint >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 jr=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 $k0 >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 nop >> >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .end=C2=A0=C2=A0=C2=A0 SecondaryEn= tryPoint >> /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D*/ >> >> Somewhere.c: >> >> void EntryPoint( void ) >> { >> ... >> } >> >> >> >> Em 09/01/2018 12:31, Harold Hallikainen escreveu: >>> Thanks! Apparently that does now work in the boot section of flash. I >>> saw >>> that written somewhere online yesterday. I tried it anyway and got >>> "address attribute ignored." >>> >>> Thanks! More ideas? >>> >>> Harold >>> >>>> You can do it without changing the linker script: >>>> >>>> __attribute__((address())) >>>> ( ){... >>>> >>>> Cheers, >>>> >>>> Isaac >>>> >>>> >>>> >>>> Em 09/01/2018 03:21, Harold Hallikainen escreveu: >>>>> I'm finding linker scripts to be pretty cryptic, and the >>>>> documentation >>>>> from Microchip only slightly less so. >>>>> >>>>> I have a couple functions that I've managed to get into boot flash, >>>>> but >>>>> I'd like to set the addresses of these functions. How do I do that? >>>>> >>>>> Thanks! >>>>> >>>>> Harold >>>>> >>>>> >>>>> >>>> --- >>>> Este email foi escaneado pelo Avast antiv=C3=83=C2=ADrus. >>>> https://www.avast.com/antivirus >>>> >>>> >>>> -- >>>> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive >>>> View/change your membership options at >>>> http://mailman.mit.edu/mailman/listinfo/piclist >>>> > > > --- > Este email foi escaneado pelo Avast antiv=C3=ADrus. > https://www.avast.com/antivirus > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 FCC Rules Updated Daily at http://www.hallikainen.com Not sent from an iPhone. --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .