2017-08-03 11:31 AM
Thank you for your patronage.
I'm Japanese.
I want to use
Interrupt Service Routine(ISR)
as shown in the picture below. So I want to use HAL_HRTIM_IRQHandler.I wrote the program as shown below, but I got an error.
Solved! Go to Solution.
2017-08-03 01:33 PM
Hi inoue.ken,
Maybe if you could provide to the forum more information we could help you better!
For the warning I suppose that you are using the HAL libraries with the CubeMX, when you work with those libraries the function for the IRQ handler is created by default, so you don't have to declare it again. The functions which you have to modify are the callbacks. The default function for the IRQ handler is the following:
As you can see, the function takes the program to another function depending on the source of the interruption. I'm not completely sure if the interruptions in your case are the HRTIM_HRTIM_ISR, HRTIM_Master_ISR or HRTIM_Timer_ISR, but in the file stm32f3xx_hal_hrtim.c you can check all the callbacks and declare the proper functions:
For example, in the compare 1 and compare 3 you have to read a value, so you must declare the callback of those functions, by default the callbacks are declare as weak in the file:
So you have to declare the function without the weak in other file of your code as in the main, and in the callback do the things that you have to do in the interruption:
And do the same for the period callback that is where you have to update the values (I'm not sure if is HAL_HRTIM_BurstModePeriodCallback(hhrtim); or HAL_HRTIM_RepetitionEventCallback(hhrtim, HRTIM_TIMERINDEX_MASTER); or HAL_HRTIM_RegistersUpdateCallback(hhrtim, HRTIM_TIMERINDEX_MASTER);, or HAL_HRTIM_RepetitionEventCallback(hhrtim, TimerIdx); or HAL_HRTIM_RegistersUpdateCallback(hhrtim, TimerIdx); you should try those, sorry for can't give to you the exactly information ) but for example if is
HAL_HRTIM_BurstModePeriodCallback(hhrtim); the declaration will be:
Hope that be helpful for you! (by the way I'm Colombian not Columbian !nice to meet you)
2017-08-03 01:33 PM
Hi inoue.ken,
Maybe if you could provide to the forum more information we could help you better!
For the warning I suppose that you are using the HAL libraries with the CubeMX, when you work with those libraries the function for the IRQ handler is created by default, so you don't have to declare it again. The functions which you have to modify are the callbacks. The default function for the IRQ handler is the following:
As you can see, the function takes the program to another function depending on the source of the interruption. I'm not completely sure if the interruptions in your case are the HRTIM_HRTIM_ISR, HRTIM_Master_ISR or HRTIM_Timer_ISR, but in the file stm32f3xx_hal_hrtim.c you can check all the callbacks and declare the proper functions:
For example, in the compare 1 and compare 3 you have to read a value, so you must declare the callback of those functions, by default the callbacks are declare as weak in the file:
So you have to declare the function without the weak in other file of your code as in the main, and in the callback do the things that you have to do in the interruption:
And do the same for the period callback that is where you have to update the values (I'm not sure if is HAL_HRTIM_BurstModePeriodCallback(hhrtim); or HAL_HRTIM_RepetitionEventCallback(hhrtim, HRTIM_TIMERINDEX_MASTER); or HAL_HRTIM_RegistersUpdateCallback(hhrtim, HRTIM_TIMERINDEX_MASTER);, or HAL_HRTIM_RepetitionEventCallback(hhrtim, TimerIdx); or HAL_HRTIM_RegistersUpdateCallback(hhrtim, TimerIdx); you should try those, sorry for can't give to you the exactly information ) but for example if is
HAL_HRTIM_BurstModePeriodCallback(hhrtim); the declaration will be:
Hope that be helpful for you! (by the way I'm Colombian not Columbian !nice to meet you)
2017-08-06 02:37 PM
Thanks a million! I'm really sorry for late reply. I understand I
don't have to declare IRQ Handler again.
The information you gave me a lot of help. Because I do not have anyone using ST microcomputers around, it is very helpful. I will do my best at university research. Thank you very much.