Hi , I’m using NUCLEO F429Zi for testing purposes .
I want to take serial output from teraterm and perform tests.
I’m using this code
#include <iostream>
#include "LIB_TEST.h"
using namespace std;
int main()
{
while(1){
double a = 7.4;
int b = 99;
std::cout << "a + b = " <<
LIB_TEST::Arithmetic::Add(a, b) << std::endl;
std::cout << "a - b = " <<
LIB_TEST::Arithmetic::Subtract(a, b) << std::endl;
std::cout << "a * b = " <<
LIB_TEST::Arithmetic::Multiply(a, b) << std::endl;
std::cout << "a / b = " <<
LIB_TEST::Arithmetic::Divide(a, b) << std::endl;
}
return 0;
}
I’m using both Mbed Studio and Keil Studio online.
Same program and OS version.
Mbed Studio works fine with both built in terminal and teraterm but no good on Keil Studio.
Mbed Studio works a lot better than Keil Studio online, many ‘weird’ things with that at the moment, perhaps it will improve.
May be a pita for you, download and try Mbed Studio you get a build profile box where you can select ‘debug profile’ and get message from within your libraries.
(No OS2 unfortunately).
Also the build output that I can’t seem to find on Keil Studio.
Serial terminal apps - Termite, YAT, Puty - all same result
mbed_app.json from above
the code and output below (I do not know what is inside of LIB_TEST.h)
#include "mbed.h"
#include <iostream>
#define BLINKING_RATE 500ms
DigitalOut led(LED1);
int main()
{
std::cout << "Hello\n";
double a = 7.4;
int b = 1;
while (true) {
led = !led;
b = rand() % 20;
std::cout << "a + b = " <<a + b << std::endl;
std::cout << "a * b = " << a * b << std::endl;
std::cout << "a / b = " << a / b << std::endl;
ThisThread::sleep_for(BLINKING_RATE);
}
}
a + b = 20.4
a * b = 96.2
a / b = 0.569231
a + b = 15.4
a * b = 59.2
a / b = 0.925
a + b = 26.4
a * b = 140.6
a / b = 0.389474
a + b = 8.4
a * b = 7.4
a / b = 7.4
Hi Jan, STD::cout Can’t see variables
Everything was fine after that , There was a situation where I had to uninstall and reinstall the operating system.
But I didn’t change anything.
I just felt that there is something strange on the screen where I selected the serial port of the teraterm.
This is what it looks like when I connect it;
This is how it shows the port when the NUCLEO is not connected;
Seems like this is causing a problem with the port is it seeing something else when the port is idle?
We don’t need to take a library review, I observe the same thing in the code in the screenshot I took.
That was not what I mean. It was just about why I can not use 1:1 of your code.
After successful connection, when I try New connection again, the ST-Link COM port is not in the list until disconnecting the first session.
After connection and correcting of the baud rate, then the output looks like below (first line is before the baud rate change)
á§ë¦( ďG„×( á¦( ďG„×a + b = 8.4 ! ‡@(( L (
a * b = 7.4
a / b = 7.4
a + b = 15.4
Do you have installed also another program for VCP? I mean something else than just - STSW-LINK009
I installed drivers for plc on my computer after that I think it was a problem with the port. I’m thinking about how can avoid these problem without a remove the operating system.