-
Notifications
You must be signed in to change notification settings - Fork 3k
Support for ST STM32 NUCLEO-G431KB Development Board #13979
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
Conversation
@taunomagnusson, thank you for your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also update CMakelists.txt file? I assume one should be added to STM32G4 folder where we select this 431 target, plus also new CMakelists to TARGET_STM32G431xB. This should help you ARMmbed/mbed-os-5-docs#1381 (will be integrated soon to be available publicly in docs).
be10e4d
to
5113c60
Compare
Hi,
Ok:
- Modified CMakeLists.txt for TARGET_STM32G431xB to include
TARGET_NUCLEO_G431KB
- Created CMakesLists.txt for TARGET_NUCLEO_G431KB
- Rebased to latest ARMmbed/mbed-os master
- Reverted README.md to original version.
…On Mon, Nov 30, 2020 at 9:59 AM Martin Kojtal ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Can you also update CMakelists.txt file? I assume one should be added to
STM32G4 folder where we select this 431 target, plus also new CMakelists to
TARGET_STM32G431xB. This should help you ARMmbed/mbed-os-5-docs#1381
<ARMmbed/mbed-os-5-docs#1381> (will be integrated
soon to be available publicly in docs).
------------------------------
In README.md
<#13979 (comment)>:
> @@ -1,48 +1,30 @@
-[![Mbed OS][mbed-os-logo]][mbed-os-link]
+README.md
Can you revert Readme changes, it should not be part of target addition.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13979 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQVIPAS33P2OZU5YLGVGMMDSSNNI3ANCNFSM4UFLY3HQ>
.
|
targets/TARGET_STM/TARGET_STM32G4/STM32Cube_FW/CMSIS/stm32g431xx.h
Outdated
Show resolved
Hide resolved
targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G431xB/TARGET_NUCLEO_G431KB/PeripheralPins.c
Outdated
Show resolved
Hide resolved
targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G431xB/TARGET_NUCLEO_G431KB/PeripheralPins.c
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For PeripheralsPins.c, try #13992 :-)
python targets/TARGET_STM/tools/STM32_gen_PeripheralPins.py -t M40_Nucleo_NUCLEO-G431KB
targets/TARGET_STM/TARGET_STM32G4/STM32Cube_FW/CMSIS/stm32g431xx.h
Outdated
Show resolved
Hide resolved
targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G431xB/TARGET_NUCLEO_G431KB/PeripheralPins.c
Outdated
Show resolved
Hide resolved
@jeromecoutant @0xc0170 could you re-review please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't accept "USBDEVICE" in the targets.json,
as there is no USB user connector.
Move this in your local mbed_app.json
targets/TARGET_STM/TARGET_STM32G4/STM32Cube_FW/CMSIS/stm32g431xx.h
Outdated
Show resolved
Hide resolved
In parallel, I executed test suite, all tests are OK except,
|
* | 2- USE_PLL_HSE_XTAL (external 8 MHz xtal) | ||
* | 3- USE_PLL_HSI (internal 16 MHz) | ||
*----------------------------------------------------------------- | ||
* SYSCLK(MHz) | 64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to copy paste system_clock.c file from #14149
targets/TARGET_STM/TARGET_STM32G4/STM32Cube_FW/CMSIS/stm32g431xx.h
Outdated
Show resolved
Hide resolved
targets/TARGET_STM/TARGET_STM32G4/STM32Cube_FW/STM32G4xx_HAL_Driver/stm32g4xx_hal.c
Outdated
Show resolved
Hide resolved
targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G431xB/CMakeLists.txt
Outdated
Show resolved
Hide resolved
This pull request has automatically been marked as stale because it has had no recent activity. , please complete review of the changes to move the PR forward. Thank you for your contributions. |
@taunomagnusson Would you be able to respond to the review or shall this be closed? |
Hi - I will fix it. Some other things that took priority. Expect a update in a few days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one cosmetic change, otherwise LGTM
targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G431xB/CMakeLists.txt
Outdated
Show resolved
Hide resolved
* | 3- USE_PLL_HSI (internal 16 MHz) | ||
*----------------------------------------------------------------- | ||
* SYSCLK(MHz) | 160 (default configuration) / 170 (CAN disabled) | ||
* USB capable | NO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should set as YES ?
(maybe with comment "to be set in mbed_app.json" ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you removed the code for that.
So as you want, you can add back clock configuration for USB, or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll add back the clock config then! Then it's just a targets.json edit to get the USB Device up and running.
Will modify to YES and add some comments. Need to test it a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I see now that the RCC clock is connected to HSI48 in trng_api.c/trng_init using HAL_RCCEx_PeriphCLKConfig.
However, there is no similar construct in the init phase for USB (USBPhyHw.h/USBPhy_STM32.cpp).
I see that RCC_CCIPR/CLK48SEL resets to 00 (HSI48 Selected) though, so if it is preserved after reset USB should work without a HAL_RCCEx_PeriphCLKConfig statement in system_clock.c (or in USBPhy_STM32.cpp).
But is that good practice? Or better to keep the HAL_RCCEx_PeriphCLKConfig enabling statement in either system_clock.c or USBPhy_STM32.cpp? Note that RCC clock is also selected on CLK48SEL, and it adds a HAL_RCCEx_PeriphCLKConfig (in trng_api.c) to enable it in its init procedure.
In addition, several other boards have a CLK48SEL enabling statement using HAL_RCCEx_PeriphCLKConfig in their system_clock.c (DISCO/NUCLEO_F413ZH, NUCLEO_F446RE/ZE, DISCO_F469NI, ...).
Anyway, I've added the HAL_RCCEx_PeriphCLKConfig for USB Clock in G431KB/system_clock.c. I'd recommend this - if you are ok with that you might want to consider it for 474RE as well (to keep the code aligned).
…on. Also added so that the CK48 Clock Mux selects HSI48 for both RNG and USB. Without these the RNG/USB will be clocked at PLLQ (170 MHz) and not work.
…e HSI48 CLK for USB. Assumption is that the STM32G4 reset value (defaults to HSI48 selected for USB) is preserved throughout Mbed initialization.
…ard platforms (NUCLEO_F413ZH, ...)) it appears that even though the reset value defaults correctly it may be good practice to keep the HAL_RCCEx_PeriphCLKConfig statement that selects the HSI48CLK as source for USB/RNG.
This pull request has automatically been marked as stale because it has had no recent activity. @ARMmbed/mbed-os-maintainers, please start CI to get the PR merged. |
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
Adding support for ST STM32 NUCLEO-G431KB Development Board
Impact of changes
Not applicable
Migration actions required
Not applicable
Documentation
None
Pull request type
Test results
mbed_test_report.txt
Reviewers
@jeromecoutant