2019-09-26 09:53 AM
CubeMX selects and will not disable code generation for SVC and PendSV interrupts.
The generated empty ISR handlers in stm32f4xx_it.c conflict with FreeRTOS handlers:
IOC is attached. This did not happen in other projects.
Windows 10, STM32CubeIDE Version: 1.0.2, Build: 3566_20190716-0927 (UTC)
@Markus GIRDLAND - Can you verify that you can reproduce and ticket opened?
Thanks, Best Regards, Dave
2019-09-27 03:12 AM
This seems to be way more in the CubeMX side of things, @Nawres GHARBI any chance you could take a look at it?
2019-09-27 01:14 PM
@Nawres GHARBI - Have you had a chance to look at this?
Also, can you open a related ticket:
All generated empty handlers should be weak so customers can provide their own implementations without mucking with CubeMX regeneration.
This includes the above and similar handlers.
In your generated freertos.c file you already specifiy weak for hook functions, but you need to add weak to StartDefaultTask.
Thanks!
Best Regards, Dave
2019-10-08 03:33 PM
@Nawres GHARBI ? @Markus GIRDLAND ? Anybody there??
2019-10-11 04:06 AM
Hello @Dave Nadler
Thanks for the feedback,
it will be fixed in the next STM32CubeMX release.
Best regards,
Nesrine
2019-10-14 05:44 AM
Hello @Dave Nadler
Try to reproduce the same configuration on a new .ioc. You will no longer find an error message.
Best regards,
Nesrine
2019-10-14 06:56 AM
@Nesrine.JLASSI - What do you mean a new IOC ?
I have existing projects I need to work with.
Please STM, just fix the bug so generated code is correct!
Thanks,
Best Regards, Dave
2020-03-16 04:05 PM
I too battled with this problem! It has not been fixed as of latest version. Here is my workaround for anyone else having this problem. At the top of your stm32xxxx_it.c file, add the following to effectively rename the auto generated functions. Then you can use the FreeRTOS defined ones in their place. It also will prevent STM32CubeMX replacing them on every code generation.
Even worse, is if you call the FreeRTOS pendSVHandler from inside the auto generated interrupts, you get stack corruption as FreeRTOS expects these handler to be called directly without wrapper functions that push onto the stack!
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
void UnusedHandler1(void);
void UnusedHandler2(void);
#define PendSV_Handler UnusedHandler1
#define SVC_Handler UnusedHandler2
/* USER CODE END PD */
2020-03-24 09:56 AM
Hello @Dave Nadler
Could you please provide us the procedures used to generate this .Ioc,
Please, try to disable the "Generate peripheral initialization as a pair of '.c/.h" function and tell me if it can solve the problem.
Regards,
Nesrine
2020-03-30 09:11 AM
@Nesrine.JLASSI , @Amel NASRI , @Camilo LEMOS - It is absolutely appalling that this is still not fixed after more than 6 months!
I just regenerated code using the attached IOC using CubeMX IDE 1.3, FW_F4 V1.24.2, and
it is still producing bogus non-weak SVC and PendSV handlers!
For heavens sake, get this fixed already!!
Really now!!!