Skip to content

STM32L4 : Fix GPIO G port compatibility #3780

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

Merged
merged 2 commits into from
Mar 6, 2017
Merged

STM32L4 : Fix GPIO G port compatibility #3780

merged 2 commits into from
Mar 6, 2017

Conversation

pmancele
Copy link
Contributor

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

Copy link
Member

@adustm adustm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@@ -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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

gpio_add = GPIOF_BASE;
__HAL_RCC_GPIOF_CLK_ENABLE();
break;
case PortG:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 16, 2017

@pmancele Can you please sign CLA: https://developer.mbed.org/contributor_agreement/

@0xc0170
Copy link
Contributor

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
Copy link
Contributor Author

@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
Copy link
Member

adustm commented Feb 17, 2017

LGTM
Thank you @pmancele !

@sg-
Copy link
Contributor

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-
Copy link
Contributor

sg- commented Feb 17, 2017

/morph test

@mbed-bot
Copy link

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
Copy link
Contributor Author

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
Copy link
Contributor

0xc0170 commented Feb 20, 2017

@pmancele Thanks

@sg-
Copy link
Contributor

sg- commented Feb 21, 2017

@pmancele Needs a conflict resolved.

@pmancele
Copy link
Contributor Author

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
Copy link
Contributor

@LMESTM LMESTM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution 👍

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 27, 2017

/morph test

@mbed-bot
Copy link

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
Copy link
Contributor

0xc0170 commented Feb 27, 2017

retest uvisor

@0xc0170 0xc0170 removed the needs: CI label Feb 27, 2017
@adustm
Copy link
Member

adustm commented Mar 2, 2017

ping

@0xc0170 0xc0170 merged commit 8fb95a6 into ARMmbed:master Mar 6, 2017
aisair pushed a commit to aisair/mbed that referenced this pull request Apr 30, 2024
Ports for Upcoming Targets


Fixes and Changes

3716: fix for issue #3715: correction in startup files for ARM and IAR, alignment of system_stm32f429xx.c files ARMmbed/mbed-os#3716
3741: STM32 remove warning in hal_tick_32b.c file ARMmbed/mbed-os#3741
3780: STM32L4 : Fix GPIO G port compatibility ARMmbed/mbed-os#3780
3831: NCS36510: SPISLAVE enabled (Conflict resolved) ARMmbed/mbed-os#3831
3836: Allow to redefine nRF's PSTORAGE_NUM_OF_PAGES outside of the mbed-os ARMmbed/mbed-os#3836
3840: STM32: gpio SPEED - always set High Speed by default ARMmbed/mbed-os#3840
3844: STM32 GPIO: Typo correction. Update comment (GPIO_IP_WITHOUT_BRR) ARMmbed/mbed-os#3844
3850: STM32: change spi error to debug warning ARMmbed/mbed-os#3850
3860: Define GPIO_IP_WITHOUT_BRR for xDot platform ARMmbed/mbed-os#3860
3880: DISCO_F469NI: allow the use of CAN2 instance when CAN1 is not activated ARMmbed/mbed-os#3880
3795: Fix pwm period calc ARMmbed/mbed-os#3795
3828: STM32 CAN API: correct format and type ARMmbed/mbed-os#3828
3842: TARGET_NRF: corrected spi_init() to properly handle re-initialization ARMmbed/mbed-os#3842
3843: STM32L476xG: set APB2 clock to 80MHz (instead of 40MHz) ARMmbed/mbed-os#3843
3879: NUCLEO_F446ZE: Add missing AnalogIn pins on PF_3, PF_5 and PF_10. ARMmbed/mbed-os#3879
3902: Fix heap and stack size for NUCLEO_F746ZG ARMmbed/mbed-os#3902
3829: can_write(): return error code when no tx mailboxes are available ARMmbed/mbed-os#3829
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