diff --git a/Documentation/applications/examples/nxmbserver/index.rst b/Documentation/applications/examples/nxmbserver/index.rst new file mode 100644 index 0000000000000..7df0cd5ef6455 --- /dev/null +++ b/Documentation/applications/examples/nxmbserver/index.rst @@ -0,0 +1,149 @@ +====================================== +``nxmbserver`` NxModbus Server Example +====================================== + +The ``nxmbserver`` example demonstrates how to create a Modbus server (slave) +using the NxModbus protocol stack. It supports RTU, ASCII, and TCP transports +with simulated register data. + +Register Map +============ + +The example server provides the following simulated registers: + +Coils (read/write, FC01/FC05/FC15): + +- Address range: 1-100 +- Initial state: All zeros +- Writable via FC05 (write single) and FC15 (write multiple) + +Discrete Inputs (read-only, FC02): + +- Address range: 1-100 +- Initial state: All zeros +- Read-only (cannot be modified by client) + +Input Registers (read-only, FC04): + +- Address range: 1-100 +- Initial values: ``register[i] = i * 10`` (register 1 = 10, register 2 = 20, + register 10 = 100) + +Holding Registers (read/write, FC03/FC06/FC16/FC23): + +- Address range: 1-100 +- Initial values: ``register[i] = i * 100`` (register 1 = 100, register 2 = 200, + register 10 = 1000) +- Writable via FC06 (write single), FC16 (write multiple), FC23 (read/write) + +Command-Line Options +==================== + +Transport Selection (required): + +- ``-t TYPE`` - Transport type: ``rtu``, ``ascii``, or ``tcp`` + +Serial Transport Options (RTU/ASCII): + +- ``-d DEVICE`` - Serial device path (e.g., ``/dev/ttyS1``) +- ``-b BAUD`` - Baud rate (default: 115200) +- ``-p PARITY`` - Parity: ``none``, ``even``, or ``odd`` (default: none) + +TCP Transport Options: + +- ``-a ADDR`` - Bind address (default: 0.0.0.0 - all interfaces) +- ``-P PORT`` - TCP port (default: 502) + +Modbus Options: + +- ``-u UNIT`` - Unit ID / slave address (default: 1) + +Usage Examples +============== + +RTU Server on Serial Port:: + + nsh> nxmbserver -t rtu -d /dev/ttyS1 -b 115200 + Starting Modbus RTU server on /dev/ttyS1 (baud=115200, unit=1) + Server running. Press Ctrl+C to stop. + Register map: + Coils: 1-100 (read/write) + Discrete: 1-100 (read-only) + Input regs: 1-100 (read-only, value=addr*10) + Holding regs: 1-100 (read/write, initial=addr*100) + +TCP Server on Default Port:: + + nsh> nxmbserver -t tcp -P 502 + Starting Modbus TCP server on port 502 (unit=1) + Server running. Press Ctrl+C to stop. + Register map: + Coils: 1-100 (read/write) + Discrete: 1-100 (read-only) + Input regs: 1-100 (read-only, value=addr*10) + Holding regs: 1-100 (read/write, initial=addr*100) + +ASCII Server with Even Parity:: + + nsh> nxmbserver -t ascii -d /dev/ttyS1 -b 9600 -p even -u 5 + Starting Modbus ASCII server on /dev/ttyS1 (baud=9600, unit=5) + Server running. Press Ctrl+C to stop. + ... + +Testing with nxmbclient +======================= + +The server can be tested using the ``nxmbclient`` tool: + +Read Input Registers (initial values):: + + nsh> nxmbclient -t tcp -h 127.0.0.1 read-input 1 5 + Read 5 input registers from address 1: + [1]: 10 + [2]: 20 + [3]: 30 + [4]: 40 + [5]: 50 + +Read Holding Registers (initial values):: + + nsh> nxmbclient -t tcp -h 127.0.0.1 read-holding 1 5 + Read 5 holding registers from address 1: + [1]: 100 + [2]: 200 + [3]: 300 + [4]: 400 + [5]: 500 + +Write and Read Back Holding Register:: + + nsh> nxmbclient -t tcp -h 127.0.0.1 write-holding 10 9999 + Wrote holding register at address 10: 9999 + + nsh> nxmbclient -t tcp -h 127.0.0.1 read-holding 10 1 + Read 1 holding register from address 10: + [10]: 9999 + +Configuration +============= + +Enable the example in your NuttX configuration:: + + CONFIG_EXAMPLES_NXMBSERVER=y + CONFIG_INDUSTRY_NXMODBUS=y + CONFIG_NXMODBUS_RTU=y # For RTU support + CONFIG_NXMODBUS_ASCII=y # For ASCII support + CONFIG_NXMODBUS_TCP=y # For TCP support + +Kconfig Options: + +- ``CONFIG_EXAMPLES_NXMBSERVER`` - Enable the nxmbserver example +- ``CONFIG_EXAMPLES_NXMBSERVER_PROGNAME`` - Program name (default: "nxmbserver") +- ``CONFIG_EXAMPLES_NXMBSERVER_PRIORITY`` - Task priority (default: 100) +- ``CONFIG_EXAMPLES_NXMBSERVER_STACKSIZE`` - Stack size (default: DEFAULT_TASK_STACKSIZE) + +See Also +======== + +- :doc:`/applications/industry/nxmodbus/index` - NxModbus protocol stack +- :doc:`/applications/system/nxmbclient/index` - NxModbus client tool diff --git a/Documentation/applications/industry/nxmodbus/index.rst b/Documentation/applications/industry/nxmodbus/index.rst new file mode 100644 index 0000000000000..b9c4c99ef254a --- /dev/null +++ b/Documentation/applications/industry/nxmodbus/index.rst @@ -0,0 +1,264 @@ +========================= +``nxmodbus`` NuttX Modbus +========================= + +NxModbus is a lightweight Modbus protocol stack implementation for NuttX RTOS. +It provides client and server functionality for RTU, ASCII, and TCP transports +with a clean, callback-based API. + +NxModbus follows the Modbus Organization's modern terminology (adopted September 2020): + +- **Client**: Device that initiates requests (formerly "Master") +- **Server**: Device that processes requests and returns responses (formerly "Slave") +- **Device**: Remote Modbus device (in exception codes) + +This aligns with current industry standards and matches other modern protocols +(HTTP, MQTT, OPC-UA). + +NxModbus uses **0-based addressing**. Addresses passed to application +callbacks match the Modbus wire protocol directly: address 0 on the wire is +address 0 in the callback. This is consistent with libmodbus, pymodbus, and +the Modbus Application Protocol specification. + +This differs from FreeModBus, which adds 1 to wire addresses before passing +them to callbacks (PLC register numbering convention). If migrating from +FreeModBus, remove any ``addr - 1`` adjustments in your callback functions. + +Features +======== + +- **Multiple Transports**: RTU (serial), ASCII (serial), TCP, and raw ADU +- **Client/Server Modes**: Full support for both roles +- **Callback Architecture**: No internal data storage, application controls all data +- **Conditional Termios**: Supports systems with and without termios +- **Thread-Safe**: Mutex-protected context operations +- **Multi-Instance**: Supports concurrent instances with independent configuration +- **Extensible**: Custom function code registration via ``nxmb_register_custom_fc()`` + +Supported Function Codes +======================== + +NxModbus implements the following Modbus function codes: + +Bit Access: + +- **FC01** (0x01): Read Coils +- **FC02** (0x02): Read Discrete Inputs +- **FC05** (0x05): Write Single Coil +- **FC15** (0x0F): Write Multiple Coils + +Register Access: + +- **FC03** (0x03): Read Holding Registers +- **FC04** (0x04): Read Input Registers +- **FC06** (0x06): Write Single Holding Register +- **FC16** (0x10): Write Multiple Holding Registers +- **FC23** (0x17): Read/Write Multiple Holding Registers + +Diagnostics and Identification: + +- **FC08** (0x08): Diagnostics (sub-function 0x0000 Return Query Data) +- **FC17** (0x11): Report Server ID + +Each server-side function code handler can be individually enabled or disabled +via Kconfig (all enabled by default). Disabled handlers respond with +Illegal Function exception. Client-side request functions are always available +when ``CONFIG_NXMODBUS_CLIENT`` is enabled. Custom function codes can be +registered via ``nxmb_register_custom_fc()`` when ``CONFIG_NXMODBUS_CUSTOM_FC`` +is enabled. + +Transport Modes +=============== + +- RTU (``CONFIG_NXMODBUS_RTU``): + Binary encoding over serial with CRC16 error checking. Uses T1.5 and T3.5 + character timing for frame delimiting. Supports configurable baud rate and + parity. + +- ASCII (``CONFIG_NXMODBUS_ASCII``): + Hex-encoded text over serial with LRC error checking. Frames are delimited + by ':' start and CR/LF end markers. Character timeout is configurable via + ``CONFIG_NXMODBUS_ASCII_TIMEOUT_SEC``. + +- TCP (``CONFIG_NXMODBUS_TCP``): + Modbus frames encapsulated in TCP/IP using the MBAP (Modbus Application + Protocol) header. Default port 502. Supports both server (listening) and + client (connecting) modes. Server mode supports multiple simultaneous + client connections (configurable via ``CONFIG_NXMODBUS_TCP_MAX_CLIENTS``, + default 1, up to 8). + Requires ``CONFIG_NET_TCP``. + +- Raw ADU (``CONFIG_NXMODBUS_RAW_ADU``): + Application-provided callbacks for transmitting and receiving raw Modbus + frames. Enables custom transport backends such as TLS, CAN, BLE, or MQTT. + +Architecture +============ + +NxModbus uses a three-layer architecture: + +1. **Core Layer** (``core/``): Protocol logic, function handlers, exception handling +2. **Transport Layer** (``transport/``): RTU, ASCII, TCP, and raw ADU implementations +3. **Public API** (``include/nxmodbus/``): Application interface + +The transport layer uses a function pointer-based abstraction (``nxmb_transport_ops_s``) +allowing runtime selection of transport mode. + +Configuration Options +===================== + +NxModbus configuration is integrated into the NuttX Kconfig system: + +Role Selection: + +- ``CONFIG_NXMODBUS_SERVER`` – Enable Modbus server support +- ``CONFIG_NXMODBUS_CLIENT`` – Enable Modbus master (client) support + +Transport Selection: + +- ``CONFIG_NXMODBUS_RTU`` – Enable Modbus RTU (serial) transport +- ``CONFIG_NXMODBUS_ASCII`` – Enable Modbus ASCII (serial) transport +- ``CONFIG_NXMODBUS_TCP`` – Enable Modbus TCP transport (requires ``CONFIG_NET_TCP``) +- ``CONFIG_NXMODBUS_RAW_ADU`` – Enable raw ADU transport (custom backends) + +Function Code Selection (server-side, all enabled by default): + +- ``CONFIG_NXMODBUS_FUNC_READ_COILS`` – FC01 Read Coils +- ``CONFIG_NXMODBUS_FUNC_READ_DISCRETE`` – FC02 Read Discrete Inputs +- ``CONFIG_NXMODBUS_FUNC_READ_HOLDING`` – FC03 Read Holding Registers +- ``CONFIG_NXMODBUS_FUNC_READ_INPUT`` – FC04 Read Input Registers +- ``CONFIG_NXMODBUS_FUNC_WRITE_COIL`` – FC05 Write Single Coil +- ``CONFIG_NXMODBUS_FUNC_WRITE_HOLDING`` – FC06 Write Single Holding Register +- ``CONFIG_NXMODBUS_FUNC_DIAGNOSTICS`` – FC08 Diagnostics +- ``CONFIG_NXMODBUS_FUNC_WRITE_COILS`` – FC15 Write Multiple Coils +- ``CONFIG_NXMODBUS_FUNC_WRITE_HOLDINGS`` – FC16 Write Multiple Holding Registers +- ``CONFIG_NXMODBUS_FUNC_REPORT_SERVER_ID`` – FC17 Report Server ID +- ``CONFIG_NXMODBUS_FUNC_READWRITE_HOLDINGS`` – FC23 Read/Write Multiple Holding Registers + +Instance and Buffer Configuration: + +- ``CONFIG_NXMODBUS_MAX_INSTANCES`` – Maximum concurrent Modbus instances (1-16, default: 1) +- ``CONFIG_NXMODBUS_BUFFER_SIZE`` – ADU buffer size in bytes (64-256, default: 256) + +FC17 Report Server ID: + +- ``CONFIG_NXMODBUS_REP_SERVER_ID_BUF`` – Buffer size for Report Server ID + response data (4-253, default: 32). Holds server ID, run indicator, and + optional additional data configured via ``nxmb_set_server_id()``. + +Timeouts: + +- ``CONFIG_NXMODBUS_CLIENT_TIMEOUT_MS`` – Default client response timeout + in milliseconds (100-60000, default: 1000). Can be overridden at runtime + via ``nxmb_set_timeout()``. +- ``CONFIG_NXMODBUS_TCP_MAX_CLIENTS`` – Maximum simultaneous TCP client + connections per server instance (1-8, default: 1). +- ``CONFIG_NXMODBUS_TCP_TIMEOUT_SEC`` – TCP idle connection timeout in + seconds (1-3600, default: 60). Connections with no activity beyond this + period are closed. +- ``CONFIG_NXMODBUS_RTU_IDLE_TIMEOUT_MS`` – RTU inter-frame idle timeout + in milliseconds (1-1000, default: 50). Fallback ``select()`` timeout when + waiting for a new frame. T3.5 character timing is still used for frame + delimiting during active reception. +- ``CONFIG_NXMODBUS_ASCII_TIMEOUT_SEC`` – Character timeout for ASCII mode + in seconds (1-60, default: 1) + +Serial Configuration (RTU/ASCII): + +- ``CONFIG_SERIAL_TERMIOS`` – Enable termios-based serial configuration + + If disabled, serial ports are used in raw mode without baud rate or parity + configuration. This is useful for systems without termios support or when + using pre-configured serial devices. + +Extensibility: + +- ``CONFIG_NXMODBUS_CUSTOM_FC`` – Enable custom function code handler registration + +Termios Support +=============== + +NxModbus conditionally uses termios for serial port configuration based on +``CONFIG_SERIAL_TERMIOS``: + +With termios (``CONFIG_SERIAL_TERMIOS=y``): + +- Full baud rate configuration (9600, 19200, 38400, 57600, 115200) +- Parity configuration (none, even, odd) +- Automatic raw mode setup (no echo, no canonical mode) +- Original settings saved and restored on cleanup + +Without termios (``CONFIG_SERIAL_TERMIOS=n``): + +- Serial device opened in raw mode +- No baud rate or parity configuration +- Device must be pre-configured or support raw I/O +- Useful for: + + - Systems without termios support + - Pre-configured serial backends + - Custom serial drivers + - Non-standard serial devices + +API Reference +============= + +Instance Management: + +- ``nxmb_create()`` – Create and initialize an NxModbus instance +- ``nxmb_destroy()`` – Destroy an instance and release resources +- ``nxmb_enable()`` – Enable transport and start processing +- ``nxmb_disable()`` – Stop processing and release transport + +Server Configuration: + +- ``nxmb_set_callbacks()`` – Register application callbacks for data model access +- ``nxmb_set_server_id()`` – Configure FC17 Report Server ID response data +- ``nxmb_poll()`` – Execute one server-side polling iteration + +Client Functions (require ``CONFIG_NXMODBUS_CLIENT``): + +- ``nxmb_read_coils()`` – Read coils (FC01) +- ``nxmb_read_discrete()`` – Read discrete inputs (FC02) +- ``nxmb_read_holding()`` – Read holding registers (FC03) +- ``nxmb_read_input()`` – Read input registers (FC04) +- ``nxmb_write_coil()`` – Write single coil (FC05) +- ``nxmb_write_holding()`` – Write single holding register (FC06) +- ``nxmb_write_coils()`` – Write multiple coils (FC15) +- ``nxmb_write_holdings()`` – Write multiple holding registers (FC16) +- ``nxmb_readwrite_holdings()`` – Read/write multiple holding registers (FC23) +- ``nxmb_set_timeout()`` – Set client-side response timeout + +Extensibility (require ``CONFIG_NXMODBUS_CUSTOM_FC``): + +- ``nxmb_register_custom_fc()`` – Register a custom function code handler + +Exception Codes +=============== + +NxModbus implements standard Modbus exception codes: + +- ``NXMB_EX_NONE`` (0x00): No exception +- ``NXMB_EX_ILLEGAL_FUNCTION`` (0x01): Function code not supported +- ``NXMB_EX_ILLEGAL_DATA_ADDRESS`` (0x02): Register address out of range +- ``NXMB_EX_ILLEGAL_DATA_VALUE`` (0x03): Invalid data value +- ``NXMB_EX_DEVICE_FAILURE`` (0x04): Device failure +- ``NXMB_EX_ACKNOWLEDGE`` (0x05): Request acknowledged (long operation) +- ``NXMB_EX_DEVICE_BUSY`` (0x06): Device busy +- ``NXMB_EX_MEMORY_PARITY_ERROR`` (0x08): Memory parity error +- ``NXMB_EX_GATEWAY_PATH_FAILED`` (0x0A): Gateway path unavailable +- ``NXMB_EX_GATEWAY_TGT_FAILED`` (0x0B): Gateway target failed to respond + +Comparison with FreeModBus +========================== + +NxModbus is an alternative to FreeModBus with several improvements: + +- Modern client/server terminology +- Cleaner API with opaque handles +- Multi-instance support +- Conditional termios support +- Thread-safe by design +- No global state +- Raw ADU transport for custom backends (TLS, CAN, BLE, MQTT) +- Extensible function code table via ``nxmb_register_custom_fc()`` diff --git a/Documentation/applications/system/nxmbclient/index.rst b/Documentation/applications/system/nxmbclient/index.rst new file mode 100644 index 0000000000000..12500583a806a --- /dev/null +++ b/Documentation/applications/system/nxmbclient/index.rst @@ -0,0 +1,106 @@ +=================================== +``nxmbclient`` NxModbus Client Tool +=================================== + +The ``nxmbclient`` command-line tool provides a convenient way to perform Modbus +client (master) operations from the NuttX shell. It supports RTU, ASCII, and TCP +transports with full command-line configuration. + +Supported Commands +================== + +Read Operations: + +- ``read-coils ADDR COUNT`` - Read coil status (FC01) +- ``read-discrete ADDR COUNT`` - Read discrete input status (FC02) +- ``read-input ADDR COUNT`` - Read input registers (FC04) +- ``read-holding ADDR COUNT`` - Read holding registers (FC03) + +Write Operations: + +- ``write-coil ADDR VALUE`` - Write single coil (FC05) +- ``write-holding ADDR VALUE`` - Write single holding register (FC06) +- ``write-coils ADDR VALUE...`` - Write multiple coils (FC15) +- ``write-holdings ADDR VALUE...`` - Write multiple holding registers (FC16) + +Command-Line Options +==================== + +Transport Selection (required): + +- ``-t TYPE`` - Transport type: ``rtu``, ``ascii``, or ``tcp`` + +Serial Transport Options (RTU/ASCII): + +- ``-d DEVICE`` - Serial device path (e.g., ``/dev/ttyS1``) +- ``-b BAUD`` - Baud rate (default: 115200) +- ``-p PARITY`` - Parity: ``none``, ``even``, or ``odd`` (default: none) + +TCP Transport Options: + +- ``-h HOST`` - TCP host address (e.g., ``192.168.1.100``) +- ``-P PORT`` - TCP port (default: 502) + +Modbus Options: + +- ``-u UNIT`` - Unit ID / slave address (default: 1) +- ``-T TIMEOUT`` - Timeout in milliseconds (default: 1000) +- ``--poll MS`` - Polling interval in milliseconds (0 = one-shot mode) + +Usage Examples +============== + +RTU Client - Read Holding Registers:: + + nsh> nxmbclient -t rtu -d /dev/ttyS1 -b 115200 read-holding 0 10 + Read 10 holding registers from address 0: + [0]: 0x0000 + [1]: 0x0064 + [2]: 0x00C8 + ... + +TCP Client - Write Single Register:: + + nsh> nxmbclient -t tcp -h 192.168.1.100 -P 502 write-holding 0 1234 + Wrote holding register at address 0: 1234 + +RTU Client - Continuous Polling:: + + nsh> nxmbclient -t rtu -d /dev/ttyS1 --poll 1000 read-holding 0 5 + Read 5 holding registers from address 0: + [0]: 0x0000 + [1]: 0x0064 + [2]: 0x00C8 + [3]: 0x012C + [4]: 0x0190 + + (repeats every 1000ms until Ctrl+C) + +ASCII Client - Write Multiple Coils:: + + nsh> nxmbclient -t ascii -d /dev/ttyS1 -b 9600 -p even write-coils 0 1 0 1 1 + Wrote 5 coils starting at address 0 + +Configuration +============= + +Enable the tool in your NuttX configuration:: + + CONFIG_SYSTEM_NXMBCLIENT=y + CONFIG_INDUSTRY_NXMODBUS=y + CONFIG_NXMODBUS_RTU=y # For RTU support + CONFIG_NXMODBUS_ASCII=y # For ASCII support + CONFIG_NXMODBUS_TCP=y # For TCP support + +Kconfig Options: + +- ``CONFIG_SYSTEM_NXMBCLIENT`` - Enable the nxmbclient tool +- ``CONFIG_INDUSTRY_NXMBCLIENT_PROGNAME`` - Program name (default: "nxmbclient") +- ``CONFIG_NXMBCLIENT_PRIORITY`` - Task priority (default: 100) +- ``CONFIG_NXMBCLIENT_STACKSIZE`` - Stack size (default: DEFAULT_TASK_STACKSIZE) + +See Also +======== + +- :doc:`/applications/industry/nxmodbus/index` - NxModbus protocol stack +- :doc:`/applications/examples/nxmbserver/index` - NxModbus server example diff --git a/Documentation/guides/simulator.rst b/Documentation/guides/simulator.rst index 16cd66724a985..86220f0ec692f 100644 --- a/Documentation/guides/simulator.rst +++ b/Documentation/guides/simulator.rst @@ -224,6 +224,65 @@ Testing / capturing TCP network traffic #. Observe TCP network traffic in Wireshark / tcpdump on Linux. +Testing NxModbus RTU on simulator +================================= + +#. Create a virtual UART pair on Linux: + + .. code-block:: console + + $ socat PTY,link=/tmp/ttyNXB0 PTY,link=/tmp/ttyNXB1 & + $ stty -F /tmp/ttyNXB0 raw + $ stty -F /tmp/ttyNXB1 raw + +#. Build NuttX with the NxModbus RTU simulator configuration: + + .. code-block:: console + + $ ./tools/configure.sh sim:nxmbrtu + $ make + +#. Start the server instance (slave): + + .. code-block:: console + + $ ./nuttx + nsh> nxmbserver -t rtu -d /tmp/ttyNXB0 -b 9600 -p none -u 1 + Starting Modbus RTU server on /tmp/ttyNXB0 (baud=9600, unit=1) + Server running. Press Ctrl+C to stop. + Register map: + Coils: 1-100 (read/write) + Discrete: 1-100 (read-only) + Input regs: 1-100 (read-only, value=addr*10) + Holding regs: 1-100 (read/write, initial=addr*100) + +#. In another terminal, start a second simulator instance and run the client + command (master) against the server: + + .. code-block:: console + + $ ./nuttx + nsh> nxmbclient -t rtu -d /tmp/ttyNXB1 -b 9600 -p none -u 1 read-holding 0 10 + 0 0 + 1 100 + 2 200 + 3 300 + 4 400 + 5 500 + 6 600 + 7 700 + 8 800 + 9 900 + +#. Optional write/read-back check: + + .. code-block:: console + + nsh> nxmbclient -t rtu -d /tmp/ttyNXB1 -b 9600 -p none -u 1 write-holding 0 123 + OK + nsh> nxmbclient -t rtu -d /tmp/ttyNXB1 -b 9600 -p none -u 1 read-holding 0 1 + 0 123 + Stopping ======== diff --git a/boards/arm/stm32f0l0g0/nucleo-c071rb/configs/jumbo/defconfig b/boards/arm/stm32f0l0g0/nucleo-c071rb/configs/jumbo/defconfig index e30d953d4a8bc..a77cf6860c8d5 100644 --- a/boards/arm/stm32f0l0g0/nucleo-c071rb/configs/jumbo/defconfig +++ b/boards/arm/stm32f0l0g0/nucleo-c071rb/configs/jumbo/defconfig @@ -39,8 +39,10 @@ CONFIG_EXAMPLES_ADC_GROUPSIZE=2 CONFIG_EXAMPLES_ADC_SWTRIG=y CONFIG_EXAMPLES_BUTTONS=y CONFIG_EXAMPLES_HELLO=y +CONFIG_EXAMPLES_NXMBSERVER=y CONFIG_EXAMPLES_QENCODER=y CONFIG_EXAMPLES_WATCHDOG=y +CONFIG_INDUSTRY_NXMODBUS=y CONFIG_INIT_ENTRYPOINT="nsh_main" CONFIG_INIT_STACKSIZE=1536 CONFIG_INPUT=y @@ -54,6 +56,7 @@ CONFIG_NSH_BUILTIN_APPS=y CONFIG_NSH_FILEIOSIZE=64 CONFIG_NSH_READLINE=y CONFIG_NUNGET_CHARS=0 +CONFIG_NXMODBUS_CLIENT=y CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=1536 CONFIG_PTHREAD_MUTEX_UNSAFE=y CONFIG_PTHREAD_STACK_DEFAULT=1536 @@ -64,6 +67,7 @@ CONFIG_RR_INTERVAL=200 CONFIG_SCHED_WAITPID=y CONFIG_SENSORS=y CONFIG_SENSORS_QENCODER=y +CONFIG_SERIAL_TERMIOS=y CONFIG_START_DAY=19 CONFIG_START_MONTH=5 CONFIG_START_YEAR=2013 @@ -74,8 +78,11 @@ CONFIG_STM32F0L0G0_DMA1=y CONFIG_STM32F0L0G0_IWDG=y CONFIG_STM32F0L0G0_TIM3=y CONFIG_STM32F0L0G0_TIM3_QE=y +CONFIG_STM32F0L0G0_USART1=y CONFIG_STM32F0L0G0_USART2=y CONFIG_STM32F0L0G0_WWDG=y CONFIG_SYSTEM_NSH=y +CONFIG_SYSTEM_NXMBCLIENT=y CONFIG_TASK_NAME_SIZE=0 +CONFIG_USART1_RS485=y CONFIG_USART2_SERIAL_CONSOLE=y diff --git a/boards/sim/sim/sim/configs/nxmbrtu/defconfig b/boards/sim/sim/sim/configs/nxmbrtu/defconfig new file mode 100644 index 0000000000000..429f3d9f1503c --- /dev/null +++ b/boards/sim/sim/sim/configs/nxmbrtu/defconfig @@ -0,0 +1,59 @@ +# +# 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_NSH_CMDOPT_HEXDUMP is not set +CONFIG_ARCH="sim" +CONFIG_ARCH_BOARD="sim" +CONFIG_ARCH_BOARD_SIM=y +CONFIG_ARCH_CHIP="sim" +CONFIG_ARCH_SIM=y +CONFIG_BOARDCTL_APP_SYMTAB=y +CONFIG_BOARDCTL_POWEROFF=y +CONFIG_BOARD_LOOPSPERMSEC=0 +CONFIG_BOOT_RUNFROMEXTSRAM=y +CONFIG_BUILTIN=y +CONFIG_DEBUG_ASSERTIONS=y +CONFIG_DEBUG_FEATURES=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_DEV_LOOP=y +CONFIG_EXAMPLES_NXMBSERVER=y +CONFIG_FS_BINFS=y +CONFIG_FS_PROCFS=y +CONFIG_HAVE_CXXINITIALIZE=y +CONFIG_IDLETHREAD_STACKSIZE=4096 +CONFIG_INDUSTRY_NXMODBUS=y +CONFIG_INIT_ENTRYPOINT="nsh_main" +CONFIG_LIBC_ENVPATH=y +CONFIG_LIBC_EXECFUNCS=y +CONFIG_LIBC_MAX_EXITFUNS=1 +CONFIG_NSH_ARCHINIT=y +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_FILE_APPS=y +CONFIG_NSH_MAXARGUMENTS=32 +CONFIG_NSH_READLINE=y +CONFIG_NXMODBUS_ASCII=y +CONFIG_NXMODBUS_CLIENT=y +CONFIG_PATH_INITIAL="/bin" +CONFIG_PIPES=y +CONFIG_PSEUDOFS_ATTRIBUTES=y +CONFIG_PSEUDOFS_FILE=y +CONFIG_PSEUDOFS_SOFTLINKS=y +CONFIG_READLINE_CMD_HISTORY=y +CONFIG_READLINE_TABCOMPLETION=y +CONFIG_SCHED_BACKTRACE=y +CONFIG_SCHED_HAVE_PARENT=y +CONFIG_SCHED_WAITPID=y +CONFIG_SERIAL_TERMIOS=y +CONFIG_SIM_UART0_NAME="/tmp/ttyNXB0" +CONFIG_SIM_UART1_NAME="/tmp/ttyNXB1" +CONFIG_SIM_UART_BUFFER_SIZE=1024 +CONFIG_SIM_UART_NUMBER=2 +CONFIG_SIM_WALLTIME_SIGNAL=y +CONFIG_START_MONTH=6 +CONFIG_START_YEAR=2008 +CONFIG_SYSTEM_NSH=y +CONFIG_SYSTEM_NXMBCLIENT=y diff --git a/boards/x86_64/qemu/qemu-intel64/configs/jumbo/defconfig b/boards/x86_64/qemu/qemu-intel64/configs/jumbo/defconfig index ecc1ddf2f33dc..132bc9e7073c3 100644 --- a/boards/x86_64/qemu/qemu-intel64/configs/jumbo/defconfig +++ b/boards/x86_64/qemu/qemu-intel64/configs/jumbo/defconfig @@ -65,6 +65,7 @@ CONFIG_FS_PROCFS_REGISTER=y CONFIG_HIDKBD_STACKSIZE=10240 CONFIG_HIDMOUSE_STACKSIZE=10240 CONFIG_IDLETHREAD_STACKSIZE=4194304 +CONFIG_INDUSTRY_NXMODBUS=y CONFIG_INIT_ENTRYPOINT="nsh_main" CONFIG_INTEL64_ONESHOT=y CONFIG_IOB_ALIGNMENT=64 @@ -104,6 +105,11 @@ CONFIG_NET_UDP=y CONFIG_NSH_ARCHINIT=y CONFIG_NSH_BUILTIN_APPS=y CONFIG_NSH_READLINE=y +CONFIG_NXMODBUS_ASCII=y +CONFIG_NXMODBUS_CLIENT=y +CONFIG_NXMODBUS_MAX_INSTANCES=2 +CONFIG_NXMODBUS_RAW_ADU=y +CONFIG_NXMODBUS_TCP=y CONFIG_PCI=y CONFIG_PCI_MSIX=y CONFIG_PCI_QEMU_EDU=y @@ -113,6 +119,7 @@ CONFIG_PRIORITY_INHERITANCE=y CONFIG_PTHREAD_MUTEX_TYPES=y CONFIG_PTHREAD_STACK_MIN=4194304 CONFIG_RAM_SIZE=268435456 +CONFIG_READLINE_CMD_HISTORY=y CONFIG_SCHED_CHILD_STATUS=y CONFIG_SCHED_HAVE_PARENT=y CONFIG_SCHED_HPWORK=y @@ -128,6 +135,7 @@ CONFIG_START_YEAR=2011 CONFIG_SYSTEM_CLE=y CONFIG_SYSTEM_DHCPC_RENEW=y CONFIG_SYSTEM_NSH=y +CONFIG_SYSTEM_NXMBCLIENT=y CONFIG_SYSTEM_PING=y CONFIG_SYSTEM_TCPDUMP=y CONFIG_SYSTEM_TIME64=y