Commit Graph

175 Commits

Author SHA1 Message Date
houwenxiang ae990b6ca3 feature: Add uart hal support.
* Original commit: espressif/esp-idf@f27ae9b0e2
2022-03-21 13:15:54 +01:00
aleks f2b8b3c238 freemodbus: fix supported targets ci issue
* Original commit: espressif/esp-idf@4f9742d90c
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 236d1dcfa4 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


* Original commit: espressif/esp-idf@cfdd5f0ef7
2022-03-21 13:15:06 +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
Michael (XIAO Xufeng) 3062909951 timer_group: use the LL
* Original commit: espressif/esp-idf@264ffbeb14
2022-03-21 13:15:02 +01:00
Anton Maklakov 682645419b tools: Mass fixing of empty prototypes (for -Wstrict-prototypes)
* Original commit: espressif/esp-idf@afbaf74007
2022-03-21 13:14:00 +01:00
Renz Christian Bagaporo f7c40d1b11 cmake: some formatting fixes
Do not include bootloader in flash target when secure boot is enabled.
Emit signing warning on all cases where signed apps are enabled (secure
boot and signed images)
Follow convention of capital letters for SECURE_BOOT_SIGNING_KEY
variable, since it is
relevant to other components, not just bootloader.
Pass signing key and verification key via config, not requiring
bootloader to know parent app dir.
Misc. variables name corrections


* Original commit: espressif/esp-idf@9b350f9ecc
2022-03-21 13:14:00 +01:00
Renz Christian Bagaporo b8781516c1 components: use new component registration api
* Original commit: espressif/esp-idf@9eccd7c082
2022-03-21 13:14:00 +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
suda-morris 365bddd919 build and link hello-world for esp32s2beta
* Original commit: espressif/esp-idf@84b2f9f14d
2022-03-21 13:13:26 +01:00
Konstantin Kondrashov 4b8c30f606 all: Using xxx_periph.h
Using xxx_periph.h in whole IDF instead of xxx_reg.h, xxx_struct.h, xxx_channel.h ... .

Cleaned up header files from unnecessary headers (releated to soc/... headers).


* Original commit: espressif/esp-idf@399d2d2605
2022-03-21 13:13:26 +01:00
Roland Dobai 786ade0c0d Rename Kconfig options (components/freemodbus)
* Original commit: espressif/esp-idf@976d2a4b7f
2022-03-21 13:13:26 +01:00
Renz Christian Bagaporo 3082ecdf6a components: update with build system changes
* Original commit: espressif/esp-idf@ffec9d4947
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
aleks d9fae5d0ad freemodbus: fix incorrectly set coils read event
incorrect set of the MB_EVENT_COILS_WR event is changed while read coils in mbcontroller.c file
added read/write handling for appropriate registers in freemodbus.c example file

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


* Original commit: espressif/esp-idf@eebbced5b6
2022-03-21 13:13:26 +01:00
aleks ce241e3ebd freemodbus: change critical sections to semaphore mutex
revert changes made in mbrtu.c, mbascii.c
change critical section type to semaphore mutex instead of spin lock

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


* Original commit: espressif/esp-idf@aaa1cb6eec
2022-03-21 13:13:26 +01:00
Konstantin Kondrashov a3fc6eb571 freemodbus: Fix remove critical_sections
Closes: https://github.com/espressif/esp-idf/issues/3009


* Original commit: espressif/esp-idf@1ef7d093e1
2022-03-21 13:13:26 +01:00
Roland Dobai 3e2a03d032 Correct Kconfigs according to the coding style
* Original commit: espressif/esp-idf@37126d3451
2022-03-21 13:13:26 +01:00
aleks 56838197f5 examples: change max register area size to maximum value
esp-idf/components/freemodbus/modbus_controller/modbus_controller.c: The MB_INST_MAX_SIZE is changed to max value=(65535*2);
Update support for coils read into freemodbus.c;

TW#28143
Closes https://github.com/espressif/esp-idf/issues/2884


* Original commit: espressif/esp-idf@e3a786f2cf
2022-03-21 13:13:26 +01:00
aleks 60286c82d3 examples: freemodbus port serial slave move uart mode settings into example
Update freemodbus component file esp-idf/components/freemodbus/port/portserial.c to remove UART mode settings;
Move UART mode settings into esp-idf/examples/protocols/modbus_slave/main/freemodbus.c
Move UART pin settings from Component config into example Kconfig.projbuild file
Move setup of UART port pins from freemodbus component into example file

TW#27721
Closes https://github.com/espressif/esp-idf/issues/2784#issuecomment-443600157


* Original commit: espressif/esp-idf@5379c941b8
2022-03-21 13:13:26 +01:00
Anton Maklakov 5f40771c1e modbus: Fix a typo in the docs
* Original commit: espressif/esp-idf@9dde91ce2b
2022-03-21 13:13:26 +01:00
Alex Lisitsyn a3ff5b55c9 examples: freemodbus port slave basic implementation
This example adds functionality to support basic communication in RS485 networks using Modbus protocol.
This example uses FreeModbus stack and regular UART driver API to communicate in RS485 half duplex mode.
Added initial support of modbus controller pure C api to access device parameters over Modbus transport.
Move freemodbus stack and port files into components folder
Move the modbus_controller interface into components idf folder
Source files updated after review.
Add modbus interface documentation docs/en/api-reference/protocols/modbus.rst
porttimer.c: fix bug with timer1 selected in the Kconfig
Add support of cmake system (added cmake files)

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


* Original commit: espressif/esp-idf@f0eb9985b9
2022-03-21 13:07:11 +01:00
Alex Lisitsyn eacef70af8 root commit 2021-11-11 09:15:06 +01:00