Home › Forums › Mastering STM32 book support forum › interrupts priority don't works for me
Tagged: qwe-
- This topic has 4 replies, 2 voices, and was last updated 8 years, 3 months ago by jano.
-
AuthorPosts
-
August 8, 2016 at 8:03 pm #3681janoParticipant
hi!
I’m testing the example on the chapter 7, about interrupts priority, but it never works, the button and the pin2 have the same behavior/priority (i.e. if I fire the button first then the pin2 does nothing, if I fire the pin2 first then the button does nothing). I tried with different combinations of the priority/sub-priority and added another loop at different speed on the led to see what happens, but the interrupt with higher level never stops the one who was fired first, the same if I add breakpoints at the debug or use no debug.
any ideas?August 10, 2016 at 9:23 pm #3688Carmine NovielloKeymasterHi Jano,
Apologize me for late reply.Which Nucleo are you using? Are you using book project examples or are you arranging a project by yourself?
August 12, 2016 at 3:41 pm #3737janoParticipanthi Carmine!
I’m using the nucleo410re, eclipse neon on linux mint 17.3. I tried the example CH7-EX3 and like I said before, the interrupt on PB2 never stops the one fired by the blue button, I played a bit with the options but nothing changes, to be a bit more sure I added breakpoints on the callback and they’ve called when inputs are on that state, also copied the code from the book to the template created on the ch-5, always the same result 🙁
Attached is the main-ex3.c modified.
I also tried to create from CubeMX, but I’m plenty of errors on the file stm32f4xx_hal_dma.c like:
Description Resource Path Location Type
‘DMA_HandleTypeDef {aka struct __DMA_HandleTypeDef}’ has no member named ‘XferAbortCallback’ stm32f4xx_hal_dma.c /sie/system/src/stm32f4xx line 879 C/C++ Problem
(a lot like this), and:
Description Resource Path Location Type
‘HAL_DMA_ERROR_NO_XFER’ undeclared (first use in this function) stm32f4xx_hal_dma.c /sie/system/src/stm32f4xx line 591 C/C++ Problemand more, should I do something with the DMA in CubeMX?
Best!
Attachments:
You must be logged in to view attached files.August 16, 2016 at 7:39 am #3791Carmine NovielloKeymasterHi Jano,
What about the global priority grouping? It’s usually set inside the stm32f4xx_hal_msp.c file.Carmine
August 16, 2016 at 8:26 pm #3799janoParticipantyes! the only enabled group was:
HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);
I added the other 4 and it works now!another issue is the generation with CubeMX, I don’t know how but the first time I made it works (with the script cubeimporter.py). After that moment (maybe due some update?) every project created with the method to be used in combination with CubeMX refuses to compile and says:
make: *** No rule to make targetsystem/src/cmsis/vectors_stm32f4xx.o', needed by
pr13.elf’. Stop.ok, I go then and copy back the file vectors_stm32f4xx.c to system/src/cmsis/ and it works! so the cubeimporter is deleting one extra file. The most curious thing is: I can go after the first compilation and delete that file, clean, rebuild c index, compile and it works again!
The clean command is not ‘cleaning enough’ ? -
AuthorPosts
- You must be logged in to reply to this topic.