diff --git a/boards/arm/stm32/b-g431b-esc1/README.txt b/Documentation/platforms/arm/stm32g4/boards/b-g431b-esc1/index.rst similarity index 78% rename from boards/arm/stm32/b-g431b-esc1/README.txt rename to Documentation/platforms/arm/stm32g4/boards/b-g431b-esc1/index.rst index 8b355f6da5..daf51175e3 100644 --- a/boards/arm/stm32/b-g431b-esc1/README.txt +++ b/Documentation/platforms/arm/stm32g4/boards/b-g431b-esc1/index.rst @@ -1,32 +1,37 @@ -README -====== +============== +ST B-G431B-ESC +============== -The B-G431B-ESC Discovery kit board is based on the STM32G431CB microcontroller, +The B-G431B-ESC board is based on the STM32G431CB microcontroller, the L6387 driver and STL180N6F7 power MOSFETs. UART/USART PINS --------------- -USART2 is accessible through J3 pads and ST LINK Virtual Console: +USART2 is accessible through J3 pads and ST LINK Virtual Console:: + USART2_TX - PB3 USART2_RX - PB4 Configuration Sub-directories -------------------------- +----------------------------- - nsh: - --- - Configures the NuttShell (nsh) located at apps/examples/nsh. The - Configuration enables the serial interfaces on USART2. +nsh: +---- - foc_f32 and foc_b16: - --------------------- - FOC examples based on hardware on board. +Configures the NuttShell (nsh) located at apps/examples/nsh. The +Configuration enables the serial interfaces on USART2. - Pin configuration: +foc_f32 and foc_b16: +--------------------- +FOC examples based on hardware on board. + +Pin configuration: + + ============== ============== =============== Board Function Chip Function Chip Pin Number - -------------- -------------- --------------- + ============== ============== =============== Phase U high TIM1_CH1 PA8 Phase U low TIM1_CH1N PC13 Phase V high TIM1_CH2 PA9 @@ -55,6 +60,7 @@ Configuration Sub-directories BEMF1 ADC2_IN17 PA4 BEMF2 ADC2_IN5 PC4 BEMF3 ADC2_IN14 PB11 + ============== ============== =============== Current shunt resistance = 0.003 PGA gain = 16 diff --git a/Documentation/platforms/arm/stm32g4/boards/b-g474e-dpow1/index.rst b/Documentation/platforms/arm/stm32g4/boards/b-g474e-dpow1/index.rst new file mode 100644 index 0000000000..4a3a4b4c08 --- /dev/null +++ b/Documentation/platforms/arm/stm32g4/boards/b-g474e-dpow1/index.rst @@ -0,0 +1,127 @@ +================ +ST B-G474E-DPOW1 +================ + +This is the README file for a port of NuttX to the ST Micro B-G474E-DPOW1 +Discovery kit with STM32G474RE MCU. For more information about this board, +see: + + https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-mpu-eval-tools/stm32-mcu-mpu-eval-tools/stm32-discovery-kits/b-g474e-dpow1.html + +Status +====== + +This port boots NuttX through to a functional NSH prompt. + +Development Environment +======================= + +Toolchains +---------- + +An appropriate ARM toolchain is needed, such as the one built with the +customized NuttX buildroot or the ready-made GNU Tools for Arm Embedded +Processors. + +Debugging +--------- + +The board incorporates a STLINK-V3E programmer/debugger accessible via the +Micro-USB Type B connector. + +To debug with OpenOCD and arm-nuttx-eabi-gdb: + +* Use 'make menuconfig' to set CONFIG_DEBUG_SYMBOLS and CONFIG_DEBUG_NOOPT. + To see debug output, e.g., the "ABCDE" printed in __start(), also set + CONFIG_DEBUG_FEATURES. + +* Build NuttX. + +* Flash the code using:: + + $ openocd -f interface/stlink.cfg -f target/stm32g4x.cfg -c init \ + -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000" + +NOTE: The above command might fail unless either: udev rules have been +configured on the development system (preferred) or the command is run as +root with 'sudo' (not encouraged). See: + + - https://openocd.org/doc/html/Running.html + - https://forgge.github.io/theCore/guides/running-openocd-without-sudo.html + +* Start GDB with:: + + $ arm-nuttx-eabi-gdb -tui nuttx + +* In GDB:: + + (gdb) target remote localhost:3333 + (gdb) monitor reset halt + (gdb) load + +Hardware +======== + +MCU Clocking +------------ + +By default, the MCU on this board is clocked from the MCU's internal HSI +clock, and only this option is supported by software at this time. + +If software support is added for it, the MCU could be clocked from the +following other sources: a 24 MHz oscillator on X2, MCO from STLINK-V3E, or +external clock from connector CN9, pin 26. + +GPIOs +----- + +Buttons +------- + +The board has 5 user buttons in the form of a 4-direction "joystick" with a +selection button (pressing down on the "joystick"). + +LEDs +---- + +The board has 4 user LEDs. + +RGB Power LED +------------- + +The board has a super bright RGB power LED. + +Caution: For eye safety, ensure that the power LED is covered by the +diffuser that comes installed over it. + +Serial Consoles +=============== + +The MCU's USART3 is connected to the on-board STLINK-V3E and exposed to +the PC as a Virtual COM Port over the same Micro-USB Type B connection used +for programming/debugging. + +On Debian Linux, this shows up as /dev/ttyACM0. Other operating systems may +differ. + +FLASH Bootloader Support +======================== + +If implementing a FLASH bootloader, turn on Kconfig option CONFIG_STM32_DFU. +This option activates an alternate linker script, scripts/ld.script.dfu, +which causes NuttX to leave a gap at the start of FLASH, leaving that space +for the FLASH bootloader. See scripts/ld.script.dfu for details. It also +causes NuttX to relocate its vector table and possibly make other +adjustments. + +One possible bootloader is STmicro's OpenBootloader "middleware" supplied +with STM32CubeG4 version 1.3.0. On the host (PC), it should be possible to +use STmicro's STM32CubeProgrammer or the stm32loader.py script from +https://github.com/jsnyder/stm32loader. That script can be invoked with +parameters such as:: + + stm32loader.py -p /dev/ttyACM0 -a 0x08006000 -e -w -v -g 0x08006000 nuttx.bin + +where the given address (0x08006000 in this case) must match the starting +address in scripts/ld.script.dfu. + diff --git a/Documentation/platforms/arm/stm32g4/boards/nucleo-g431kb/index.rst b/Documentation/platforms/arm/stm32g4/boards/nucleo-g431kb/index.rst new file mode 100644 index 0000000000..29d4df9b45 --- /dev/null +++ b/Documentation/platforms/arm/stm32g4/boards/nucleo-g431kb/index.rst @@ -0,0 +1,5 @@ +================ +ST Nucleo-G431KB +================ + +The Nucleo-G431KB is a member of the Nucleo-32 board family. diff --git a/Documentation/platforms/arm/stm32g4/boards/nucleo-g431rb/index.rst b/Documentation/platforms/arm/stm32g4/boards/nucleo-g431rb/index.rst new file mode 100644 index 0000000000..7523ccb932 --- /dev/null +++ b/Documentation/platforms/arm/stm32g4/boards/nucleo-g431rb/index.rst @@ -0,0 +1,66 @@ +================ +ST Nucleo G431RB +================ + +The Nucleo-G431RB is a member of the Nucleo-64 board family. + +Configurations +============== + +ihm16m1_f32 and ihm16m1_b16: +---------------------------- + +These examples are dedicated for the X-NUCLEO-IHM16M1 expansion board +based on STSPIN830 driver for three-phase brushless DC motors. + +X-NUCLEO-IHM16M1 must be configured to work with FOC and 3-shunt +resistors. See ST documentation for details. + +Pin configuration for the X-NUCLEO-IHM16M1 (TIM1 configuration): + + ============== ================ ================= + Board Function Chip Function Chip Pin Number + ============== ================ ================= + Phase U high TIM1_CH1 PA8 + Phase U enable GPIO_PB13 PB13 + Phase V high TIM1_CH2 PA9 + Phase V enable GPIO_PB14 PB14 + Phase W high TIM1_CH3 PA10 + Phase W enable GPIO_PB15 PB15 + EN_FAULT GPIO_PB12 PB12 + Current U GPIO_ADC1_IN2 PA1 + Current V GPIO_ADC1_IN12 PB1 + Current W GPIO_ADC1_IN15 PB0 + Temperature ? PC4 + VBUS GPIO_ADC1_IN1 PA0 + BEMF1 NU + BEMF2 NU + BEMF3 (NU) + LED + +3V3 (CN7_16) + GND (CN7_20) + GPIO_BEMF (NU) + ENCO_A/HALL_H1 + ENCO_B/HALL_H2 + ENCO_Z/HALL_H3 + GPIO1 (NU) + GPIO2 (NU) + GPIO3 (NU) + CPOUT (NU) + BKIN1 (NU) + POT GPIO_ADC1_IN8 PC2 + CURR_REF (NU) + DAC (NU) + ============== ================ ================= + + Current shunt resistance = 0.33 + Current sense gain = -1.53 (inverted current) + Vbus sense gain = 9.31k/(9.31k+169k) = 0.0522124390107 + Vbus min = 7V + Vbus max = 45V + Iout max = 1.5A RMS + + IPHASE_RATIO = 1/(R_shunt*gain) = -1.98 + VBUS_RATIO = 1/VBUS_gain = 16 + + For now only 3-shunt resistors configuration is supported. diff --git a/Documentation/platforms/arm/stm32g4/boards/nucleo-g474re/index.rst b/Documentation/platforms/arm/stm32g4/boards/nucleo-g474re/index.rst new file mode 100644 index 0000000000..6ca12360e4 --- /dev/null +++ b/Documentation/platforms/arm/stm32g4/boards/nucleo-g474re/index.rst @@ -0,0 +1,100 @@ +================ +ST Nucleo G474RE +================ + +This is the page for a port of NuttX to the ST Micro Nucleo G474RE +board with STM32G474RE MCU. For more information about this board, see: + + https://www.st.com/en/evaluation-tools/nucleo-g474re.html + +Development Environment +======================= + +Toolchains +---------- + +An appropriate ARM toolchain is needed, such as the one built with the +customized NuttX buildroot or the ready-made GNU Tools for Arm Embedded +Processors. + +Debugging +--------- + +The board incorporates a STLINK-V3E programmer/debugger accessible via the +Micro-USB Type B connector. + +To debug with OpenOCD and arm-nuttx-eabi-gdb: + +* Use 'make menuconfig' to set CONFIG_DEBUG_SYMBOLS and CONFIG_DEBUG_NOOPT. + To see debug output, e.g., the "ABCDE" printed in __start(), also set + CONFIG_DEBUG_FEATURES. + +* Build NuttX. + +* Flash the code using:: + + $ openocd -f interface/stlink.cfg -f target/stm32g4x.cfg -c init \ + -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000" + +* Start GDB with:: + + $ arm-nuttx-eabi-gdb -tui nuttx + +* In GDB:: + + (gdb) target remote localhost:3333 + (gdb) monitor reset halt + (gdb) load + +Hardware +======== + +MCU Clocking +------------ + +By default, the MCU on this board is clocked from the MCU's internal HSI +clock, and only this option is supported by software at this time. + +If software support is added for it, the MCU could be clocked from the +following other sources: a 24 MHz oscillator on X2, MCO from STLINK-V3E, or +external clock from connector CN9, pin 26. + +GPIOs +----- + +Buttons +------- + +The board has 1 user button. + +LEDs +---- + +The board has 1 user LED. + +Serial Consoles +=============== + +The MCU's USART3 is exposed to the pin 1 and 2 of the "Morpho connector" CN7 +on the board. + +FLASH Bootloader Support +======================== + +If implementing a FLASH bootloader, turn on Kconfig option CONFIG_STM32_DFU. +This option activates an alternate linker script, scripts/ld.script.dfu, +which causes NuttX to leave a gap at the start of FLASH, leaving that space +for the FLASH bootloader. See scripts/ld.script.dfu for details. It also +causes NuttX to relocate its vector table and possibly make other +adjustments. + +One possible bootloader is STmicro's OpenBootloader "middleware" supplied +with STM32CubeG4 version 1.3.0. On the host (PC), it should be possible to +use STmicro's STM32CubeProgrammer or the stm32loader.py script from +https://github.com/jsnyder/stm32loader. That script can be invoked with +parameters such as:: + + stm32loader.py -p /dev/ttyACM0 -a 0x08006000 -e -w -v -g 0x08006000 nuttx.bin + +where the given address (0x08006000 in this case) must match the starting +address in scripts/ld.script.dfu. diff --git a/Documentation/platforms/arm/stm32g4/index.rst b/Documentation/platforms/arm/stm32g4/index.rst new file mode 100644 index 0000000000..05fd71a799 --- /dev/null +++ b/Documentation/platforms/arm/stm32g4/index.rst @@ -0,0 +1,22 @@ +========== +ST STM32G4 +========== + +Supported MCUs +============== + +TODO + +Peripheral Support +================== + +TODO + +Supported Boards +================ + +.. toctree:: + :glob: + :maxdepth: 1 + + boards/*/* diff --git a/boards/arm/stm32/b-g474e-dpow1/README.txt b/boards/arm/stm32/b-g474e-dpow1/README.txt deleted file mode 100644 index bfcafe1a6e..0000000000 --- a/boards/arm/stm32/b-g474e-dpow1/README.txt +++ /dev/null @@ -1,139 +0,0 @@ -README -====== - -This is the README file for a port of NuttX to the ST Micro B-G474E-DPOW1 -Discovery kit with STM32G474RE MCU. For more information about this board, -see: - - https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-mpu-eval-tools/stm32-mcu-mpu-eval-tools/stm32-discovery-kits/b-g474e-dpow1.html - -Contents -======== - - - Status - - Development Environment - - Toolchains - - Debugging - - Hardware - - MCU Clocking - - GPIOs - - Buttons - - LEDs - - RGB Power LED - - Serial Consoles - - FLASH Bootloader Support - - Configurations - -Status -====== - - This port boots NuttX through to a functional NSH prompt. - -Development Environment -======================= - - Toolchains - ---------- - An appropriate ARM toolchain is needed, such as the one built with the - customized NuttX buildroot or the ready-made GNU Tools for Arm Embedded - Processors. - - Debugging - --------- - The board incorporates a STLINK-V3E programmer/debugger accessible via the - Micro-USB Type B connector. - - To debug with OpenOCD and arm-nuttx-eabi-gdb: - - * Use 'make menuconfig' to set CONFIG_DEBUG_SYMBOLS and CONFIG_DEBUG_NOOPT. - To see debug output, e.g., the "ABCDE" printed in __start(), also set - CONFIG_DEBUG_FEATURES. - - * Build NuttX. - - * Flash the code using: - $ openocd -f interface/stlink.cfg -f target/stm32g4x.cfg -c init \ - -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000" - - NOTE: The above command might fail unless either: udev rules have been - configured on the development system (preferred) or the command is run as - root with 'sudo' (not encouraged). See: - - https://openocd.org/doc/html/Running.html - - https://forgge.github.io/theCore/guides/running-openocd-without-sudo.html - - * Start GDB with: - $ arm-nuttx-eabi-gdb -tui nuttx - - * In GDB: - (gdb) target remote localhost:3333 - (gdb) monitor reset halt - (gdb) load - -Hardware -======== - - MCU Clocking - ------------ - By default, the MCU on this board is clocked from the MCU's internal HSI - clock, and only this option is supported by software at this time. - - If software support is added for it, the MCU could be clocked from the - following other sources: a 24 MHz oscillator on X2, MCO from STLINK-V3E, or - external clock from connector CN9, pin 26. - - GPIOs - ----- - - Buttons - ------- - The board has 5 user buttons in the form of a 4-direction "joystick" with a - selection button (pressing down on the "joystick"). - - LEDs - ---- - The board has 4 user LEDs. - - RGB Power LED - ------------- - The board has a super bright RGB power LED. - - Caution: For eye safety, ensure that the power LED is covered by the - diffuser that comes installed over it. - -Serial Consoles -=============== - - The MCU's USART3 is connected to the on-board STLINK-V3E and exposed to - the PC as a Virtual COM Port over the same Micro-USB Type B connection used - for programming/debugging. - - On Debian Linux, this shows up as /dev/ttyACM0. Other operating systems may - differ. - -FLASH Bootloader Support -======================== - - If implementing a FLASH bootloader, turn on Kconfig option CONFIG_STM32_DFU. - This option activates an alternate linker script, scripts/ld.script.dfu, - which causes NuttX to leave a gap at the start of FLASH, leaving that space - for the FLASH bootloader. See scripts/ld.script.dfu for details. It also - causes NuttX to relocate its vector table and possibly make other - adjustments. - - One possible bootloader is STmicro's OpenBootloader "middleware" supplied - with STM32CubeG4 version 1.3.0. On the host (PC), it should be possible to - use STmicro's STM32CubeProgrammer or the stm32loader.py script from - https://github.com/jsnyder/stm32loader. That script can be invoked with - parameters such as: - - stm32loader.py -p /dev/ttyACM0 -a 0x08006000 -e -w -v -g 0x08006000 nuttx.bin - - where the given address (0x08006000 in this case) must match the starting - address in scripts/ld.script.dfu. - -Configurations -============== - - nsh - --- - diff --git a/boards/arm/stm32/nucleo-g431kb/README.txt b/boards/arm/stm32/nucleo-g431kb/README.txt deleted file mode 100644 index f8ede7ef9f..0000000000 --- a/boards/arm/stm32/nucleo-g431kb/README.txt +++ /dev/null @@ -1,13 +0,0 @@ -README -====== - -The Nucleo-G431KB is a member of the Nucleo-32 board family. The Nucleo-32 -is a standard board for use with several STM32 parts in the UFQFPN32 package. - -STATUS -====== - - 2021-06-11: The basic NSH configuration is now functional. - -Configurations -============== \ No newline at end of file diff --git a/boards/arm/stm32/nucleo-g431rb/README.txt b/boards/arm/stm32/nucleo-g431rb/README.txt deleted file mode 100644 index c6ec06edbd..0000000000 --- a/boards/arm/stm32/nucleo-g431rb/README.txt +++ /dev/null @@ -1,69 +0,0 @@ -README -====== - -The Nucleo-G431RB is a member of the Nucleo-64 board family. The Nucleo-64 -is a standard board for use with several STM32 parts in the LQFP64 package. - -STATUS -====== - - 2020-06-12: The basic NSH configuration is now functional. - -Configurations -============== - - ihm16m1_f32 and ihm16m1_b16: - ---------------------------- - - These examples are dedicated for the X-NUCLEO-IHM16M1 expansion board - based on STSPIN830 driver for three-phase brushless DC motors. - - X-NUCLEO-IHM16M1 must be configured to work with FOC and 3-shunt - resistors. See ST documentation for details. - - Pin configuration for the X-NUCLEO-IHM16M1 (TIM1 configuration): - - Board Function Chip Function Chip Pin Number - ------------- ---------------- ----------------- - Phase U high TIM1_CH1 PA8 - Phase U enable GPIO_PB13 PB13 - Phase V high TIM1_CH2 PA9 - Phase V enable GPIO_PB14 PB14 - Phase W high TIM1_CH3 PA10 - Phase W enable GPIO_PB15 PB15 - EN_FAULT GPIO_PB12 PB12 - Current U GPIO_ADC1_IN2 PA1 - Current V GPIO_ADC1_IN12 PB1 - Current W GPIO_ADC1_IN15 PB0 - Temperature ? PC4 - VBUS GPIO_ADC1_IN1 PA0 - BEMF1 (NU) - BEMF2 (NU) - BEMF3 (NU) - LED - +3V3 (CN7_16) - GND (CN7_20) - GPIO_BEMF (NU) - ENCO_A/HALL_H1 - ENCO_B/HALL_H2 - ENCO_Z/HALL_H3 - GPIO1 (NU) - GPIO2 (NU) - GPIO3 (NU) - CPOUT (NU) - BKIN1 (NU) - POT GPIO_ADC1_IN8 PC2 - CURR_REF (NU) - DAC (NU) - - Current shunt resistance = 0.33 - Current sense gain = -1.53 (inverted current) - Vbus sense gain = 9.31k/(9.31k+169k) = 0.0522124390107 - Vbus min = 7V - Vbus max = 45V - Iout max = 1.5A RMS - - IPHASE_RATIO = 1/(R_shunt*gain) = -1.98 - VBUS_RATIO = 1/VBUS_gain = 16 - - For now only 3-shunt resistors configuration is supported. diff --git a/boards/arm/stm32/nucleo-g474re/README.txt b/boards/arm/stm32/nucleo-g474re/README.txt deleted file mode 100644 index 0bba1a4d38..0000000000 --- a/boards/arm/stm32/nucleo-g474re/README.txt +++ /dev/null @@ -1,119 +0,0 @@ -README -====== - -This is the README file for a port of NuttX to the ST Micro Nucleo G474RE -board with STM32G474RE MCU. For more information about this board, see: - - https://www.st.com/en/evaluation-tools/nucleo-g474re.html - -Contents -======== - - - Status - - Development Environment - - Toolchains - - Debugging - - Hardware - - MCU Clocking - - GPIOs - - Buttons - - LEDs - - Serial Consoles - - FLASH Bootloader Support - - Configurations - -Status -====== - - This port boots NuttX through to a functional NSH prompt. - -Development Environment -======================= - - Toolchains - ---------- - An appropriate ARM toolchain is needed, such as the one built with the - customized NuttX buildroot or the ready-made GNU Tools for Arm Embedded - Processors. - - Debugging - --------- - The board incorporates a STLINK-V3E programmer/debugger accessible via the - Micro-USB Type B connector. - - To debug with OpenOCD and arm-nuttx-eabi-gdb: - - * Use 'make menuconfig' to set CONFIG_DEBUG_SYMBOLS and CONFIG_DEBUG_NOOPT. - To see debug output, e.g., the "ABCDE" printed in __start(), also set - CONFIG_DEBUG_FEATURES. - - * Build NuttX. - - * Flash the code using: - $ openocd -f interface/stlink.cfg -f target/stm32g4x.cfg -c init \ - -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000" - - * Start GDB with: - $ arm-nuttx-eabi-gdb -tui nuttx - - * In GDB: - (gdb) target remote localhost:3333 - (gdb) monitor reset halt - (gdb) load - -Hardware -======== - - MCU Clocking - ------------ - By default, the MCU on this board is clocked from the MCU's internal HSI - clock, and only this option is supported by software at this time. - - If software support is added for it, the MCU could be clocked from the - following other sources: a 24 MHz oscillator on X2, MCO from STLINK-V3E, or - external clock from connector CN9, pin 26. - - GPIOs - ----- - - Buttons - ------- - The board has 1 user button. - - LEDs - ---- - The board has 1 user LED. - -Serial Consoles -=============== - - The MCU's USART3 is exposed to the pin 1 and 2 of the "Morpho connector" CN7 - on the board. - -FLASH Bootloader Support -======================== - - If implementing a FLASH bootloader, turn on Kconfig option CONFIG_STM32_DFU. - This option activates an alternate linker script, scripts/ld.script.dfu, - which causes NuttX to leave a gap at the start of FLASH, leaving that space - for the FLASH bootloader. See scripts/ld.script.dfu for details. It also - causes NuttX to relocate its vector table and possibly make other - adjustments. - - One possible bootloader is STmicro's OpenBootloader "middleware" supplied - with STM32CubeG4 version 1.3.0. On the host (PC), it should be possible to - use STmicro's STM32CubeProgrammer or the stm32loader.py script from - https://github.com/jsnyder/stm32loader. That script can be invoked with - parameters such as: - - stm32loader.py -p /dev/ttyACM0 -a 0x08006000 -e -w -v -g 0x08006000 nuttx.bin - - where the given address (0x08006000 in this case) must match the starting - address in scripts/ld.script.dfu. - -Configurations -============== - - nsh - --- -