cancel
Showing results for 
Search instead for 
Did you mean: 

I am using FREEMODBUS with stm32f3xx . My question is how it will recognize the serial port or USART ?

Mitesh
Associate II

its just have a predefined function

eMBErrorCode eMBInit (  eMBMode  eMode, UCHAR  ucSlaveAddress, UCHAR  ucPort, LONG  ulBaudRate, eMBParity  eParity

how it will take my USART3 to communicate as modbus ?

1 REPLY 1
Pavel A.
Evangelist III

Do you have an existing STM32 project or have your own generated with CubeMX or some IDE?

Basically you'll want to use the initialization code created by Cube, with baudrate and other parameters as you need. In the CubeMX options, select Low level library (LL) for the USART, not HAL.

Your eMBInit function body will be no-op, the initialization will be generated by Cube.

Then write send & receive functions and interrupt handler using the LL library.

-- pa