Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions os/common/startup/ARMCMx/compilers/GCC/crt0_v6m.S
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@
.thumb_func
.global _crt0_entry
_crt0_entry:
ldr R0, =__entry_hook
blx R0

/* Interrupts are globally masked initially.*/
cpsid i

Expand Down
3 changes: 3 additions & 0 deletions os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@
.thumb_func
.global _crt0_entry
_crt0_entry:
ldr R0, =__entry_hook
blx R0

/* Interrupts are globally masked initially.*/
cpsid i

Expand Down
14 changes: 14 additions & 0 deletions os/common/startup/ARMCMx/compilers/GCC/crt1.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ void __cpu_init(void) {
}

/**
* @brief called immediately at Reset
* @details This hook is invoked immediately after the Reset Handler
*
* @note This function is a weak symbol.
*/
#if !defined(__DOXYGEN__)
__attribute__((weak))
#endif
/*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
#ifndef __ARDUPILOT__
void __entry_hook(void) {}
#endif

/**
* @brief Early initialization.
* @details This hook is invoked immediately after the stack and core
* initialization and before the DATA and BSS segments
Expand Down