Page 1 of 1

modify crt0.c file

Posted: Fri Jun 20, 2014 12:58 pm
by Pask
Hi i have the following problem:

i have added a call function in the crt0.c before the main call

init_FPB();
main();

i include my file .h (that contains the body of the function init_FPB) in the crt0.c file and so works.

but if I want to specify the body of the function in a file .c and leave only his signature in the. h does not work why?
I included file .c in the project but doesnt work.

Re: modify crt0.c file

Posted: Fri Jun 20, 2014 2:30 pm
by Giovanni
You should not modify the crt0.c, do things in main.c.

Giovanni

Re: modify crt0.c file

Posted: Sat Jun 21, 2014 7:59 am
by Pask
Giovanni i need to modify it because i need some operation before main() function. Can you help me pls?

Re: modify crt0.c file

Posted: Sat Jun 21, 2014 8:22 am
by Giovanni
You may use an initializer function, see the GCC documentation, or use __late_init() in board.c.

Giovanni

Re: modify crt0.c file

Posted: Sat Jun 21, 2014 9:24 am
by Pask
Giovanni sono un tirocinante alla laurea magistrale presso l'università Federico II di Napoli. Durante l'attività di tirocinio sto utilizzando ChibiOS.
Avrei qualche domanda da farti e volevo sapere se possiamo liberamente parlarne in italiano qui nel forum.

Re: modify crt0.c file

Posted: Sat Jun 21, 2014 11:06 am
by Giovanni
Please stick to english on the forum, PM me.

Giovanni