
Hi Andreas,
Le 04/12/2010 14:14, Andreas Bießmann a écrit :
- In start.s the vector table is relocated from _start to 0x00. But at this time 0x00 is remaped to nor flash.
Hmm... This copy (not a relocation) should be done after cpu_init_crit / lowlevel_init, which should have at least configured some RAM; but you are right that mapping to 0 is somewhat arbitrary, since the reset vectors could be some other places (0xffff0000, for instance).
I think this is historic. I remind of the same sequence in an old atmel provided pre-loader code. I think we can omit this and let the linker do the location of vector table, are we? Will have a look for that tomorrow evening.
Just a note: the linker will place the reset vector and some others at the location where reset actually occurs (hopefully), but the system, once started, may well redefine the *exception* vectors, for instance to get interrupts working (some boards use IRQs). On targets that boot from NOR, the system cannot overwrite the exception vectors at the link-time NOR location: it must move the vectors location to RAM. So no, the linker cannot always do the location of the vector table.
regards
Andreas Bießmann
Amicalement,