You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "JorgeGzm (via GitHub)" <gi...@apache.org> on 2024/02/15 22:31:22 UTC
[PR] fix modbus master exemple [nuttx-apps]
JorgeGzm opened a new pull request, #2288:
URL: https://github.com/apache/nuttx-apps/pull/2288
## Summary
The modbus master exemplo stop to work before the PR [#6038](https://github.com/apache/nuttx/pull/6038l)
## Impact
Fix modbus master example.
## Testing
```
# config target to use the mosbus master example
$tools/configure.sh stm32f401rc-rs485:modbus_master
# run diagslave app to start a modbus slave
$ sudo diagslave -a 10 -b 38400 /dev/ttyUSB0
# on target execute the modbus master exemple
nsh> modbusmaster
Initializing modbus master...
Creating poll thread.
Sending 100 requests to slave 10
mbmaster_main: Exiting poll thread.
Modbus master statistics:
Requests count: 100
Responses count: 100
Errors count: 0
Deinitializing modbus master...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix modbus master exemple [nuttx-apps]
Posted by "JorgeGzm (via GitHub)" <gi...@apache.org>.
JorgeGzm commented on PR #2288:
URL: https://github.com/apache/nuttx-apps/pull/2288#issuecomment-1949426417
What was the make command that you used to show the error message ?
```
make -j -Wall ?
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix modbus master exemple [nuttx-apps]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #2288:
URL: https://github.com/apache/nuttx-apps/pull/2288#issuecomment-1947783043
@JorgeGzm more error need to be fixed:
https://github.com/apache/nuttx/actions/runs/7923388468/job/21633084117?pr=11698
BTW, please fix this warning:
```
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/modbusmaster/mbmaster_main.c:300:1: error: Missing blank line after comment
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix modbus master exemple [nuttx-apps]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #2288:
URL: https://github.com/apache/nuttx-apps/pull/2288#issuecomment-1949094331
@JorgeGzm you need fix more:
```
Error: mb_m.c:301:15: error: 4 enumeration values not handled in switch: 'EV_MASTER_PROCESS_SUCCESS', 'EV_MASTER_ERROR_RESPOND_TIMEOUT', 'EV_MASTER_ERROR_RECEIVE_DATA'... [-Werror,-Wswitch]
301 | switch (eEvent)
| ^~~~~~
1 error generated.
make[2]: *** [/github/workspace/sources/apps/Application.mk:200: mb_m.c.github.workspace.sources.apps.modbus.o] Error 1
Error: mbmaster_main.c:284:15: error: data argument not used by format string [-Werror,-Wformat-extra-args]
283 | fprintf(stderr, "mbmaster_main: ",
| ~~~~~~~~~~~~~~~~~
284 | "ERROR: mbmaster_initialize failed: %d\n", ret);
| ^
Error: mbmaster_main.c:296:15: error: data argument not used by format string [-Werror,-Wformat-extra-args]
295 | fprintf(stderr, "mbmaster_main: ",
| ~~~~~~~~~~~~~~~~~
296 | "ERROR: mbmaster_pollthread create failed: %d\n", ret);
| ^
2 errors generated.
make[2]: *** [/github/workspace/sources/apps/Application.mk:271: mbmaster_main.c.github.workspace.sources.apps.examples.modbusmaster.o] Error 1
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:51: /github/workspace/sources/apps/examples/modbusmaster_all] Error 2
Error: rtu/mbrtu_m.c:281:30: error: passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'int8_t *' (aka 'signed char *') converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
281 | xMBMasterPortSerialGetByte((uint8_t *) & ucByte);
| ^~~~~~~~~~~~~~~~~~~~
/github/workspace/sources/apps/include/modbus/mbport.h:149:42: note: passing argument to parameter 'pucByte' here
149 | bool xMBMasterPortSerialGetByte(int8_t * pucByte);
| ^
Error: rtu/mbrtu_m.c:352:11: error: enumeration value 'STATE_M_TX_XFWR' not handled in switch [-Werror,-Wswitch]
352 | switch (eSndState)
| ^~~~~~~~~
2 errors generated.
make[2]: *** [/github/workspace/sources/apps/Application.mk:200: mbrtu_m.c.github.workspace.sources.apps.modbus.o] Error 1
Error: nuttx/porttimer_m.c:117:30: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
117 | void xMBMasterPortTimersClose()
| ^
| void
Error: nuttx/porttimer_m.c:171:32: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
171 | void vMBMasterPortTimersDisable()
| ^
| void
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org