Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32: F1 GPIO: Enable AFIO clock #4944

Merged
merged 1 commit into from
Aug 29, 2017
Merged

Conversation

LMESTM
Copy link
Contributor

@LMESTM LMESTM commented Aug 21, 2017

Description

It is required to enable AFIO clock before using __HAL_AFIO_REMAP_xy
macros, which was missing here. Without clocks enable, the remap
actually doesn't occur. This would possibly cause some PIOs (part of
PB_3, PB_4, PA_13, PA_14, PA_15) to not behave as expected.

In most cases AFIO clock was enabled in stm_pin_SetAFPin function, so
that this bug was not visible. But there were few cases left were
stm_pin_DisconnectDebug would be called first. A typical case was
with GCC_ARM in case a DigitalInOut variable is declared as global.

Status

READY

Tests

Few MBED2 tests were failing on GCC_ARM/IAR before the fix.
Now:

Test ID Test Description Target Toolchain Result
MBED_A5 DigitalIn DigitalOut NUCLEO_F103RB ARM OK
MBED_A5 DigitalIn DigitalOut NUCLEO_F103RB GCC_ARM OK
MBED_A5 DigitalIn DigitalOut NUCLEO_F103RB IAR OK
MBED_A5 DigitalIn DigitalOut NUCLEO_F103RB uARM OK
MBED_A6 DigitalInOut NUCLEO_F103RB ARM OK
MBED_A6 DigitalInOut NUCLEO_F103RB GCC_ARM OK
MBED_A6 DigitalInOut NUCLEO_F103RB IAR OK
MBED_A6 DigitalInOut NUCLEO_F103RB uARM OK
MBED_A7 InterruptIn NUCLEO_F103RB ARM OK
MBED_A7 InterruptIn NUCLEO_F103RB GCC_ARM OK
MBED_A7 InterruptIn NUCLEO_F103RB IAR OK
MBED_A7 InterruptIn NUCLEO_F103RB uARM OK

It is required to enable AFIO clock before using __HAL_AFIO_REMAP_xy
macros, which was missing here. Without clocks enable, the remap
actually doesn't occur. This would possibly cause some PIOs (part of
PB_3, PB_4, PA_13, PA_14, PA_15) to not behave as expected.

In most cases AFIO clock was enabled in stm_pin_SetAFPin function, so
that this bug was not visible. But there were few cases left were
stm_pin_DisconnectDebug would be called first. A typical case was
with GCC_ARM in case a DigitalInOut variable is declared as global.
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 21, 2017

retest uvisor

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 21, 2017

/morph test

@theotherjimmy
Copy link
Contributor

retest uvisor

@mazimkhan
Copy link

uvisor retest

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 21, 2017

retest uvisor

@studavekar
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1132

All builds and test passed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants