|
| 1 | +.. _nucleo_g431kb_board: |
| 2 | + |
| 3 | +ST Nucleo G431KB |
| 4 | +################ |
| 5 | + |
| 6 | +Overview |
| 7 | +******** |
| 8 | + |
| 9 | +The Nucleo G431KB board features an ARM Cortex-M4 based STM32G431KB MCU |
| 10 | +with a wide range of connectivity support and configurations. |
| 11 | +Here are some highlights of the Nucleo G431KB board: |
| 12 | + |
| 13 | +- STM32 microcontroller in LQFP32 package |
| 14 | +- Arduino Nano V3 connectivity |
| 15 | +- On-board ST-LINK/V3E debugger/programmer |
| 16 | +- Flexible board power supply: |
| 17 | + |
| 18 | + - USB VBUS or external source(3.3 V, 5 V, 7 - 12 V) |
| 19 | + - Power management access point |
| 20 | + |
| 21 | +- Three LEDs: USB communication (LD1), power LED (LD3), user LED (LD2) |
| 22 | +- One push-button for RESET |
| 23 | + |
| 24 | +.. image:: img/nucleo_g431kb.webp |
| 25 | + :align: center |
| 26 | + :alt: Nucleo G431kB |
| 27 | + |
| 28 | +More information about the board can be found at the `Nucleo G431KB website`_. |
| 29 | + |
| 30 | +- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell. |
| 31 | + |
| 32 | +More information about STM32G431KB can be found here: |
| 33 | + |
| 34 | +- `STM32G431KB on www.st.com`_ |
| 35 | +- `STM32G4 reference manual`_ |
| 36 | + |
| 37 | +Supported Features |
| 38 | +================== |
| 39 | + |
| 40 | +The Zephyr ``nucleo_g431kb`` board target supports the following hardware features: |
| 41 | + |
| 42 | ++-----------+------------+-------------------------------------+ |
| 43 | +| Interface | Controller | Driver/Component | |
| 44 | ++===========+============+=====================================+ |
| 45 | +| NVIC | on-chip | nested vector interrupt controller | |
| 46 | ++-----------+------------+-------------------------------------+ |
| 47 | +| UART | on-chip | serial port-polling; | |
| 48 | +| | | serial port-interrupt | |
| 49 | ++-----------+------------+-------------------------------------+ |
| 50 | +| PINMUX | on-chip | pinmux | |
| 51 | ++-----------+------------+-------------------------------------+ |
| 52 | +| GPIO | on-chip | gpio | |
| 53 | ++-----------+------------+-------------------------------------+ |
| 54 | +| PWM | on-chip | pwm | |
| 55 | ++-----------+------------+-------------------------------------+ |
| 56 | +| I2C | on-chip | i2c | |
| 57 | ++-----------+------------+-------------------------------------+ |
| 58 | + |
| 59 | +Other hardware features are not yet supported on this Zephyr port. |
| 60 | + |
| 61 | +The default configuration can be found in the defconfig file: |
| 62 | +:zephyr_file:`boards/st/nucleo_g431kb/nucleo_g431kb_defconfig` |
| 63 | + |
| 64 | + |
| 65 | +Connections and IOs |
| 66 | +=================== |
| 67 | + |
| 68 | +Nucleo G431KB Board has 6 GPIO controllers. These controllers are responsible for pin muxing, |
| 69 | +input/output, pull-up, etc. |
| 70 | + |
| 71 | +For more details please refer to `STM32G4 Nucleo-32 board User Manual`_. |
| 72 | + |
| 73 | +Default Zephyr Peripheral Mapping: |
| 74 | +---------------------------------- |
| 75 | + |
| 76 | +.. rst-class:: rst-columns |
| 77 | + |
| 78 | +- LPUART_1_TX : PA2 |
| 79 | +- LPUART_1_RX : PA3 |
| 80 | +- LD2 : PB8 |
| 81 | +- PWM_4_CH_3 : PB8 |
| 82 | +- I2C_2_SCL : PA9 |
| 83 | +- I2C_2_SDA : PA8 |
| 84 | + |
| 85 | +System Clock |
| 86 | +------------ |
| 87 | + |
| 88 | +The Nucleo G431KB System Clock could be driven by internal or external oscillator, |
| 89 | +as well as main PLL clock. By default the external oscillator is not connected to the board. Therefore only the internal |
| 90 | +High Speed oscillator is supported. By default System clock is driven by PLL clock at 170 MHz, |
| 91 | +the PLL is driven by the 16 MHz high speed internal oscillator. |
| 92 | + |
| 93 | +Serial Port |
| 94 | +----------- |
| 95 | + |
| 96 | +Nucleo G431KB board has 1 U(S)ARTs and one LPUART. The Zephyr console output is assigned to LPUART1. |
| 97 | +Default settings are 115200 8N1. |
| 98 | + |
| 99 | +Please note that LPUART1 baudrate is limited to 9600 if the MCU is clocked by LSE (32.768 kHz) in |
| 100 | +low power mode. |
| 101 | + |
| 102 | +Programming and Debugging |
| 103 | +************************* |
| 104 | + |
| 105 | +Nucleo G431KB Board includes an ST-Link/V3 embedded debug tool interface. |
| 106 | + |
| 107 | +Applications for the ``nucleo_g431kb`` board target can be built and |
| 108 | +flashed in the usual way (see :ref:`build_an_application` and |
| 109 | +:ref:`application_run` for more details). |
| 110 | + |
| 111 | +Flashing |
| 112 | +======== |
| 113 | + |
| 114 | +The board is configured to be flashed using west `STM32CubeProgrammer`_ runner, |
| 115 | +so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required. |
| 116 | + |
| 117 | +Alternatively, OpenOCD, or pyOCD can also be used to flash the board using |
| 118 | +the ``--runner`` (or ``-r``) option: |
| 119 | + |
| 120 | +.. code-block:: console |
| 121 | +
|
| 122 | + $ west flash --runner openocd |
| 123 | + $ west flash --runner pyocd |
| 124 | +
|
| 125 | +To enable support of the STM32G431KB SoC in pyOCD, its pack has to be installed first: |
| 126 | + |
| 127 | +.. code-block:: console |
| 128 | +
|
| 129 | + $ pyocd pack --update |
| 130 | + $ pyocd pack --install stm32g431kb |
| 131 | +
|
| 132 | +Flashing an application to Nucleo G431KB |
| 133 | +---------------------------------------- |
| 134 | + |
| 135 | +Connect the Nucleo G431KB to your host computer using the USB port, |
| 136 | +then run a serial host program to connect with your Nucleo board. |
| 137 | + |
| 138 | +.. code-block:: console |
| 139 | +
|
| 140 | + $ minicom -D /dev/ttyACM0 |
| 141 | +
|
| 142 | +Now build and flash an application. Here is an example for |
| 143 | +:zephyr:code-sample:`hello_world`. |
| 144 | + |
| 145 | +.. zephyr-app-commands:: |
| 146 | + :zephyr-app: samples/hello_world |
| 147 | + :board: nucleo_g431kb |
| 148 | + :goals: build flash |
| 149 | + |
| 150 | +You should see the following message on the console: |
| 151 | + |
| 152 | +.. code-block:: console |
| 153 | +
|
| 154 | + $ Hello World! nucleo_g431kb/stm32g431xx |
| 155 | +
|
| 156 | +Debugging |
| 157 | +========= |
| 158 | + |
| 159 | +You can debug an application in the usual way. Here is an example for the |
| 160 | +:zephyr:code-sample:`hello_world` application. |
| 161 | + |
| 162 | +.. zephyr-app-commands:: |
| 163 | + :zephyr-app: samples/hello_world |
| 164 | + :board: nucleo_g431kb |
| 165 | + :maybe-skip-config: |
| 166 | + :goals: debug |
| 167 | + |
| 168 | +References |
| 169 | +********** |
| 170 | + |
| 171 | +.. target-notes:: |
| 172 | + |
| 173 | +.. _Nucleo G431KB website: |
| 174 | + https://www.st.com/en/evaluation-tools/nucleo-g431kb.html |
| 175 | + |
| 176 | +.. _STM32G4 Nucleo-32 board User Manual: |
| 177 | + https://www.st.com/resource/en/user_manual/um2397-stm32g4-nucleo32-board-mb1430-stmicroelectronics.pdf |
| 178 | + |
| 179 | +.. _STM32g431kb Nucleo-32 board schematic: |
| 180 | + https://www.st.com/resource/en/schematic_pack/mb1430-g431kbt6-a02_schematic_internal.pdf |
| 181 | + |
| 182 | +.. _STM32G431KB on www.st.com: |
| 183 | + https://www.st.com/en/microcontrollers-microprocessors/stm32g431kb.html |
| 184 | + |
| 185 | +.. _STM32G4 reference manual: |
| 186 | + https://www.st.com/resource/en/reference_manual/rm0440-stm32g4-series-advanced-armbased-32bit-mcus-stmicroelectronics.pdf |
| 187 | + |
| 188 | +.. _STM32CubeProgrammer: |
| 189 | + https://www.st.com/en/development-tools/stm32cubeprog.html |
0 commit comments