Skip to main content
DWalk.1
Associate
Oct 10, 2020 3:31 PM UTC
Solved

In STM32CubeMX, I'm trying to set TIM1 for PWM mode 1 for the STM32L412KB. This does not appear as one of the options.

Here is a screen shot of the options. It appears that PWM modes 1 and 2 are missing.0693W000004JKxqQAG.png

This topic has been closed for replies.
Khouloud OTHMAN
Khouloud OTHMANBest answer
Associate
Oct 13, 2020 10:14 AM UTC

Hello DWalk.1,

I can't find any attached .ioc file, please check that you have correctly attach it (the screenshot doesn't reveal so many details). Otherwise opening a new project using STM32L412KBTx, "PWM mode 1" / 2 could be selected if you have already selected the appropriate Channel Mode (Please see attached screenshot).

>Its just that now the STM32Cube program complains about invalid properties with the configuration and asks me if I want to generating the code anyway.

The issue isn't reproduced from my side, the code is generated without any problem and without showing any warning message.

0693W000004JZucQAG.pngRegards,

Khouloud.

5 replies

Khouloud OTHMAN
Associate
Oct 12, 2020 8:51 AM UTC

Hello DWalk.1,

Could you please share your .ioc file for further check ?

Thanks in advance.

Regards,

Khouloud.

DWalk.1
DWalk.1Author
Associate
Oct 12, 2020 5:59 PM UTC
Khouloud,
It is attached. Note that I manually changed the .ioc file to include the correct PWM parameters and the STM32Cube generates the correct code. Its just that now the STM32Cube program complains about invalid properties with the configuration and asks me if I want to generating the code anyway.
David Walker
David Walker
Khouloud OTHMAN
Khouloud OTHMANBest answer
Associate
Oct 13, 2020 10:14 AM UTC

Hello DWalk.1,

I can't find any attached .ioc file, please check that you have correctly attach it (the screenshot doesn't reveal so many details). Otherwise opening a new project using STM32L412KBTx, "PWM mode 1" / 2 could be selected if you have already selected the appropriate Channel Mode (Please see attached screenshot).

>Its just that now the STM32Cube program complains about invalid properties with the configuration and asks me if I want to generating the code anyway.

The issue isn't reproduced from my side, the code is generated without any problem and without showing any warning message.

0693W000004JZucQAG.pngRegards,

Khouloud.

DWalk.1
DWalk.1Author
Associate
Oct 13, 2020 5:24 PM UTC

Khouloud,

That was the problem exactly. I was set to "Output Compare Cx CNx", not the PWM mode. Once I changed it, it is working fine.

Maybe I get an award for the most baseless post of the week?

Thanks for you help!

David Walker

Khouloud OTHMAN
Associate
Oct 22, 2020 10:54 AM UTC

Hi DWalk.1,

Please select my post as Best is answered your question, so that thread is marked as solved.

Regards.

Khouloud.