Skip to content

Commit a573632

Browse files
committed
feat(Reset_Handler): Call extern BoardInit() function for early hardware initialization
1 parent 8ff88b0 commit a573632

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Inc/ST-LIB.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,3 +342,10 @@ template <auto&... devs> struct Board {
342342
};
343343

344344
} // namespace ST_LIB
345+
346+
/**
347+
* @brief This is a function that gets called early in the startup process,
348+
* before the global constructors and main() are called.
349+
* It is responsible for initializing the hardware and peripherals
350+
*/
351+
extern void BoardInit(void);

StartupCode.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ Reset_Handler:
6262
b .L_loop_zero_table
6363
.L_done_zero_table:
6464

65+
/* Call board init (user defined function) */
66+
bl BoardInit
67+
6568
/* Call static constructors */
6669
bl __libc_init_array
6770

0 commit comments

Comments
 (0)