Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to remove VMDPE messages? (Read 2344 times)
John2006_ty
Junior Member
**
Offline


Posts: 22
Joined: Aug 7th, 2019
How to remove VMDPE messages?
Apr 19th, 2023 at 10:12am
Print Post  
Hi

By opening a legacy arduino project in vmicro, there are VMDPE messages on Serial Monitor like:
18:04:33.797 -> VMDPE_1:2:22539:0:247|22539_VMDPE

Those messages keep sending over even though I have removed all breakpoints and recompiled. 

What the messages mean and how to remove them?

john
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: How to remove VMDPE messages?
Reply #1 - Apr 19th, 2023 at 10:15am
Print Post  
These are the messages from the Serial Debugger to the IDE, which should not be shown.

If you change to the Release build configuration the Serial Debugger should be disabled, then recompile and upload the project and the messages should stop.
  
Back to top
IP Logged
 
John2006_ty
Junior Member
**
Offline


Posts: 22
Joined: Aug 7th, 2019
Re: How to remove VMDPE messages?
Reply #2 - Apr 20th, 2023 at 2:51am
Print Post  
Hi Simon

Thank you. I found an interesting behavior when I troubleshoot the "VMDPE issue."

Behavior of the application is different in Debug mode to Release mode.

Below please find a code snippet that I am using to read serial messages. Instead of using
Code (C++)
Select All
Serial.readStringUntil('\n') 

, a non-blocking method is applied to read each character one-by-one on every iteration of the function. 

There is an interesting observation by running this function in an infinite loop of 250ms under FreeRTOS. The system crashed whenever I entered "wind\n" to Serial|COM3 (COM3 == Silicon labs CP210x USB port). It was OK with "acc\n" though. Please take a look at a screencapture file What_happens_in_Vmicro.png.
There are annotations on them so you know what I mean. The funniest behavior is that, it crashed whenever I entered "wind\n"  Grin. That means, I could enter an arbitrary string like "somethingelse\n" the application just return "Command not correct, please try again." as expected.

The problem described above is solved when I change it to Release mode. 

The interesting behavior comes when I open Arduino IDE 2.0.4 and reprogram the same code to target. Everything is fine under Arduino IDE (All_OK_under_ArduinoIDE.png).



Any clue on this?

John

Code (C++)
Select All
/*
* @brief	Get value from Serial Monitor at a sampling rate of DAQTask loop.
*/
daq_data_t DAQSimDataGet(void) {

	daq_data_t result = { 0 };
	static char inBuf[256];		///static char is mandatory to keep inBuf intact when function exits
	static uint8_t index = 0;	///don't forget it is a nonblocking function!!!

	if (Serial.available()) {
		char c = Serial.read();
		if (c != '\n') {
			inBuf[index++] = c;
		}
		else {
			inBuf[index] = '\0';
			String str = String(inBuf);
			if (str == "acc") {
				Serial.println(F("It is acc"));
			}
			else if (str == "wind") {
				Serial.println(F("it is wind"));
			}
			else {
				Serial.println(F("Command not correct, please try again."));
			}
			index = 0;
		}
	}
	return result;
}
 





« Last Edit: Apr 20th, 2023 at 3:00am by John2006_ty »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: How to remove VMDPE messages?
Reply #3 - Apr 20th, 2023 at 8:51am
Print Post  
Thanks for the update and confirming that Release Mode works as expected.

The messages are from the Serial Debugger, which is normally disabled when building in Release Mode, and is not available in the Arduino IDE.  The Serial debugger will also affect how the board receives messages as it has to read the Serial Buffer to see what commands are being issued back from the IDE.  
Documentation:https://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging-Sharing-Ports.htm...

To safely use your own Serial print and read alongside the Serial Debugger it is best to use the Serial Debugger over one port, and your own code running over a separate Serial port, then they cannot interfere with each other.
Documentation:https://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging-With-Different-Po...

Your Serial Monitor has the CStr button enabled in your screenshots, which can be avoided by setting the Line Ending option at the bottom of the Serial Monitor.  Using the Line Ending setting would avoid the need to type the "\n" char in the monitor, and it will correctly be appended when sending the data to the board.


info: Line endings works same way as arduino ide. To see the line endings list box. you will either need to give the serial monitor more width or use the little drop down overflow button on the bottom tool bar.



« Last Edit: Apr 20th, 2023 at 11:57am by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint