Re-reading your original post, I had focused on your last sentence, which in context wasn't the right question.
You don't change anything in the boot loader. You replace the memory.ld script for applications with one that puts the .vectors region somewhere other than 0xff80, and keeps the flash size and offset from overlapping the bootloader. The bootloader then copies from the application .vectors into RAM. No need to change the main linker script at all, just provide a different memory.ld. You could also look at TinyOS and Contiki which I believe have solutions for this problem. Peter On Fri, Apr 18, 2014 at 3:02 PM, Peter Bigot <big...@acm.org> wrote: > On Fri, Apr 18, 2014 at 1:34 PM, Tomek Lorek <tlo...@gmail.com> wrote: >> 2014-04-18 19:40 GMT+02:00 Peter Bigot <big...@acm.org>: >> Thanks Peter! >> >>> Yes, if you define a naked function named _reset_vector__ that's in >>> section .init0 the mspgcc linker scripts will use it instead of the >>> default one. >>> >>> You'd want to do something like: >>> >>> __attribute__((__naked__,__section__(".init0"))) >>> void _reset_vector (void) >>> { >>> /* stuff goes here */ >>> } >> >> I;m not sure If I understand your hint correctly - the method above >> gives me the possibility of redefining the _reset_vector function >> body, but not the address. > > Yes. The address of the redefined function will be what's placed into > the vector table at the address where the MSP430 will load it on > power-up. I'm really not clear on how you're trying to accomplish > your goal; you can try to rework the linker script if you want, but as > I understand your intent it won't work. > > Looks like you've already discovered SYSRIVECT in SYSCTL, which could > be relevant too if you're working on an MCU that supports it. At a > high level what you'd need to do is have your modified reset vector > determine whether it needs to do any reconfiguration, do so, then jump > to the reset vector of the selected application. Accomplishing this > is left as an exercise for the developer and has little to do with > mspgcc, though others here may be able to provide additional help. > > Peter > >> >> I will try to rework the linker script or my application to something like >> this: >> >> MEMORY >> { >> ... >> init0: ORIGIN = 0x4400, LENGTH = 0x2 >> ... >> >> } >> >> SECTIONS >> { >> .init0 >> { >> *(.init0) >> } > init0 >> } >> >> and see if that works. >> >> Best Regards, >> Tomek ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users