Skip to content

ModbusRTUClient does not work on STM32F030C8 #94

Open
@rikka0w0

Description

@rikka0w0

Hardware: STM32F030C8T6 custom board, internal clock source, MAX485 chip (DE, RE connected together, DI and RO connected to PA8, half-duplex USART1)

I got "Connection timeout" for any operation. With the help of a hardware logic analyzer, I could see that the Arduino board successfully sent the request and the correct response from the device on the DI pin of MAX485 appeared on PA8. Further investigation shown that the library does not enable Rx after sending the request.

My proposed solution was to append _serial->enableHalfDuplexRx(); to void RS485Class::receive() in "RS485.cpp":

void RS485Class::receive()
{
  if (_rePin > -1) {
    digitalWrite(_rePin, LOW);
  }
  _serial->enableHalfDuplexRx();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions