Closed dresco closed 9 months ago
Have been looking at the F7 driver, and as best as I can see, the instance member checked in the following code is always 0,1, or 2 - and not the number from the SERIALn_PORT / MODBUS_RTU_STREAM definition?
Correct. The SERIALn_PORT definition binds a physical port to an instance at the driver level. Outside of the serial driver code the port instance is used to connect to the port.
Thanks, so instead of this (for instance)
#define SERIAL1_PORT 32 // GPIOD: TX = 8, RX = 9
#define MODBUS_RTU_STREAM SERIAL1_PORT
The expected way would be like this?
#define SERIAL1_PORT 32 // GPIOD: TX = 8, RX = 9
#define MODBUS_RTU_STREAM 3
SERIAL1_PORT is for instance #1 so #define MODBUS_RTU_STREAM 1
is the correct definition.
#define SERIAL1_PORT 32
is for binding MCU UART peripheral 3 with the second (2) pin map to instance 1.
Ah yes sorry. Got it now, thanks!
Hi,
Am wondering whether there is an error with the current logic for claiming serial streams?
Have been looking at the F7 driver, and as best as I can see, the
instance
member checked in the following code is always 0,1, or 2 - and not the number from the SERIALn_PORT / MODBUS_RTU_STREAM definition?https://github.com/grblHAL/Plugins_spindle/blob/7056c25b302f0719dd3ac1c52e8bb0a1b4624463/modbus_rtu.c#L501-L505
I've been trying to verify this with the F7/H7 Nucleo reference map;
[MSG:Warning: Modbus failed to initialize!]
error, and then becomes unresponsive.