2024-04-17 04:52 PM
Hi folks,
I use MX to generate a code for STM32L4. I noticed, when I configure timer in one pulse mode, I cannot set OC CH1 in PWM mode with CubeMX. I could set it manually after code was generated, but it would be overwritten if I run MX one more time.
Could someone explain, if it is a bug in the tool or "feature"?
Cheers
Solved! Go to Solution.
2024-04-18 04:04 AM
Hello @Lex,
When working with stm32cubeMX, it's important to understand that the tool provides initial configurations but it might not cover all possible combinations or specific use cases.
For your specific use case, STM32CubeMX does not allow this configuration directly, you will need to manually adjust the generated code.
To prevent overwriting your manual changes you can use the /* USER CODE BEGIN */ and /* USER CODE END */ sections provided, Alternatively, create a separate function for your PWM configuration and call this function from the main application after the MX_TIMx_Init() call.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-04-18 04:04 AM
Hello @Lex,
When working with stm32cubeMX, it's important to understand that the tool provides initial configurations but it might not cover all possible combinations or specific use cases.
For your specific use case, STM32CubeMX does not allow this configuration directly, you will need to manually adjust the generated code.
To prevent overwriting your manual changes you can use the /* USER CODE BEGIN */ and /* USER CODE END */ sections provided, Alternatively, create a separate function for your PWM configuration and call this function from the main application after the MX_TIMx_Init() call.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.