Hopefully, the name of my thread is not too ambiguous ...
Anyway, in the SPL package for STM32L1 (provided by ST Microelectronics) there is a file, startup_stm32l1xx_xl.s used for initialization, and there is a portion of code where SystemInit function is inserted and executed first (before giving control to the main function):
/* Call the clock system intitialization function.*/
bl SystemInit
/* Call static constructors */
bl __libc_init_array
/* Call the application's entry point.*/
bl main
bx lr
and, in pascal, there is this code:
bl PASCALMAIN
b HaltProc
so, I understand that you give control directly to the main block of your pascal program so, if I write a similar procedure with SystemInit, all I need to do to call it first is to insert it as the first line of code in the pascal main block, right? Like below?
begin
SystemInit;
{ other initializations }
{ and the rest of the code }
end.
Thank you!