Page 1 of 1

STM32F7 - Switch from alternate function to normal pushpull

Posted: Thu Feb 22, 2018 1:50 pm
by elagil
Hello!

I have a problem when switching pin modes. First, a pin is used as normal output (push/pull) and I can switch it without problems.

Then, the pin is reused as a PWM output, so it has to be changed to an alternate function pin like this:

Code: Select all

palSetLineMode(LINE_FPGA_INOUT0, PAL_MODE_ALTERNATE(2));


I get PWM output as expected. However, if I want to use the pin as normal push/pull output again, after using

Code: Select all

palSetLineMode(LINE_FPGA_INOUT0, PAL_MODE_OUTPUT_PUSHPULL);


I cannot switch the pin manually anymore. Am I missing something? Why can it not be switched back to a normal push/pull pin again?

Thanks in advance,
Adrian

Re: STM32F7 - Switch from alternate function to normal pushpull

Posted: Thu Feb 22, 2018 2:15 pm
by Giovanni
Hi,

It should be possible to switch back, could you inspect the content of the related GPIO registers and see if the settings are those you would expect?

Giovanni