Commit Graph

71 Commits

Author SHA1 Message Date
Alex Lisitsyn
e9cdb3e0d3 freemodbus: allow address gaps in master data dictionary (support of UID field in MBAP) 2022-01-21 05:18:00 +00:00
morris
705788a13f unit_tests: replace legacy timer group with gptimer 2022-01-07 14:59:09 +08:00
morris
869bed1bb5 soc: don't expose unstable soc header files in public api 2022-01-06 23:10:22 +08:00
aleks
b8c1d26f56 freemodbus: fix port contains lgpl licensed files
Initial version of freemodbus master port files have been added to ESP-IDF based on https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32.
The overall repository license, at the time of adding these files, has been BSD 3-clause. However at that time, several port files carried LGPL license headers. As the author of these files confirmed in https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32/issues/61#issuecomment-977828450, this wasn't intentional. ESP-IDF version of modbus master port has been rewritten to target FreeRTOS instead of RT-Thread, but the license headers remained from the original version. This commit corrects this, replacing the license of these files with BSD 3-clause.
2021-11-29 12:50:53 +01:00
Roland Dobai
766aa57084 Build & config: Remove leftover files from the unsupported "make" build system 2021-11-11 15:32:36 +01:00
Alex Lisitsyn
0586be45d2 modbus: update to support other targets 2021-11-08 16:28:55 +00:00
Ivan Grokhotkov
53015490e3 Merge branch 'bugfix/freemodbus_tcp_master_fix_long_frame_buffer_issue' into 'master'
freemodbus: fix tcp master long frame buffer issue

See merge request espressif/esp-idf!11687
2021-11-05 16:23:35 +00:00
Alex Lisitsyn
0d393558d3 freemodbus: fix tcp master long frame buffer issue 2021-11-05 16:23:35 +00:00
aleks
ee104f8de2 freemodbus: fix timer port to use esp_timer instead of group timer 2021-11-05 13:19:09 +00:00
Alex Lisitsyn
bdf0298009 Bugfix/modbus fix copyright headers 2021-10-23 01:23:03 +08:00
morris
e2275b1f63 gptimer: clean up hal and ll for driver-ng 2021-10-20 18:40:08 +08:00
Alex Lisitsyn
c965b48e77 freemodbus: fix TCP stack/examples reinitialization sequence 2021-09-17 19:13:48 +08:00
Alex Lisitsyn
5944433424 Merge branch 'bugfix/modbus_allow_master_slave_work_simultaneously' into 'master'
freemodbus: fix issues when modbus master and slave work simultaneously

fix slave destroy bug when master and slave init simultaneously
add additional timer group options for master (https://github.com/espressif/esp-idf/issues/4699)

Closes IDF-3012 and IDFGH-2619

See merge request espressif/esp-idf!12961
2021-08-13 14:46:17 +00:00
Alex Lisitsyn
9693ef4918 freemodbus: fix issues when modbus master and slave work simultaneously
fix slave destroy bug when master and slave init simultaneously
add additional timer group options for master
fix master and slave use the same timer group index (https://github.com/espressif/esp-idf/issues/4699)
2021-08-13 22:46:09 +08:00
Alex Lisitsyn
a20df743f1 Merge branch 'bugfix/modbus_fix_compiler_err_when_tcp_is_disabled' into 'master'
Bugfix/modbus fix compiler err when tcp is disabled

Closes IDFGH-5019 and IDFGH-5376

See merge request espressif/esp-idf!13010
2021-08-12 14:39:26 +00:00
Alex Lisitsyn
1aa7f27468 add compile time checks for MB_MASTER_TCP_ENABLED
Signed-off-by: AshUK <github.AshUK@outlook.com>
2021-08-12 22:39:21 +08:00
aleks
60ac95a6b2 freemodbus: fix invalid error handling for duplicate param_key 2021-08-09 14:32:22 +02:00
aleks
9457555173 freemodbus: potential loss of significant bits and auto merge issues 2021-07-29 13:33:42 +08:00
aleks
dfcc434910 freemodbus: add affinity option for modbus stack tasks
Closes https://github.com/espressif/esp-idf/issues/6700
2021-07-22 13:15:24 +08:00
Alex Lisitsyn
c801b3a182 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
2021-07-21 10:07:44 +08:00
aleks
59935e44c0 freemodbus: increase max priority of modbus tasks
allows to avoid issues with modbus processing when higher priority tasks are used in user application
2021-05-06 14:32:40 +08:00
aleks
868e123336 freemodbuss: fix event processing after merge 2021-03-15 09:45:49 +01:00
aleks
0d3f19beea freemodbus: fix mb zero based reg address in the iterator
Fixes https://github.com/espressif/esp-idf/issues/6571
2021-02-25 15:17:45 +01:00
yuanjm
da58235a0e components: Use CONFIG_LWIP_IPV6 to strip IPv6 function in components 2021-02-23 18:26:03 +08:00
aleks
b554d4d34d freemodbus: fix mb controller parity propagation issues
Closes https://github.com/espressif/esp-idf/issues/6377
2021-02-15 08:39:18 +01:00
David Cermak
898cac0061 modbus: Exit server task gracefully to correctly cleanup lwip internals
Current lwip implementation does not support deleting a task which is
actively waiting on `select()` or `poll()` API.
Therefore we have to make sure that `select()` exits to deallocate its internal
callback before deleting the task. This is achieved by a shutdown
semaphore which informs the client once the `select()` exitted.

fix slave
2021-02-10 13:12:54 +00:00
Marius Vikhammer
04df1f3a42 CI: enable example builds for C3
Enables building C3 examples in CI.

Fixes related warnings/errors and disables examples that cannot run.
2021-02-09 12:04:02 +08:00
Alex Lisitsyn
96b77a28b1 freemodbus: add support for list of area descriptors for each register area
add multi register area descriptors into concrete port (initial)
add create/destroy of area descriptors into concrete port
add  the list of descriptors in common slave interface structure and init/destroy in concrete slave port
move r/w callback functions into common slave
final update of common slave interface wrappers add override API option in concrete port
update slave examples to check new  feature
2021-01-28 12:29:32 +08:00
Marius Vikhammer
0301c66bf0 esp32c3: Disable components that are not yet supported 2020-12-31 09:27:38 +11:00
Angus Gratton
66fb5a29bb 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)
2020-11-11 07:36:35 +00:00
Marius Vikhammer
9b552ce004 docs: add warning for doxygen version
Running with a newer doxygen version than what's
used in CI may raise warnings locally that are not
present when built by CI
2020-09-03 13:48:40 +08:00
Alex Lisitsyn
d0b9829eef 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
2020-07-22 00:34:04 +08:00
aleks
30e97e0920 freemodbus: fix memcmp result truncated to 1 byte
Coverity ID: 291158
2020-06-18 12:33:02 +02:00
Alex Lisitsyn
b28b62b194 freemodbus: fix fragmented response frame causes next value fail
drop uart ll driver fix: soc: prevent speculative reads from FIFO at -O2 optimization
(new compiler fixes this issue)
2020-06-15 15:20:42 +08:00
aleks
3bbdfb75ad freemodbus: fix event processing failure after destroy
Closes https://github.com/espressif/esp-idf/issues/5275
2020-05-13 15:59:36 +02:00
Alex Lisitsyn
b1fe4c4cc6 freemodbus: add extern c block into common header for cpp 2020-04-17 17:56:50 +08:00
Alex Lisitsyn
3abdd2207d 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()
2020-03-30 22:05:48 +08:00
Angus Gratton
11fac8637a docs: Resolve doxygen & Sphinx warnings 2020-02-07 16:37:45 +11:00
Felipe Neves
429712c6eb freertos: moved all xtensa specific files into a separated folder 2020-01-27 16:05:30 -03:00
Alex Lisitsyn
ba1ee4092a freemodbus: fix merge issues 2019-12-10 14:30:25 +08:00
Alex Lisitsyn
44444208b7 freemodbus: update poll event processing
update modbus poll event loop processing to process multiple events
2019-12-10 14:27:09 +08:00
Angus Gratton
ecaf816c0b Merge branch 'bugfix/freemodbus_fix_clang_warnings' into 'master'
freemodbus: fix clang warnings of freemodbus stack

See merge request espressif/esp-idf!5193
2019-11-28 07:06:19 +08:00
houwenxiang
f27ae9b0e2 feature: Add uart hal support. 2019-11-26 20:01:50 +08:00
aleks
6e14b6265b freemodbus: fix merge issues 2019-11-26 11:25:12 +01:00
aleks
cf4c95532f freemodbus: fix clang warnings 2019-11-26 10:37:14 +01:00
Alex Lisitsyn
67f62a79c1 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
2019-11-26 13:16:25 +08:00
chenjianqiang
9f9da9ec96 feat(timer): refator timer group driver
1. add hal and low-level layer for timer group
2. add callback functions to handle interrupt
3. add timer deinit function
4. add timer spinlock take function
2019-11-21 14:14:19 +08:00
Alex Lisitsyn
cfdd5f0ef7 freemodbus: configure timer handler placement
place timer interrupt handler into flash by default;
add default settings for timer and UART interrupts to place them into IRAM into example defaults;
CONFIG_FMB_TIMER_PORT_ENABLED default = n, when enabled, the UART_ISR_IN_IRAM set to y
2019-11-12 22:16:55 +08:00
Alex Lisitsyn
1ab9e81729 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
2019-11-08 16:55:42 +08:00
Alex Lisitsyn
4bac558ab3 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
2019-10-31 23:23:24 +08:00