Skip to content

boards: Fix modbus configs after moving it to apps/industry#18744

Open
acassis wants to merge 1 commit intoapache:masterfrom
acassis:fix_modbus_loc
Open

boards: Fix modbus configs after moving it to apps/industry#18744
acassis wants to merge 1 commit intoapache:masterfrom
acassis:fix_modbus_loc

Conversation

@acassis
Copy link
Copy Markdown
Contributor

@acassis acassis commented Apr 15, 2026

Summary

The modbus was moved to inside apps/industry, so these defconfigs need to be updated

Impact

None, only organization

Testing

On NuttX board:

NuttShell (NSH) NuttX-12.13.0                                                     
nsh> uname -a                                                                     
NuttX 12.13.0 b5bb475d5f Apr 15 2026 10:46:51 arm stm32f401rc-rs485               
nsh> modbus -e

On Linux side:

$ mbpoll -a 10 -b 38400 -t 3 -r 1000 -c 4 /dev/ttyUSB1  -R
mbpoll 1.0-0 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright © 2015-2019 Pascal JEAN, https://github.com/epsilonrt/mbpoll
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type 'mbpoll -w' for details.

Protocol configuration: Modbus RTU
Slave configuration...: address = [10]
                        start reference = 1000, count = 4
Communication.........: /dev/ttyUSB1,      38400-8E1 
                        t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, input register table

-- Polling slave 10... Ctrl-C to stop)
[1000]: 	44816 (-20720)
[1001]: 	0
[1002]: 	0
[1003]: 	0
-- Polling slave 10... Ctrl-C to stop)
[1000]: 	38771 (-26765)
[1001]: 	0
[1002]: 	0
[1003]: 	0
-- Polling slave 10... Ctrl-C to stop)
[1000]: 	17140
[1001]: 	0
[1002]: 	0
[1003]: 	0
-- Polling slave 10... Ctrl-C to stop)
[1000]: 	49449 (-16087)
[1001]: 	0
[1002]: 	0
[1003]: 	0
-- Polling slave 10... Ctrl-C to stop)
[1000]: 	11597
[1001]: 	0
[1002]: 	0
[1003]: 	0
-- Polling slave 10... Ctrl-C to stop)
[1000]: 	42530 (-23006)
[1001]: 	0
[1002]: 	0
[1003]: 	0
^C--- /dev/ttyUSB1 poll statistics ---
6 frames transmitted, 6 received, 0 errors, 0.0% frame loss

everything was closed.
Have a nice day !

@acassis acassis marked this pull request as draft April 15, 2026 12:59
@github-actions github-actions bot added Size: S The size of the change in this PR is small Board: arm Board: xtensa labels Apr 15, 2026
@acassis acassis marked this pull request as ready for review April 15, 2026 13:59
@acassis
Copy link
Copy Markdown
Contributor Author

acassis commented Apr 15, 2026

It is funny, I was going to update the Documentation and discovery that is was already appointing to apps/industry/modbus: applications/examples/modbus/index.rst

No idea how it happened :-D

@acassis acassis requested review from anchao, cederom and linguini1 April 15, 2026 14:48
@acassis
Copy link
Copy Markdown
Contributor Author

acassis commented Apr 15, 2026

It is funny, I was going to update the Documentation and discovery that is was already appointing to apps/industry/modbus: applications/examples/modbus/index.rst

No idea how it happened :-D

It is funny, I was going to update the Documentation and discovery that is was already appointing to apps/industry/modbus: applications/examples/modbus/index.rst

No idea how it happened :-D

Actually it was @raiden00pl who predicted that it was going to happen! :-D

@raiden00pl
Copy link
Copy Markdown
Member

@acassis I've had this on my TODO list for a long time :)

image

@acassis
Copy link
Copy Markdown
Contributor Author

acassis commented Apr 15, 2026

Hmm, I made a mistake: I renamed the CONFIG_INDUSTRY_MODBUS directly inside defconfig,:
$ ./tools/refresh.sh --silent esp32-devkitc:modbus
[1/1] Normalize esp32-devkitc:modbus
37a38,39

CONFIG_INDUSTRY_MODBUS=y
CONFIG_INDUSTRY_MODBUS_SLAVE=y
43,44d44
< CONFIG_INDUSTRY_MODBUS=y
< CONFIG_INDUSTRY_MODBUS_SLAVE=y
Saving the new configuration file

The modbus was moved to inside apps/industry, so these defconfigs
need to be updated

Signed-off-by: Alan C. Assis <acassis@gmail.com>
@cederom
Copy link
Copy Markdown
Contributor

cederom commented Apr 15, 2026

Hmm, I am wondering if INDUSTRY really needs to be part of the CONFIG_ variable? Other parts are located in various locations and they do not necessarily contain all location prefixes. I would remove this INDUSTRY part from a config name.

Instead, if we plan to have different modbus implementations we could use something like CONFIG_FREEMODBUS and CONFIG_FREEMODBUS_MASTER? That would be short and self-explanatory pointing at the modbus stack implementation right?

For other implementations we would then use CONFIG_OPENMODBUS_* or something like that? :-)

@raiden00pl
Copy link
Copy Markdown
Member

The problem with the current Kconfig is that we don't have any standardization for option names. Some programs/libs use one format, others another. The main (and probably the only disadvantage of INDUSTRY_MODBUS) is that the options become long, the advantage is that we have context added to the option name (like INDUSTRY). Personally, I would be in favor of the name INDUSTRY_FREEMODBUS, but it's a bit long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Board: arm Board: xtensa Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants