Ok then... I just browsed upcoming 3.4 code... there user can put any pre-init rotines to section .init1 this is not implemented in 3.2. ~d
On Tuesday 20 January 2004 20:59, Bill Knight wrote: > Dimitry > I use the IAR __low_level_init extensively in my projects. > > 1) temporarily hold the watchdog. > 2) start a high speed crystal so everything else goes fast. > 3) initialize the IO ports so board hardware is in a known state. > 4) wait for the oscillator to stablize > 5) set the various clocks & their dividers > 6) restart the watchdog with appropriate values > 7) return to startup routine to zero .bss, copy .data, and call main() > > Regards > -Bill Knight > R O SOftWare > > > On Tue, 20 Jan 2004 19:39:03 +0300, Dmitry wrote: > > now I see... > > There is only the way to do this -- redefine interrupt vectors table. > then write you preintializer, then call __reset_vector. > > I actually did not think much about it. > Any example of the _real_ situation/environment when you need to do some > pre-inits? > > ~d > > > Could you explain in short words, what do you mean? > > (I am only a C-newbie. I am a hardware engineer, who knows a possible > > architecture of the MSP430 and the assembler very well.) > > > > > 2. make your 'main' doing low_level_init then branch to real main. > > > > This would lead to the fact, that _reset_vector__ is computed first. > > Then a CALL to a initialisation function would be done and after this, > > the real body of main would be executed > > > > This is not what I would like to have. > > > > Let me describe in assembler, what I want: > > > > _reset_vector__: > > MOV #0x5A80,&0x0120 ;hold watchdog (optional) > > MOV #0x0A00,R1 ;initialize SP > > CALL #__low_level_init > > ;do all the other stuff > > ;what has to be done > > ;in the C prologue > > ;NOTE: > > ;this should be automatical generated > > ;by the C-compiler > > JMP main > > > > > > main: > > ;main program > > ;... > > > > > > __low_level_init: > > ;do specific low level init > > ;before the C-prologue is computed > > RET > > > > > > My intention is, to have specific initialisazion at the very first time, > > because the C-prologue may be too time consuming to do it afterwards (or > > there are some other reasons...). To achieve this, I don't want to write > > my own _reset_vector__, because this should be automatically made by the > > compiler (that can do this better than me). > > > > This mechanism is offered by IARs C-Compiler and called > > "__low_level_init". So I am asking if there is a similar solution for > > MSP430-GCC. > > > > Ralf > > > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by EclipseCon 2004 > > Premiere Conference on Open Tools Development and Integration > > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > > http://www.eclipsecon.org/osdn > > _______________________________________________ > > Mspgcc-users mailing list > > Mspgcc-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/mspgcc-users -- /***************************************************************** ("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ `6_ 6 ) `-. ( ).`-.__.`) State Polytechnical Univ. (_Y_.)' ._ ) `._ `. ``-..-' Radio-Physics Departament _..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia (il),-'' (li),' ((!.-' +7 (812) 5403923, 5585314 *****************************************************************/