This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new c5dfb9f606 linum-stm32h753bi: Updating documentation for modbus_slave 
example.
c5dfb9f606 is described below

commit c5dfb9f606363c7c6103281ec0d65dad4663b119
Author: Jorge Guzman <[email protected]>
AuthorDate: Sat Dec 9 09:14:30 2023 -0300

    linum-stm32h753bi: Updating documentation for modbus_slave example.
    
    Signed-off-by: Jorge Guzman <[email protected]>
---
 .../arm/stm32h7/boards/linum-stm32h753bi/index.rst | 68 ++++++++++++---------
 .../configs/modbus_slave/defconfig                 | 69 ++++++++++++++++++++++
 .../arm/stm32h7/linum-stm32h753bi/include/board.h  | 30 ++++++++++
 3 files changed, 139 insertions(+), 28 deletions(-)

diff --git 
a/Documentation/platforms/arm/stm32h7/boards/linum-stm32h753bi/index.rst 
b/Documentation/platforms/arm/stm32h7/boards/linum-stm32h753bi/index.rst
index 9a2cf24024..c9ad293b7e 100644
--- a/Documentation/platforms/arm/stm32h7/boards/linum-stm32h753bi/index.rst
+++ b/Documentation/platforms/arm/stm32h7/boards/linum-stm32h753bi/index.rst
@@ -19,38 +19,35 @@ STM32H753BI microcontroller. The board has 2 expansion 
connectors used by the LC
 touchscreen and another for access to other peripherals of microcontroller.
 
 The board features:
-- 8 to 52V power supply
-- SWD Pins for use as STLink (Pin header) and TC2030-IDC 6-Pin Tag-Connect 
Plug-of-Nails™ Connector
-- Crystal for HS 25MHz
-- Crystal for RTC 32.768KHz
-- 1 UART serial for debug
-- 1 Led RGB
-- 1 Buzzer without internal oscillator
-- 1 Mono audio up to 3W
-- 1 Ethernet 10/100
-- 1 MicroSD connector supporting 1 or 4-bit bus
-- 1 USB 2.0 Host/Device
-- 1 EEPROM memory with 512K bits
-- 1 External SRAM memory with 8MB
-- 1 NOR memory with 16MB
-- 2 On-board RS232 Transceiver with RTS/CTS
-- 2 On-board RS485 Transceiver
-- 2 On-board CAN-FD Transceiver
+  - 8 to 52V power supply
+  - SWD Pins for use as STLink (Pin header) and TC2030-IDC 6-Pin Tag-Connect 
Plug-of-Nails™ Connector
+  - Crystal for HS 25MHz
+  - Crystal for RTC 32.768KHz
+  - 1 UART serial for debug
+  - 1 Led RGB
+  - 1 Buzzer without internal oscillator
+  - 1 Mono audio up to 3W
+  - 1 Ethernet 10/100
+  - 1 MicroSD connector supporting 1 or 4-bit bus
+  - 1 USB 2.0 Host/Device
+  - 1 EEPROM memory with 512K bits
+  - 1 External SRAM memory with 8MB
+  - 1 NOR memory with 16MB
+  - 2 On-board RS232 Transceiver with RTS/CTS
+  - 2 On-board RS485 Transceiver
+  - 2 On-board CAN-FD Transceiver
 
 Expansion connector 1 features:
-- 1 Display RBG 888 
-- 1 Capacitive Touchscreen sensor
+  - 1 Display RBG 888 
+  - 1 Capacitive Touchscreen sensor
 
 Expansion connector 2 features.
-- 1 SPI
-- 1 I2C
-- 1 One Wire
-- 2 DACs
-- 6 PWM Channels
-- 10 ADCs
-
-Board documentation:
-https://github.com/witte-technology/...
+  - 1 SPI
+  - 1 I2C
+  - 1 One Wire
+  - 2 DACs
+  - 6 PWM Channels
+  - 10 ADCs
 
 LEDs
 ====
@@ -381,3 +378,18 @@ nsh
 
 Configures the NuttShell (nsh) located at apps/examples/nsh. This
 configuration enables a serial console on UART1.
+
+modbus_slave
+------------
+
+Configures the ModBus RTU Slave located at apps/examples/modbus. This
+configuration enables a RS485 on USART6.
+
+After configuring the desired pins on menuconfig and wiring the RS485 
converter, you
+can enable the ModBus to respond to queries::
+
+    nsh> modbus -e
+
+In your pc you will be able to read the ModBus registers using an application 
like ``mbpoll``::
+
+    $ mbpoll -a 10 -b 38400 -t 3 -r 1000 -c 4 /dev/ttyUSB1 -R
diff --git 
a/boards/arm/stm32h7/linum-stm32h753bi/configs/modbus_slave/defconfig 
b/boards/arm/stm32h7/linum-stm32h753bi/configs/modbus_slave/defconfig
new file mode 100644
index 0000000000..6bc7e0fd3e
--- /dev/null
+++ b/boards/arm/stm32h7/linum-stm32h753bi/configs/modbus_slave/defconfig
@@ -0,0 +1,69 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed 
.config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that 
includes your
+# modifications.
+#
+# CONFIG_MB_ASCII_ENABLED is not set
+# CONFIG_MB_TCP_ENABLED is not set
+# CONFIG_NSH_DISABLE_IFCONFIG is not set
+# CONFIG_NSH_DISABLE_PS is not set
+# CONFIG_STANDARD_SERIAL is not set
+# CONFIG_STM32H7_USE_LEGACY_PINMAP is not set
+CONFIG_ARCH="arm"
+CONFIG_ARCH_BOARD="linum-stm32h753bi"
+CONFIG_ARCH_BOARD_LINUM_STM32H753BI=y
+CONFIG_ARCH_CHIP="stm32h7"
+CONFIG_ARCH_CHIP_STM32H753BI=y
+CONFIG_ARCH_CHIP_STM32H7=y
+CONFIG_ARCH_CHIP_STM32H7_CORTEXM7=y
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_ARMV7M_DCACHE=y
+CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y
+CONFIG_ARMV7M_DTCM=y
+CONFIG_ARMV7M_ICACHE=y
+CONFIG_BOARD_LOOPSPERMSEC=43103
+CONFIG_BUILTIN=y
+CONFIG_DEBUG_FEATURES=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_EXAMPLES_ALARM=y
+CONFIG_EXAMPLES_MODBUS=y
+CONFIG_EXAMPLES_MODBUS_PORT=2
+CONFIG_INIT_ENTRYPOINT="nsh_main"
+CONFIG_INTELHEX_BINARY=y
+CONFIG_LIBM=y
+CONFIG_MM_REGIONS=4
+CONFIG_MODBUS=y
+CONFIG_MODBUS_SLAVE=y
+CONFIG_NSH_ARCHINIT=y
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_FILEIOSIZE=512
+CONFIG_NSH_LINELEN=64
+CONFIG_NSH_READLINE=y
+CONFIG_PREALLOC_TIMERS=4
+CONFIG_RAM_SIZE=245760
+CONFIG_RAM_START=0x20010000
+CONFIG_RAW_BINARY=y
+CONFIG_RR_INTERVAL=200
+CONFIG_RTC_ALARM=y
+CONFIG_RTC_DATETIME=y
+CONFIG_RTC_DRIVER=y
+CONFIG_SCHED_WAITPID=y
+CONFIG_START_DAY=6
+CONFIG_START_MONTH=12
+CONFIG_START_YEAR=2011
+CONFIG_STM32H7_PWR=y
+CONFIG_STM32H7_RTC=y
+CONFIG_STM32H7_UART4=y
+CONFIG_STM32H7_USART1=y
+CONFIG_STM32H7_USART6=y
+CONFIG_SYSTEM_NSH=y
+CONFIG_TASK_NAME_SIZE=0
+CONFIG_UART4_BAUD=38400
+CONFIG_UART4_PARITY=2
+CONFIG_UART4_RS485=y
+CONFIG_USART1_SERIAL_CONSOLE=y
+CONFIG_USART6_BAUD=38400
+CONFIG_USART6_PARITY=2
+CONFIG_USART6_RS485=y
diff --git a/boards/arm/stm32h7/linum-stm32h753bi/include/board.h 
b/boards/arm/stm32h7/linum-stm32h753bi/include/board.h
index cf20b93511..fae9926bc5 100644
--- a/boards/arm/stm32h7/linum-stm32h753bi/include/board.h
+++ b/boards/arm/stm32h7/linum-stm32h753bi/include/board.h
@@ -349,6 +349,36 @@
 #define GPIO_USART1_RX   (GPIO_USART1_RX_1 | GPIO_SPEED_100MHz)  /* PB15 */
 #define GPIO_USART1_TX   (GPIO_USART1_TX_1 | GPIO_SPEED_100MHz)  /* PB14 */
 
+/* UART4 */
+
+#ifdef CONFIG_UART4_RS485
+  /* Lets use for RS485 */
+
+#  define GPIO_UART4_TX        (GPIO_UART4_TX_3 | GPIO_SPEED_100MHz) /* PB9 */
+#  define GPIO_UART4_RX        (GPIO_UART4_RX_3 | GPIO_SPEED_100MHz) /* PB8 */
+
+  /* RS485 DIR pin: PA15 */
+
+#  define GPIO_UART4_RS485_DIR (GPIO_OUTPUT | GPIO_PUSHPULL | 
GPIO_SPEED_100MHz |\
+                                GPIO_OUTPUT_CLEAR | GPIO_PORTA | GPIO_PIN15)
+
+#endif
+
+/* USART6 */
+
+#ifdef CONFIG_USART6_RS485
+  /* Lets use for RS485 */
+
+#  define GPIO_USART6_TX        (GPIO_USART6_TX_1 | GPIO_SPEED_100MHz) /* PC6 
*/
+#  define GPIO_USART6_RX        (GPIO_USART6_RX_1 | GPIO_SPEED_100MHz) /* PC7 
*/
+
+  /* RS485 DIR pin: PG12 */
+
+#  define GPIO_USART6_RS485_DIR (GPIO_OUTPUT | GPIO_PUSHPULL | 
GPIO_SPEED_100MHz |\
+                                 GPIO_OUTPUT_CLEAR | GPIO_PORTG | GPIO_PIN12)
+
+#endif
+
 /* I2C4 - Used by Touchscreen and Audio Codec */
 
 #define GPIO_I2C4_SCL    (GPIO_I2C4_SCL_1 | GPIO_SPEED_50MHz)  /* PD12 */

Reply via email to