Skip to main content
Mitesh
Associate
August 2, 2018
Question

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

  • August 2, 2018
  • 1 reply
  • 702 views

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 ?

    This topic has been closed for replies.

    1 reply

    Pavel A.
    August 2, 2018

    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