Skip to content

Commit d97a887

Browse files
committed
Interrupt Record Functionality Added
- User button interrupt is enabled and SystemView interrupt record function calls are added.
1 parent b452401 commit d97a887

File tree

5 files changed

+51
-8
lines changed

5 files changed

+51
-8
lines changed

Micrium with SystemView/.cproject

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@
104104
</toolChain>
105105
</folderInfo>
106106
<sourceEntries>
107+
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="SEGGER"/>
107108
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
108-
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
109109
<entry excluding="BSP/bsp.h" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Micrium"/>
110-
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="SEGGER"/>
110+
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
111111
</sourceEntries>
112112
</configuration>
113113
</storageModule>

Micrium with SystemView/Core/Inc/stm32f4xx_it.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ void DebugMon_Handler(void);
5656
void PendSV_Handler(void);
5757
void SysTick_Handler(void);
5858
void TIM1_UP_TIM10_IRQHandler(void);
59+
void EXTI15_10_IRQHandler(void);
5960
/* USER CODE BEGIN EFP */
6061

6162
/* USER CODE END EFP */

Micrium with SystemView/Core/Src/main.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,29 @@ static void MX_GPIO_Init(void)
217217
/* USER CODE END MX_GPIO_Init_1 */
218218

219219
/* GPIO Ports Clock Enable */
220+
__HAL_RCC_GPIOC_CLK_ENABLE();
220221
__HAL_RCC_GPIOB_CLK_ENABLE();
221222

222223
/*Configure GPIO pin Output Level */
223224
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0|GPIO_PIN_14|GPIO_PIN_7, GPIO_PIN_RESET);
224225

226+
/*Configure GPIO pin : PC13 */
227+
GPIO_InitStruct.Pin = GPIO_PIN_13;
228+
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
229+
GPIO_InitStruct.Pull = GPIO_NOPULL;
230+
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
231+
225232
/*Configure GPIO pins : PB0 PB14 PB7 */
226233
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_14|GPIO_PIN_7;
227234
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
228235
GPIO_InitStruct.Pull = GPIO_NOPULL;
229236
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
230237
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
231238

239+
/* EXTI interrupt init*/
240+
HAL_NVIC_SetPriority(EXTI15_10_IRQn, 0, 0);
241+
HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
242+
232243
/* USER CODE BEGIN MX_GPIO_Init_2 */
233244
/* USER CODE END MX_GPIO_Init_2 */
234245
}
@@ -368,6 +379,11 @@ static void checkError(OS_ERR *err){
368379
}
369380
}
370381

382+
383+
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin){
384+
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_14);
385+
}
386+
371387
/* USER CODE END 4 */
372388

373389
/**

Micrium with SystemView/Core/Src/stm32f4xx_it.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "stm32f4xx_it.h"
2323
/* Private includes ----------------------------------------------------------*/
2424
/* USER CODE BEGIN Includes */
25+
#include "SEGGER_SYSVIEW.h"
2526
/* USER CODE END Includes */
2627

2728
/* Private typedef -----------------------------------------------------------*/
@@ -213,6 +214,24 @@ void TIM1_UP_TIM10_IRQHandler(void)
213214
/* USER CODE END TIM1_UP_TIM10_IRQn 1 */
214215
}
215216

217+
/**
218+
* @brief This function handles EXTI line[15:10] interrupts.
219+
*/
220+
void EXTI15_10_IRQHandler(void)
221+
{
222+
/* USER CODE BEGIN EXTI15_10_IRQn 0 */
223+
SEGGER_SYSVIEW_RecordEnterISR();
224+
SEGGER_SYSVIEW_Print("Entered EXTI15_10 interrupt.");
225+
226+
/* USER CODE END EXTI15_10_IRQn 0 */
227+
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13);
228+
/* USER CODE BEGIN EXTI15_10_IRQn 1 */
229+
230+
SEGGER_SYSVIEW_Print("Exiting EXTI15_10 interrupt.");
231+
SEGGER_SYSVIEW_RecordExitISR();
232+
/* USER CODE END EXTI15_10_IRQn 1 */
233+
}
234+
216235
/* USER CODE BEGIN 1 */
217236

218237
/* USER CODE END 1 */

Micrium with SystemView/Micrium with SystemView.ioc

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ CAD.formats=
33
CAD.pinconfig=
44
CAD.provider=
55
File.Version=6
6+
GPIO.groupedBy=Group By Peripherals
67
KeepUserPlacement=false
78
Mcu.CPN=STM32F439ZIT6
89
Mcu.Family=STM32F4
@@ -12,18 +13,20 @@ Mcu.IP2=SYS
1213
Mcu.IPNb=3
1314
Mcu.Name=STM32F439Z(G-I)Tx
1415
Mcu.Package=LQFP144
15-
Mcu.Pin0=PB0
16-
Mcu.Pin1=PB14
17-
Mcu.Pin2=PB7
18-
Mcu.Pin3=VP_SYS_VS_tim1
19-
Mcu.PinsNb=4
16+
Mcu.Pin0=PC13
17+
Mcu.Pin1=PB0
18+
Mcu.Pin2=PB14
19+
Mcu.Pin3=PB7
20+
Mcu.Pin4=VP_SYS_VS_tim1
21+
Mcu.PinsNb=5
2022
Mcu.ThirdPartyNb=0
2123
Mcu.UserConstants=
2224
Mcu.UserName=STM32F439ZITx
2325
MxCube.Version=6.10.0
2426
MxDb.Version=DB.6.0.100
2527
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false\:false
2628
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:true\:false\:false
29+
NVIC.EXTI15_10_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
2730
NVIC.ForceEnableDMAVector=true
2831
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false\:false
2932
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:true\:false\:false
@@ -42,6 +45,8 @@ PB14.Locked=true
4245
PB14.Signal=GPIO_Output
4346
PB7.Locked=true
4447
PB7.Signal=GPIO_Output
48+
PC13.Locked=true
49+
PC13.Signal=GPXTI13
4550
PinOutPanel.RotationAngle=0
4651
ProjectManager.AskForMigrate=true
4752
ProjectManager.BackupPrevious=false
@@ -73,7 +78,7 @@ ProjectManager.ToolChainLocation=
7378
ProjectManager.UAScriptAfterPath=
7479
ProjectManager.UAScriptBeforePath=
7580
ProjectManager.UnderRoot=true
76-
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false
81+
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true
7782
RCC.48MHZClocksFreq_Value=96000000
7883
RCC.ADC12outputFreq_Value=72000000
7984
RCC.ADC34outputFreq_Value=72000000
@@ -141,6 +146,8 @@ RCC.VCOSAIOutputFreq_ValueR=98000000
141146
RCC.VcooutputI2S=384000000
142147
RCC.VcooutputI2SQ=384000000
143148
RCC.WatchDogFreq_Value=32000
149+
SH.GPXTI13.0=GPIO_EXTI13
150+
SH.GPXTI13.ConfNb=1
144151
VP_SYS_VS_tim1.Mode=TIM1
145152
VP_SYS_VS_tim1.Signal=SYS_VS_tim1
146153
board=NUCLEO-F439ZI

0 commit comments

Comments
 (0)