|
| 1 | +menu "Modbus configuration" |
| 2 | + |
| 3 | + config FMB_COMM_MODE_TCP_EN |
| 4 | + bool "Enable Modbus stack support for TCP communication mode" |
| 5 | + default y |
| 6 | + help |
| 7 | + Enable Modbus TCP option for stack. |
| 8 | + |
| 9 | + config FMB_TCP_PORT_DEFAULT |
| 10 | + int "Modbus TCP port number" |
| 11 | + range 0 65535 |
| 12 | + default 502 |
| 13 | + depends on FMB_COMM_MODE_TCP_EN |
| 14 | + help |
| 15 | + Modbus default port number used by Modbus TCP stack |
| 16 | + |
| 17 | + config FMB_TCP_PORT_MAX_CONN |
| 18 | + int "Maximum allowed connections for TCP stack" |
| 19 | + range 1 6 |
| 20 | + default 5 |
| 21 | + depends on FMB_COMM_MODE_TCP_EN |
| 22 | + help |
| 23 | + Maximum allowed connections number for Modbus TCP stack. |
| 24 | + This is used by Modbus master and slave port layer to establish connections. |
| 25 | + This parameter may decrease performance of Modbus stack and can cause |
| 26 | + increasing of processing time (increase only if absolutely necessary). |
| 27 | + |
| 28 | + config FMB_TCP_CONNECTION_TOUT_SEC |
| 29 | + int "Modbus TCP connection timeout" |
| 30 | + range 1 3600 |
| 31 | + default 20 |
| 32 | + depends on FMB_COMM_MODE_TCP_EN |
| 33 | + help |
| 34 | + Modbus TCP connection timeout in seconds. |
| 35 | + Once expired the current connection with the client will be closed |
| 36 | + and Modbus slave will be waiting for new connection to accept. |
| 37 | + |
| 38 | + config FMB_MASTER_TIMEOUT_MS_RESPOND |
| 39 | + int "Slave respond timeout (Milliseconds)" |
| 40 | + default 150 |
| 41 | + range 50 3000 |
| 42 | + help |
| 43 | + If master sends a frame which is not broadcast, it has to wait sometime for slave response. |
| 44 | + if slave is not respond in this time, the master will process timeout error. |
| 45 | + |
| 46 | + config FMB_MASTER_DELAY_MS_CONVERT |
| 47 | + int "Slave conversion delay (Milliseconds)" |
| 48 | + default 200 |
| 49 | + range 50 400 |
| 50 | + help |
| 51 | + If master sends a broadcast frame, it has to wait conversion time to delay, |
| 52 | + then master can send next frame. |
| 53 | + |
| 54 | + config FMB_QUEUE_LENGTH |
| 55 | + int "Modbus serial task queue length" |
| 56 | + range 0 200 |
| 57 | + default 20 |
| 58 | + help |
| 59 | + Modbus serial driver queue length. It is used by event queue task. |
| 60 | + See the serial driver API for more information. |
| 61 | + |
| 62 | + config FMB_PORT_TASK_STACK_SIZE |
| 63 | + int "Modbus port task stack size" |
| 64 | + range 2048 8192 |
| 65 | + default 4096 |
| 66 | + help |
| 67 | + Modbus port task stack size for rx/tx event processing. |
| 68 | + It may be adjusted when debugging is enabled (for example). |
| 69 | + |
| 70 | + config FMB_SERIAL_BUF_SIZE |
| 71 | + int "Modbus serial task RX/TX buffer size" |
| 72 | + range 0 2048 |
| 73 | + default 256 |
| 74 | + help |
| 75 | + Modbus serial task RX and TX buffer size for UART driver initialization. |
| 76 | + This buffer is used for modbus frame transfer. The Modbus protocol maximum |
| 77 | + frame size is 256 bytes. Bigger size can be used for non standard implementations. |
| 78 | + |
| 79 | + config FMB_PORT_TASK_PRIO |
| 80 | + int "Modbus port task priority" |
| 81 | + range 3 10 |
| 82 | + default 10 |
| 83 | + help |
| 84 | + Modbus port data processing task priority. |
| 85 | + The priority of Modbus controller task is equal to (CONFIG_FMB_PORT_TASK_PRIO - 1). |
| 86 | + |
| 87 | + config FMB_CONTROLLER_SLAVE_ID_SUPPORT |
| 88 | + bool "Modbus controller slave ID support" |
| 89 | + default y |
| 90 | + help |
| 91 | + Modbus slave ID support enable. |
| 92 | + When enabled the Modbus <Report Slave ID> command is supported by stack. |
| 93 | + |
| 94 | + config FMB_CONTROLLER_SLAVE_ID |
| 95 | + hex "Modbus controller slave ID" |
| 96 | + range 0 4294967295 |
| 97 | + default 0x00112233 |
| 98 | + depends on FMB_CONTROLLER_SLAVE_ID_SUPPORT |
| 99 | + help |
| 100 | + Modbus slave ID value to identify modbus device |
| 101 | + in the network using <Report Slave ID> command. |
| 102 | + Most significant byte of ID is used as short device ID and |
| 103 | + other three bytes used as long ID. |
| 104 | + |
| 105 | + config FMB_CONTROLLER_NOTIFY_TIMEOUT |
| 106 | + int "Modbus controller notification timeout (ms)" |
| 107 | + range 0 200 |
| 108 | + default 20 |
| 109 | + help |
| 110 | + Modbus controller notification timeout in milliseconds. |
| 111 | + This timeout is used to send notification about accessed parameters. |
| 112 | + |
| 113 | + config FMB_CONTROLLER_NOTIFY_QUEUE_SIZE |
| 114 | + int "Modbus controller notification queue size" |
| 115 | + range 0 200 |
| 116 | + default 20 |
| 117 | + help |
| 118 | + Modbus controller notification queue size. |
| 119 | + The notification queue is used to get information about accessed parameters. |
| 120 | + |
| 121 | + config FMB_CONTROLLER_STACK_SIZE |
| 122 | + int "Modbus controller stack size" |
| 123 | + range 0 8192 |
| 124 | + default 4096 |
| 125 | + help |
| 126 | + Modbus controller task stack size. The Stack size may be adjusted when |
| 127 | + debug mode is used which requires more stack size (for example). |
| 128 | + |
| 129 | + config FMB_EVENT_QUEUE_TIMEOUT |
| 130 | + int "Modbus stack event queue timeout (ms)" |
| 131 | + range 0 500 |
| 132 | + default 20 |
| 133 | + help |
| 134 | + Modbus stack event queue timeout in milliseconds. This may help to optimize |
| 135 | + Modbus stack event processing time. |
| 136 | + |
| 137 | + config FMB_TIMER_GROUP |
| 138 | + int "Modbus Timer group number" |
| 139 | + range 0 1 |
| 140 | + default 0 |
| 141 | + help |
| 142 | + Modbus Timer group number that is used for timeout measurement. |
| 143 | + |
| 144 | + config FMB_TIMER_INDEX |
| 145 | + int "Modbus Timer index in the group" |
| 146 | + range 0 1 |
| 147 | + default 0 |
| 148 | + help |
| 149 | + Modbus Timer Index in the group that is used for timeout measurement. |
| 150 | + |
| 151 | + config FMB_TIMER_ISR_IN_IRAM |
| 152 | + bool "Place timer interrupt handler into IRAM" |
| 153 | + default n |
| 154 | + select UART_ISR_IN_IRAM |
| 155 | + help |
| 156 | + This option places Modbus timer IRQ handler into IRAM. |
| 157 | + This allows to avoid delays related to processing of non-IRAM-safe interrupts |
| 158 | + during a flash write operation (NVS updating a value, or some other |
| 159 | + flash API which has to perform an read/write operation and disable CPU cache). |
| 160 | + This option has dependency with the UART_ISR_IN_IRAM option which places UART interrupt |
| 161 | + handler into IRAM to prevent delays related to processing of UART events. |
| 162 | + |
| 163 | +endmenu |
0 commit comments