Skip to content

Commit b9cd0a3

Browse files
ABOSTMfpistm
authored andcommitted
fix: set Ethernet Timer priority to 15
Aim is to have Ethernet Timer priority lower (higher value) than Systick (including FreeRTOS usecase) Signed-off-by: Alexandre Bourdiol <[email protected]>
1 parent a55d412 commit b9cd0a3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/utility/stm32_eth.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@
6767
#warning "Default timer used to call ethernet scheduler at regular interval: TIM14"
6868
#endif
6969

70+
/* Interrupt priority */
71+
#ifndef ETH_TIM_IRQ_PRIO
72+
#define ETH_TIM_IRQ_PRIO 15 // Warning: it should be lower prio (higher value) than Systick
73+
#endif
74+
#ifndef ETH_TIM_IRQ_SUBPRIO
75+
#define ETH_TIM_IRQ_SUBPRIO 0
76+
#endif
7077
/* Ethernet configuration: user parameters */
7178
struct stm32_eth_config {
7279
ip_addr_t ipaddr;
@@ -182,6 +189,7 @@ static void TIM_scheduler_Config(void)
182189
{
183190
/* Configure HardwareTimer */
184191
EthTim = new HardwareTimer(DEFAULT_ETHERNET_TIMER);
192+
EthTim->setInterruptPriority(ETH_TIM_IRQ_PRIO, ETH_TIM_IRQ_SUBPRIO);
185193
EthTim->setMode(1, TIMER_OUTPUT_COMPARE);
186194

187195
/* Timer set to 1ms */

0 commit comments

Comments
 (0)