Commit Graph
16 Commits
Author SHA1 Message Date
Alex Lisitsyn a0e61427d1 freemodbus: allow address gaps in master data dictionary (support of UID field in MBAP)
* Original commit: espressif/esp-idf@e9cdb3e0d3
2022-03-21 13:18:30 +01:00
Alex Lisitsyn 0ddd723239 Bugfix/modbus fix copyright headers
* Original commit: espressif/esp-idf@bdf0298009
2022-03-21 13:15:54 +01:00
aleks 9facdd9148 freemodbus: fix invalid error handling for duplicate param_key
* Original commit: espressif/esp-idf@60ac95a6b2
2022-03-21 13:15:54 +01:00
aleks ddd3e3394b freemodbus: add affinity option for modbus stack tasks
Closes https://github.com/espressif/esp-idf/issues/6700


* Original commit: espressif/esp-idf@dfcc434910
2022-03-21 13:15:54 +01:00
Alex Lisitsyn c0163bb01e freemodbus: fix uart_wait_tx_done() reenable tx_done interrupt
fixes the issue with uart_wait_tx_done() when the task is suspended and transmission is done right before reenable tx_done interrupt


* Original commit: espressif/esp-idf@c801b3a182
2022-03-21 13:15:54 +01:00
aleks bc2657c71c freemodbus: fix mb controller parity propagation issues
Closes https://github.com/espressif/esp-idf/issues/6377


* Original commit: espressif/esp-idf@b554d4d34d
2022-03-21 13:15:54 +01:00
Angus Gratton e0102243f5 Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)


* Original commit: espressif/esp-idf@66fb5a29bb
2022-03-21 13:15:54 +01:00
Alex Lisitsyn bf49bec977 examples: freemodbus add tcp support for common master/slave iface
Add TCP port files to provide Modbus TCP interface for communication
Add freemodbus add tcp support for common master/slave iface and tcp example based on socket API
The communication between master and slave checked for each example serial_master, serial_slave (use ModbusPoll TCP)
update tcp example according netif changes, fix ci issues
update TCP slave implementation
update example_test.py to to set IP through stdin
update API documentation
event bit instead of semahore to lock communication resource
update default options and master/slave port files

Closes https://github.com/espressif/esp-idf/issues/858
Closes IDF-452


* Original commit: espressif/esp-idf@d0b9829eef
2022-03-21 13:15:54 +01:00
aleks 3e45775f25 freemodbus: fix memcmp result truncated to 1 byte
Coverity ID: 291158


* Original commit: espressif/esp-idf@30e97e0920
2022-03-21 13:15:54 +01:00
Alex Lisitsyn 7cb1e34dd6 freemodbus: fix long buffer failure
check master read write functions with array of registers)
fix master serial processing code and modbus controller to work with register array
modbus_master: add reading and writing of test value array (58 registers) to check failure is gone
remove parameter temporary buffer from modbus controller to allow more than 24 byte writes
driver: fix issue with TOUT feature
driver: fix uart_rx_timeout issue
driver: fix issue with rxfifo_tout_int_raw not triggered when received fifo_len = 120 byte and all bytes read out of fifo as result of rxfifo_full_int_raw
driver: add function uart_internal_set_always_rx_timeout() to always handle tout interrupt
examples: call uart_internal_set_always_rx_timeout() to handle tout interrupt correctly
examples: update examples to use tout feature
driver: reflect changes of uart_set_always_rx_timeout() function, change uart.c
driver: change conditions to trigger workaround for tout feature in uart.c
driver: change uart_set_always_rx_timeout()
freemodbus: fix tabs, remove commented code
driver: remove uart_ll_is_rx_idle()


* Original commit: espressif/esp-idf@3abdd2207d
2022-03-21 13:15:54 +01:00
Alex Lisitsyn b56073a5cd freemodbus: fix merge issues
* Original commit: espressif/esp-idf@ba1ee4092a
2022-03-21 13:15:54 +01:00
Alex Lisitsyn 9f6f956db8 freemodbus: add modbus master ascii
add support of modbus master ascii
rename base dir name of master and slave example to be mb_slave, mb_master to avoid conflict with sdio/slave example test
add Kconfig option to enable ASCII and RTU mode separately
update ASCII options + remove cast for errors
added baudrate for examples into Kconfig
updated magic numbers for timer timeout
put ascii private definitions into one file


* Original commit: espressif/esp-idf@67f62a79c1
2022-03-21 13:15:54 +01:00
Alex Lisitsyn 64eb1b79e8 freemodbus: fix nvs access failure
place timer handler functions into IRAM
update timer port handlers
fix communication issues
fix offset issue in example
add kconfig option to place handlers into IRAM


* Original commit: espressif/esp-idf@1ab9e81729
2022-03-21 13:15:06 +01:00
Alex Lisitsyn 8529961413 freemodbus: fix a bug with destroy function of modbus controller and fix port destroy functions
adds timer interrupt handle and free it in vMBXXXPortTimerClose() in master and slave timer port
assign modbus controller interface pointer to NULL in destroy function after free


* Original commit: espressif/esp-idf@4bac558ab3
2022-03-21 13:15:06 +01:00
chenjianqiang 0e98d546ec feat(uart): update uart driver for esp32s2beta
* Original commit: espressif/esp-idf@4cc962353c
2022-03-21 13:13:26 +01:00
Alex Lisitsyn e039ae7acc freemodbus: Fix bug with incorrect coils read mask
Contains two different component folders per each implementation (serial_master and serial_slave) with concrete ports.
Added common public api for master and slave and common interface for master and slave implementation.
Add support of cmake system (added cmake files).
Added sdkconfig.defaults files for slave and master modbus examples.
Updated make file and KConfig for freemodbus component
Update according to review and fix doxygen warnings
Fix Doxyfile to pass documentation build
Update headers and change interface file names as per review comments
Merge  branch feature/freemodbus_move_rs485_mode_control
Update after review:
The stack modbus folder updated to support master and slave ports together and moved into freemodbus/modbus
Stack and port files updated to remove duplicated simbols
Make file, KConfig and CMakeLists.txt updated to compile master and slave stacks, common interface and concrete implementations of ports
Stack callback functions execute callbacks using interface pointer from concrete port implementation
User can instantiate any of concrete port using common API (only one concrete port at a time) and it does not require to select port by KConfig
Port pins and mode configuration moved into example files from port files to allow user select pins and port mode (customer request)
Changes tested using pymodbus, ModbusPoll and communication between two boards
Updated DoxyFile according to public include path
Fix maximum instance size for slave (merge from master of customer issue)
Fix critical section issue TW#28622 (change spin lock based critical section to semaphore)
Move serial port files into component port folder for master and slave accordingly
Fix example issue showed in the log when IO slave is not configured correctly
Fix conflicts while merging from origin/master
Fix errors handling in modbus controller interface + some final corrections according to review
Update maximum allowed number of slaves in the network segment
Fix bug with incorrect coils read mask

Closes https://github.com/espressif/esp-idf/issues/858


* Original commit: espressif/esp-idf@449d2a6367
2022-03-21 13:13:26 +01:00