modify crt0.c file

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
Pask
Posts: 47
Joined: Thu Jun 19, 2014 3:51 pm

modify crt0.c file

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: modify crt0.c file

Post by Giovanni »

You should not modify the crt0.c, do things in main.c.

Giovanni
Pask
Posts: 47
Joined: Thu Jun 19, 2014 3:51 pm

Re: modify crt0.c file

Post by Pask »

Giovanni i need to modify it because i need some operation before main() function. Can you help me pls?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: modify crt0.c file

Post by Giovanni »

You may use an initializer function, see the GCC documentation, or use __late_init() in board.c.

Giovanni
Pask
Posts: 47
Joined: Thu Jun 19, 2014 3:51 pm

Re: modify crt0.c file

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: modify crt0.c file

Post by Giovanni »

Please stick to english on the forum, PM me.

Giovanni
Post Reply