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

STM32L4 : Fix GPIO G port compatibility #3780

Merged
merged 2 commits into from Mar 6, 2017

Conversation

Projects
None yet
6 participants
@pmancele
Contributor

pmancele commented Feb 15, 2017

Description

Fix #3771 by adding functions to enable GPIOF and GPIOG clocks for STM32L4 targets.
For GPIOG the VDDIO2 external VDD is also activated as it is the one who supply pins PG2 to PG15

@adustm

Hello, thank you for your contribution.
Please apply the comment I have done. I think it is (at least one of) the reason why the travis build has failed.
Kind regards
Armelle

targets/TARGET_STM/TARGET_STM32L4/pinmap.c Outdated
@@ -79,7 +79,17 @@ uint32_t Set_GPIO_Clock(uint32_t port_idx)
gpio_add = GPIOE_BASE;
__HAL_RCC_GPIOE_CLK_ENABLE();
break;
#endif
#endif
case PortF:

This comment has been minimized.

@adustm

adustm Feb 16, 2017

Member

Hello, can you please add #if defined (GPIOF_BASE) ?
This file is located in STM32_L4 directory and shall be compatible with every STM32L4 device. STM32L432 for instance doesn't have GPIO port F or G.

targets/TARGET_STM/TARGET_STM32L4/pinmap.c Outdated
gpio_add = GPIOF_BASE;
__HAL_RCC_GPIOF_CLK_ENABLE();
break;
case PortG:

This comment has been minimized.

@adustm

adustm Feb 16, 2017

Member

Hello, can you please add #if defined (GPIOG_BASE) ?

@0xc0170 0xc0170 added the needs: work label Feb 16, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 16, 2017

@0xc0170 0xc0170 added the needs: CLA label Feb 16, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 16, 2017

Please look at travis, it fails (please test this patch set for various targets that it at least compiles).

@pmancele

This comment has been minimized.

Contributor

pmancele commented Feb 16, 2017

@0xc0170 I already signed the CLA with my acount on developer.mbed.org. My acount on developer.mbed.com and GitHub have different names but the same mail address

@adustm

This comment has been minimized.

Member

adustm commented Feb 17, 2017

LGTM
Thank you @pmancele !

@sg-

This comment has been minimized.

Member

sg- commented Feb 17, 2017

My account on developer.mbed.com and GitHub have different names but the same mail address

Mind dropping a link to your developer account?

@sg- sg- added ready for merge and removed needs: work labels Feb 17, 2017

@sg-

This comment has been minimized.

Member

sg- commented Feb 17, 2017

/morph test

@mbed-bot

This comment has been minimized.

mbed-bot commented Feb 18, 2017

Result: SUCCESS

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

/morph test

Output

mbed Build Number: 1635

All builds and test passed!

@pmancele

This comment has been minimized.

Contributor

pmancele commented Feb 20, 2017

@sg- @0xc0170 here is a link to my developper account on which i signed the CLA https://developer.mbed.org/users/peyo/
My account name is peyo

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 20, 2017

@pmancele Thanks

@0xc0170 0xc0170 removed the needs: CLA label Feb 20, 2017

@sg-

This comment has been minimized.

Member

sg- commented Feb 21, 2017

@pmancele Needs a conflict resolved.

@0xc0170 0xc0170 added needs: work and removed ready for merge labels Feb 21, 2017

@pmancele

This comment has been minimized.

Contributor

pmancele commented Feb 22, 2017

@sg- wow it seems that the MR #3665 changed a lots of STM files.
The file I modified doesn't exist anymore (targets/TARGET_STM/TARGET_STM32L4/pinmap.c)

Now there is a file at a higher level which enable the gpio clocks (targets/TARGET_STM/gpio_api.c)

The GPIOG_clock_enable() is now defined for targets which have a G port, but the function to activate the VDDIO2 power supply is still missing for targets who need it (at least all the STL32L476xx that have a G port)
To update my Pull Request I guess I should get the last mbed-os commit, and modify the gpio_api.c ?
To fix the issue for STM32L476xx target I purpose this:

   #if defined GPIOG_BASE
           case PortG:
 + #if defined STM32L476xx
 +          __HAL_RCC_PWR_CLK_ENABLE();
 +          HAL_PWREx_EnableVddIO2();
 + #endif
             gpio_add = GPIOG_BASE;
             __GPIOG_CLK_ENABLE();
         break;

(my modifications are the 4 lines starting with a "+")

What do you think of this @adustm ? Maybe all L4 need the VDDIO2 power supply for G port so it should be, #if defined STM32L4 instead of #if defined STM32L476xx
What is sure is that every STM32L476xx need it (i checked the reference manuals) and this modifications fix the issue.

EDIT : I checked and the use of VDDIO2 to supply G port is common to all L4 family so I will insert a #if defined STM32L4

@pmancele pmancele closed this Feb 22, 2017

@pmancele pmancele reopened this Feb 22, 2017

@LMESTM

LMESTM approved these changes Feb 27, 2017

Thanks for your contribution 👍

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Feb 27, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 27, 2017

/morph test

@mbed-bot

This comment has been minimized.

mbed-bot commented Feb 27, 2017

Result: SUCCESS

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

/morph test

Output

mbed Build Number: 1596

All builds and test passed!

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 27, 2017

retest uvisor

@0xc0170 0xc0170 removed the needs: CI label Feb 27, 2017

@adustm

This comment has been minimized.

Member

adustm commented Mar 2, 2017

ping

@0xc0170 0xc0170 merged commit 8fb95a6 into ARMmbed:master Mar 6, 2017

4 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-test Job has started
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment