2024-09-10 08:27 PM - last edited on 2024-09-18 08:03 AM by Amel NASRI
Hi
2024-09-10 08:48 PM
So the PB4 / PB5 is on the STM32F446RE or something else?
Which UART
What is wired to what, diagram the actual connectivity, perhaps the initialization code.
What does "The communication is not smooth" mean? You're sending NUL characters in the very limited code snippet you've chosen to share.
2024-09-10 09:11 PM
2024-09-10 09:51 PM
Do you think that's a problem with the sending end or the receiving end?
Have you put a scope or logic analyzer on it? And looked at the signals?
If you're resetting the STM32F446RE is it getting to main() ? Getting stuck in Error_Handler() ? What would prevent it from getting to the code that does the HAL_UART_Transmit() ?
2024-09-11 03:49 AM
@harry123 wrote:
- other board is a processor.
What, exactly, does that mean?
How are you certain that the UART reception on that board is working well?
Have you tried other receivers - eg, a terminal on a PC ?
You need to show your full schematics, and your code - see:
2024-09-11 11:38 AM
- The problem that Im facing is data is getting displayed on pressing reset button on nucleo several times.
What are you trying to do when you press the reset button? Send "Connect"?
- just i want to send a string from nucleo to other board to display, on clicking reset button on the nucleo 4 to 5 times once the string gets displayed.
This doesn't make sense? Once the string is displayed, you're clicking on the reset button on the nucleo 4-5 times?
I think you need to reword what you're actually trying to achieve. Show your code.
2024-09-12 10:55 AM
void MainWindow::loadPortSettings()
{
PortSettings uartSettings = {BAUD115200, DATA_8, PAR_NONE, STOP_1, FLOW_OFF, 10};
port = new QextSerialPort("ttySAC2", uartSettings, QextSerialPort::Polling);
uartTimer = new QTimer(this);
uartTimer->setInterval(40);
if(!port->isOpen())
{
port->open(QextSerialPort::ReadWrite);
}
if(port->isOpen() && port->queryMode()==QextSerialPort::Polling)
{
uartTimer->start();
}
else
{
uartTimer->stop();
}
connect(uartTimer,SIGNAL(timeout()),this,SLOT(onReadyRead()));
}
void MainWindow::onReadyRead()
{
if(port->isOpen()&& port->bytesAvailable())
{
manipulateUartData(QString::fromLatin1(port->readAll()));
}
}
void MainWindow::manipulateUartData(QString str)///////////For Protocols
{
// qDebug ()<<"comm"<<communicationEnabled;
qDebug ()<<"Command: "<<str;
if(str.contains("Connect"))
{
QString rplyINS;
if(!communicationEnabled)
{
rplyINS="1Adtr ON,InsSerialNo="+ strFieldValues[idxUnitCalibrationWindow][csInstrumentSerialNo] +"$";
informationBox("Connected");
communicationEnabled=true;
port->write(rplyINS.toLatin1 ());
}
else
{
rplyINS="Already Connected,InsSerialNo="+ strFieldValues[idxUnitCalibrationWindow][csInstrumentSerialNo]+ "$";
informationBox (rplyINS,"Warning");
if(communicationEnabled)
{
// port->write ("Err:Instrument Connected Already");
port->write (rplyINS.toLatin1 ());
}
}