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

New board nucleo g431kb #78091

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

nagelkl
Copy link

@nagelkl nagelkl commented Sep 6, 2024

Added support for the ST Microelectronics nucleo g431kb board

The board port supports GPIO, PWM, the console and an i2c interface

Copy link

github-actions bot commented Sep 6, 2024

Hello @nagelkl, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

boards/st/nucleo_g431kb/doc/img/nucleo_g431kb.jpg Outdated Show resolved Hide resolved
boards/st/nucleo_g431kb/doc/index.rst Outdated Show resolved Hide resolved
boards/st/nucleo_g431kb/doc/index.rst Outdated Show resolved Hide resolved
boards/st/nucleo_g431kb/nucleo_g431kb.dts Outdated Show resolved Hide resolved
boards/st/nucleo_g431kb/nucleo_g431kb_defconfig Outdated Show resolved Hide resolved
boards/st/nucleo_g431kb/nucleo_g431kb_defconfig Outdated Show resolved Hide resolved
Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

also squash to 1 commit

@nagelkl nagelkl force-pushed the new_board_nucleo_g431kb branch from 7230571 to b1e8d85 Compare September 10, 2024 06:58
@nagelkl nagelkl requested a review from nordicjm September 10, 2024 07:00
@nordicjm
Copy link
Collaborator

also build error needs looking at and resolving

@nagelkl nagelkl force-pushed the new_board_nucleo_g431kb branch from 738ff49 to 618fda0 Compare September 19, 2024 18:27
@nagelkl nagelkl requested a review from JarmouniA September 20, 2024 05:18
Comment on lines 92 to 96
stm32_lp_tick_source: &lptim1 {
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x80000000>,
<&rcc STM32_SRC_LSE LPTIM1_SEL(3)>;
status = "okay";
};
Copy link
Member

Choose a reason for hiding this comment

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

You're declaring LSE as LPTIM source clock but it is not enabled.
Do you actually need LPTIM (used for power mgmt).

Copy link
Author

Choose a reason for hiding this comment

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

No, actually i don't neet power management, i will remove it

Copy link
Author

Choose a reason for hiding this comment

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

When i delete the &lptim1 from the dts- file all tested samples build without error and run fine but all twister tests in tests/lib/cpp/cxx fail due to a warning:
Kconfig for LPTIM source clock (LSE/LSE) is deprecated, use device tree.

I found that in the final generated .config file there is the line
CONFIG_STM32_LPTIM_TIMER=y
and
CONFIG_STM32_LPTIM_CLOCK_LSI=y

even if i delete the &lptim1 part from the dts- file.
I can not find where or how this Config Property gets set for the testsuite in tests/lib/cpp/cxx.
Am I missing something here?

Copy link
Member

Choose a reason for hiding this comment

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

The test case in question enables CONFIG_PM unconditionally, but on STM32 targets (from series which supports PM such as G4) a specific low power ticker configuration is required, which should be provided by lptim.

So, given this test configuration, you actually can't spare the following PM config:

&clk_lse {
	status = "okay";
};

stm32_lp_tick_source: &lptim1 {
	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x80000000>,
		 <&rcc STM32_SRC_LSE LPTIM1_SEL(3)>;
	status = "okay";
};

Copy link
Author

Choose a reason for hiding this comment

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

So for the PR i have to enable the lptim1 again in the Device Tree? Or should the test be changed? As i understand the purpose of the testcase is to check the different library configurations, why is there a dependency to power management?

boards/st/nucleo_g431kb/nucleo_g431kb_defconfig Outdated Show resolved Hide resolved
boards/st/nucleo_g431kb/nucleo_g431kb.dts Outdated Show resolved Hide resolved
boards/st/nucleo_g431kb/nucleo_g431kb.dts Show resolved Hide resolved
@nagelkl nagelkl force-pushed the new_board_nucleo_g431kb branch from 618fda0 to 1f6b18e Compare October 9, 2024 17:05
erwango
erwango previously approved these changes Oct 10, 2024
Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

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

@JarmouniA PTAL

nordicjm
nordicjm previously approved these changes Oct 10, 2024
@FRASTM
Copy link
Collaborator

FRASTM commented Oct 11, 2024

to fix the CI failure, add the clock domain definition for the lptim, in the board DTS, with LSI as clock source for the LPTIM. The nucleo32 board has no LSE clock.

stm32_lp_tick_source: &lptim1 {
	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x80000000>,
		<&rcc STM32_SRC_LSI LPTIM1_SEL(1)>;
};

@nagelkl nagelkl dismissed stale reviews from nordicjm and erwango via 955dbda October 11, 2024 12:24
@nagelkl nagelkl force-pushed the new_board_nucleo_g431kb branch from 1f6b18e to 955dbda Compare October 11, 2024 12:24
@nagelkl nagelkl force-pushed the new_board_nucleo_g431kb branch from 955dbda to a6cf9f1 Compare October 11, 2024 16:56
@nagelkl nagelkl requested a review from kartben October 11, 2024 18:08
Copy link
Collaborator

@kartben kartben left a comment

Choose a reason for hiding this comment

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

Did a more thorough review of the docs, sorry I didn't do this the first time around

Overview
********

The Nucleo G431kB board features an ARM Cortex-M4 based STM32G431kB MCU
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe a spell checker played tricks on you? Just noticed this sorry

Suggested change
The Nucleo G431kB board features an ARM Cortex-M4 based STM32G431kB MCU
The Nucleo G431KB board features an ARM Cortex-M4 based STM32G431KB MCU

Copy link
Author

Choose a reason for hiding this comment

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

The port started with a copy from the Nucleo G431RB board and some find and replace actions

Here are some highlights of the Nucleo G431kB board:

- STM32 microcontroller in LQFP32 package
- Arduino nano V3 connectivity
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Arduino nano V3 connectivity
- Arduino Nano V3 connectivity

- On-board ST-LINK/V3E debugger/programmer
- Flexible board power supply:

- USB VBUS or external source(3.3V, 5V, 7 - 12V)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- USB VBUS or external source(3.3V, 5V, 7 - 12V)
- USB VBUS or external source(3.3 V, 5 V, 7-12 V)


More information about the board can be found at the `Nucleo G431KB website`_.

- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell*
Copy link
Collaborator

Choose a reason for hiding this comment

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

Assuming this is a copy-paste from somewhere, the asterisk probably doesn't make sense here?

Suggested change
- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell*
- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell.


- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell*

More information about STM32G431RB can be found here:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
More information about STM32G431RB can be found here:
More information about STM32G431KB can be found here:

Comment on lines 90 to 91
High Speed oscillator is supported. By default System clock is driven by PLL clock at 170MHz,
the PLL is driven by the 16MHz high speed internal oscillator.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
High Speed oscillator is supported. By default System clock is driven by PLL clock at 170MHz,
the PLL is driven by the 16MHz high speed internal oscillator.
High Speed oscillator is supported. By default System clock is driven by PLL clock at 170 MHz,
the PLL is driven by the 16 MHz high speed internal oscillator.

Comment on lines 132 to 135
Flashing an application to Nucleo G431kB
----------------------------------------

Connect the Nucleo G431kB to your host computer using the USB port,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Flashing an application to Nucleo G431kB
----------------------------------------
Connect the Nucleo G431kB to your host computer using the USB port,
Flashing an application to Nucleo G431KB
----------------------------------------
Connect the Nucleo G431KB to your host computer using the USB port,


.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: nucleo_g431rb
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
:board: nucleo_g431rb
:board: nucleo_g431kb

boards/st/nucleo_g431kb/doc/index.rst Outdated Show resolved Hide resolved
boards/st/nucleo_g431kb/doc/index.rst Outdated Show resolved Hide resolved
boards/st/nucleo_g431kb/doc/index.rst Outdated Show resolved Hide resolved
Add support for the nucleo g431kb Board.

Signed-off-by: Klaus Nagel <[email protected]>
@nagelkl nagelkl force-pushed the new_board_nucleo_g431kb branch from a6cf9f1 to 72d68ad Compare October 11, 2024 21:12
@nagelkl nagelkl requested a review from kartben October 12, 2024 06:13
Copy link
Collaborator

@kartben kartben left a comment

Choose a reason for hiding this comment

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

+1 for docs, thx!

Copy link
Member

@erwango erwango 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 patience in making all the changes that have been requested.
Approved

@carlescufi carlescufi merged commit 03959a2 into zephyrproject-rtos:main Oct 15, 2024
17 checks passed
Copy link

Hi @nagelkl!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants