2024-07-17 02:30 PM
I'm a bit of a novice at programming, but I'm trying to develop an application that sends a continuous stream of data out of the USART using DMA, taking advantage of the DMA Transfer Half-Complete, and Transfer-Complete interrupts.
I've got a circular DMA USART transmission working, but when I enable either of the interrupts, my code goes into an InfiniteLoop: handler.
I'm using a BluePill (STM32F103C8) and writing in VSCode / PlatformIO with the Arduino-ststm32 framework.
I can't figure out how to tell the code where I want it to go when either of these interrupts fire.
I'm doing a lot of this programming "bare-metal" because I don't really know how to determine what core and/or library tools I have available to utilize. I see a lot of examples on the internet, but invariably they are using a different setup (framework etc) than I am, so their code doesn't really port to my IDE.
Help?!
Here is my code (couldn't figure out how to attach it)
Solved! Go to Solution.
2024-07-17 06:33 PM
Thanks for the reply, but this guidance is still quite vague to me.
I found this in the startup_stm32f103x6.s file
g_pfnVectors:
.word _estack
.word Reset_Handler
.word NMI_Handler
...
.word DMA1_Channel1_IRQHandler
.word DMA1_Channel2_IRQHandler
.word DMA1_Channel3_IRQHandler
...
.weak DMA1_Channel2_IRQHandler
.thumb_set DMA1_Channel2_IRQHandler,Default_Handler
so I added this to the end of my main routine:
2024-07-17 04:14 PM
You need to implement the functions as they are listed in the vector table. In STM32CubeIDE, this is in the startup_*.s file, likely yours is the same or similar. Without those defined, the default handler is launched.
Look for a function name similar to USART3_IRQHandler and implement that. Similar for the other one. Name might be a little different, like DMA1_Channel2_3_IRQHandler.
2024-07-17 06:33 PM
Thanks for the reply, but this guidance is still quite vague to me.
I found this in the startup_stm32f103x6.s file
g_pfnVectors:
.word _estack
.word Reset_Handler
.word NMI_Handler
...
.word DMA1_Channel1_IRQHandler
.word DMA1_Channel2_IRQHandler
.word DMA1_Channel3_IRQHandler
...
.weak DMA1_Channel2_IRQHandler
.thumb_set DMA1_Channel2_IRQHandler,Default_Handler
so I added this to the end of my main routine: