STM32F7 - Switch from alternate function to normal pushpull

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

elagil
Posts: 92
Joined: Tue Sep 19, 2017 7:38 am
Has thanked: 8 times
Been thanked: 7 times

STM32F7 - Switch from alternate function to normal pushpull

Postby elagil » Thu Feb 22, 2018 1:50 pm

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

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: STM32F7 - Switch from alternate function to normal pushpull

Postby Giovanni » Thu Feb 22, 2018 2:15 pm

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


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 20 guests