Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions libs/HALf3/include/HALf3/stm32f3xx_it.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ void SVC_Handler(void);
void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void ensure_interrupt_linkage();
Comment thread
DannyCato marked this conversation as resolved.
Outdated
/* USER CODE BEGIN EFP */

/* USER CODE END EFP */
Expand Down
6 changes: 6 additions & 0 deletions libs/HALf3/src/stm32f3xx_it.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function does not do anything, but ensures that the compiler/linker works and inserts the important
Comment thread
DannyCato marked this conversation as resolved.
* interrupt handlers from this file. What took Collin two weeks, took us an hour and a half >:)
*/
inline void ensure_interrupt_linkage() {}

/**
* @brief This function handles Non maskable interrupt.
*/
Expand Down
1 change: 1 addition & 0 deletions libs/HALf4/include/HALf4/stm32f4xx_it.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ void BusFault_Handler(void);
void UsageFault_Handler(void);
void DebugMon_Handler(void);
void SysTick_Handler(void);
void ensure_interrupt_linkage();

#ifdef __cplusplus
}
Expand Down
7 changes: 7 additions & 0 deletions libs/HALf4/src/stm32f4xx_it.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function does not do anything, but ensures that the compiler/linker works and inserts the important
* interrupt handlers from this file. What took Collin two weeks, took us an hour and a half >:)
*/
inline void ensure_interrupt_linkage() {}

/**
* @brief This function handles Non maskable interrupt.
*/
Expand Down Expand Up @@ -177,6 +183,7 @@ void PendSV_Handler(void)
/* USER CODE END PendSV_IRQn 1 */
}


/**
* @brief This function handles System tick timer.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/core/platform/f3xx/stm32f302x8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ void stm32f3xx_init() {
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);
*/

SysTick_Handler();
// This function ensures that the interrupt handlers in stm32f4xx_it.c properly link
Comment thread
DannyCato marked this conversation as resolved.
Outdated
ensure_interrupt_linkage();
}

} // namespace core::platform
3 changes: 2 additions & 1 deletion src/core/platform/f4xx/stm32f446xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ void stm32f4xx_init() {
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);
*/

SysTick_Handler();
Comment thread
DannyCato marked this conversation as resolved.
// This function ensures that the interrupt handlers in stm32f4xx_it.c properly link
ensure_interrupt_linkage();
}

void Error_Handler(void) {
Expand Down
4 changes: 4 additions & 0 deletions src/core/platform/f4xx/stm32f469xx.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <HALf4/stm32f4xx.h>
#include <HALf4/stm32f4xx_hal.h>
#include <HALf4/stm32f4xx_it.h>

#include <core/platform/f4xx/stm32f4xx.hpp>

Expand Down Expand Up @@ -51,6 +52,9 @@ void stm32f4xx_init() {
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
Error_Handler();
}

// This function ensures that the interrupt handlers in stm32f4xx_it.c properly link
ensure_interrupt_linkage();
}

void Error_Handler(void) {
Expand Down
Loading