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] 2 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) Ras Pi Picoprobe - Serial print commands not showing - SOLVED - USER ERROR (Read 8426 times)
Micro1
Junior Member
**
Offline


Posts: 32
Joined: May 31st, 2022
Ras Pi Picoprobe - Serial print commands not showing - SOLVED - USER ERROR
Jun 4th, 2022 at 9:40pm
Print Post  
Hi, glad to have this forum.
Simon worked with me to get the PicoProbe integrated and it has been working well. Some difficulties I am having are some of the libraries. I cannot figure out why they are not being found. I am unable to reach Simon by email at the moment so will do my best to post here and hopefully will get some answers. 

this is for Windows 10.

The RP2040 library has a lot of folders and some appear to be scanned and others are not. I have rescanned and set PATH and project folders to scan but still same problem. 

I have not been able to get the serial monitor to work and still cannot. I have errors in that it seems the serial monitor is not working in part because “strlen” in string.h is not declared it says. I also have other errors. See attached image.

All works otherwise in my basic tests now however still no serial monitor and am sure other errors will come up because these libraries are not found. I can add 20 library references I imagine, but some rp2040 work and some do not. “Api/itoa.h” works but “hardware/gpio.h” does not. They are at different levels in the library for localdata.

In print.h keeping serial monitor from getting input due to "strlen" not being defined yet string.h is right in the header.

My setup is Arduino 1.8, platform is the Earl RP2040 (PicoProbe), hardware Picoprobe with newest Vm version. I can upload and debug in my test sketch. 

Any help is appreciated.  Smiley

Micro1 out..


« Last Edit: Jun 14th, 2022 at 4:07pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #1 - Jun 4th, 2022 at 9:44pm
Print Post  
Hello, yes it is good to use the forum because we do not provide support by email.

Can you confirm that the build and upload works okay, that you are reporting intellisense errors?

Thanks
  
Back to top
WWW  
IP Logged
 
Micro1
Junior Member
**
Offline


Posts: 32
Joined: May 31st, 2022
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #2 - Jun 4th, 2022 at 10:11pm
Print Post  
Tim@Visual Micro wrote on Jun 4th, 2022 at 9:44pm:
Hello, yes it is good to use the forum because we do not provide support by email.

Can you confirm that the build and upload works okay, that you are reporting intellisense errors?

Thanks


Hello, yes it all compiles and builds ok. At least I dont see any outstanding errors. I have noticed it retains breakpoints even if I delete them but that is not a major issue at the moment. 

this is the error that likely is keeping serial monitor from working. "
Error (active)      E0020      identifier "strlen" is undefined      Stepper Control      res\rp2040\api\Print.h      52      
"
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #3 - Jun 4th, 2022 at 10:30pm
Print Post  
You have set the error list to "Intellisense Only". Please change it to "Build Only" and then you will find it less confusing.

If the build and upload worked then you do not have any issue with serial code.

The only breakpoint that will keep returning is the "demo debugger" breakpoint, that happens when "Training Mode" is enabled and also only happens when Debug is enabled.

When debug is enabled that uses the Serial but it is expected to be at 115200. If you own code uses a different speed then you can set that speed in the vMicro>Debugger>RemoteSpeed property otherwise you won't see any serial in the monitor.

I suggest you switch the configuration name on the tool bar from Debug to Release and then build upload again, does the Serial work okay then?

https://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging-Walkthrough-Start...
https://www.visualmicro.com/page/User-Guide.aspx
  
Back to top
WWW  
IP Logged
 
Micro1
Junior Member
**
Offline


Posts: 32
Joined: May 31st, 2022
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #4 - Jun 4th, 2022 at 11:53pm
Print Post  
Tim@Visual Micro wrote on Jun 4th, 2022 at 10:30pm:
You have set the error list to "Intellisense Only". Please change it to "Build Only" and then you will find it less confusing.

If the build and upload worked then you do not have any issue with serial code.

The only breakpoint that will keep returning is the "demo debugger" breakpoint, that happens when "Training Mode" is enabled and also only happens when Debug is enabled.

When debug is enabled that uses the Serial but it is expected to be at 115200. If you own code uses a different speed then you can set that speed in the vMicro>Debugger>RemoteSpeed property otherwise you won't see any serial in the monitor.

I suggest you switch the configuration name on the tool bar from Debug to Release and then build upload again, does the Serial work okay then?

https://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging-Walkthrough-Start...
https://www.visualmicro.com/page/User-Guide.aspx


Thank you,
I tried Build only before and the strlen looks the same as in the image above. it is not defined.

yes the baud rate is matching. that is engineering day 5 haha. 

With release it won't hit any breakpoints so that kinda defeats the purpose and serial is still not working. 

In Debug it hits breakpoints but will not execute the print command, from what I can see because it states strlen is not defined. 

being in my 40s and engineering for years I def tried these basics. I spent several years doing some work in visual Studio but am a bit rusty on all the settings now. However I think it should be working. Have tried all I can find.

why it is not scanning all the libraries? I think there are multiple issues happening. All those intellisense errors are pointing to libraries that cannot be found. 

Thanks for the help. Until i get this worked out I cant do much with this project but on Arduino IDE. its frustrating. 

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #5 - Jun 5th, 2022 at 12:18am
Print Post  
Breakpoints are always ignored when Debug is off.

When debug is On, you need to use Serial.println() when your own serial packet is finished.

If strlen was a problem then the project would not build and upload.

Please follow the guide in yellow near the top of this page so that we can see what you have configured.

  
Back to top
WWW  
IP Logged
 
Micro1
Junior Member
**
Offline


Posts: 32
Joined: May 31st, 2022
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #6 - Jun 5th, 2022 at 12:54am
Print Post  
Tim@Visual Micro wrote on Jun 5th, 2022 at 12:18am:
Breakpoints are always ignored when Debug is off.

When debug is On, you need to use Serial.println() when your own serial packet is finished.

If strlen was a problem then the project would not build and upload.

Please follow the guide in yellow near the top of this page so that we can see what you have configured.



Thank you,
yes I understand. However I cant step beyond the strlen issue as it somes up with an error about a module missing or not loaded. something along those lines. Of course it compiles but that command is not executing. I agree it should not compile but it does and has an error. 

Attached is the txt file.

Thanks for the help.
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #7 - Jun 5th, 2022 at 11:45am
Print Post  
Hi,

When you respond please do not add a quote for the previous message. This thread is always replying to the previous message and adding a re-quote makes the thread twice as long to read.

  • You have vMicro>Debugging hardware enabled
  • You have altered the optimization on the debug menu to "No project"
  • You have enabled the usb debug options that come with the picco board


You should only use the above when they are understood. Some will clash, some might not be allowed for your board.

Switch them all off so that we are working with a level playing field (simple). 

The optimzation setting is the most senstive and best at default to start with. (This setting depends on the board core and how it has been designed)

The picco board options that you have used also need careful understanding. Debug port, Usb stack etc. are all outside of the visual micro system, they are specific to the version of the picco core you are using. The github page for the core should explain more.

When you have a basic program with Serial working then you can consider enabling some options but not until then.

You also have not shown an image or log of where you see a module load error for the strlen, this sounds like it is probably caused by your change of optimization level.
« Last Edit: Jun 5th, 2022 at 12:18pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Micro1
Junior Member
**
Offline


Posts: 32
Joined: May 31st, 2022
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #8 - Jun 5th, 2022 at 5:44pm
Print Post  
HI thanks, ya i guess I see quoting a lot. my bad. not big deal.

ok I will get things back inline as this is where we need to be at this point. 
I did as you mentioned and attached some screenshots. the module not loaded comes up when using print or println. I suspect when this issue is resolved it may fix the other missing issues.

Interestingly, when setup runs, the println uses vsnprintf, and it appears it can't execute or locate that as well. However, it does not show red squiggly line below it. When I started VS2022, it gave me a pop up to search for the location of vsprintf when debugging. After that it just says module not loaded.   

While I can't find vsprintf on my C drive, I do show Windows SDK add on was installed back in 2020. Hopefully these hints help. 

thanks for the help.
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #9 - Jun 5th, 2022 at 6:09pm
Print Post  
You are not using the windows sdk for firmware. 

It is possible that vs intellisense can't find the function you are trying to use and falls back to the windows version as a suggestion. You can switch off that fallback feature but let's ignore it for now.

The compile uses the real picco gcc compiler, the intellisense is a rough guess by VS. We can improve how vs looks at things and are improving both the portenta and the pi intellisense for the next release.

The debugger reporting a frame or module not found is never a code issue, it is simply that the debugger can't find the source code or other information required to allow the deeper code to be debugged. Stepping over core code can help. 

Often the default optimization settings of a core can prevent certain functions and properties from being debugged. Some cores do not support different global optimization settings in which case you can sometimes fallback to using specific optimization on/off of certain chunks of code.

In some cases the core specifies precompiled .a to use in the compiler link process. The .a files sometimes are not accompanied by the actual source code, therefore some methods can not be debugged for that reason.

It is not clear from your picture which source file you have open with the serial commands. Can you please close up the menu and give another screen shot of the entire ide with solution explorer open and the same code being edited.

Thanks
  
Back to top
WWW  
IP Logged
 
Micro1
Junior Member
**
Offline


Posts: 32
Joined: May 31st, 2022
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #10 - Jun 5th, 2022 at 7:08pm
Print Post  
HI, thanks for the explanation. 

Attached is the IDE of the basic example file I am using, and the print.h where the strlen is. The other vsprintf issue is from the print command in the setup function. I simply was trying both of them to see if any difference. 

  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #11 - Jun 5th, 2022 at 7:50pm
Print Post  
If it builds then the code is valid. I think you should ignore the error you are focussing on.

To use the serial monitor you have to open it. I don't see it open. Click the button to the right of the COM port to open the monitor.

You should also change the Serial.print("text") in the setup to Serial.println("text") to prove that a full line of text is sent. 
« Last Edit: Jun 5th, 2022 at 7:51pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Micro1
Junior Member
**
Offline


Posts: 32
Joined: May 31st, 2022
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #12 - Jun 5th, 2022 at 8:23pm
Print Post  
Hi, yes it has been opened many times and nothing shows from the print or println commands. I changed the println to print just to see if that was the issue. I usually put the serial monitor on another screen, I have 4 of them. 

I cant ignore errors at least for the serial monitor because I still cannot get the serial monitor to work. I been trying to get something to work for debugging with the Pico and RP2040 library from Earl. If you don't have any solution I understand, maybe i can eventually find a way to get it working outside of Arduino IDE.

Thanks for the help.

Regards,
Micro1
« Last Edit: Jun 5th, 2022 at 8:24pm by Micro1 »  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #13 - Jun 5th, 2022 at 8:51pm
Print Post  
Okay thanks. I suggest you keep debugging off for now.

Try enabling the DTR on the Serial Monitor

ps: I didn;t see the \n in your serial.print. That's same as println(), so ignore me.
« Last Edit: Jun 5th, 2022 at 8:52pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Micro1
Junior Member
**
Offline


Posts: 32
Joined: May 31st, 2022
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #14 - Jun 5th, 2022 at 10:29pm
Print Post  
Thanks, let me know if you all come up with something new. I will try some hail mary's here.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #15 - Jun 6th, 2022 at 2:13pm
Print Post  
Did the DTR on the Serial Monitor work?
  
Back to top
WWW  
IP Logged
 
Micro1
Junior Member
**
Offline


Posts: 32
Joined: May 31st, 2022
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #16 - Jun 6th, 2022 at 2:54pm
Print Post  
Hi, no it did not. Tried off / on, different combos. I will get back to this later today or tomorrow and try to figure it out with some hail mary's. i tried a lot before I reached out for help.
« Last Edit: Jun 6th, 2022 at 2:54pm by Micro1 »  
Back to top
 
IP Logged
 
Micro1
Junior Member
**
Offline


Posts: 32
Joined: May 31st, 2022
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #17 - Jun 7th, 2022 at 4:16am
Print Post  
I found an option to use the disassembly when no source is available. Even though it shows strlen is undefined, with that option I can step through the assembly code.

Although I still do not get any serial monitor data that is one nice find. 

https://docs.microsoft.com/en-us/visualstudio/debugger/no-source-available?view=...

« Last Edit: Jun 7th, 2022 at 4:17am by Micro1 »  
Back to top
 
IP Logged
 
Micro1
Junior Member
**
Offline


Posts: 32
Joined: May 31st, 2022
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #18 - Jun 7th, 2022 at 5:26am
Print Post  
came across this. seems similar issue. 

"println also works for me in the Arduino IDE.

The code with println in it does seem to compile, even with the red underline. However, none output from any print commands, viz., print, println, printf, would produce output in the Serial Monitor." 

Although he seems to have fixed it but no idea how. I will try to change the com port tomorrow. 

This is from March. 

https://forum.pjrc.com/threads/69843-Serial-println-not-working?p=302888&viewful...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Some libraries not found in Visual Studio 2022 for Ras Pi Picoprobe
Reply #19 - Jun 7th, 2022 at 3:04pm
Print Post  
That post from 4 years ago relates to Teensy virtual serial ports. You are not using Teensy so can ignore.

Does your Pi serial work in the Arduino IDE?

It is also important to bear in mind that the setup() runs only one time and can often run before a serial monitor has a change to start. The DTR can be very imporant because that can force some boards to reset, thus the setup() runs when the monitor is open. 

For boards that don't use DTR a delay, such as delay(3000), can also be useful to allow the monitor time to open if setup() is going to run.

For boards that create the Serial ports dynamically it is oten required to add this code to the very top of setup()
Code (C++)
Select All
 while (!Serial)
  {}
 


Send us the verbose output so that we can ensure you do not have debug enabled. You need simple to start with, debug is more complex and should be avoid. Proving Serial to work is just the basics and is unrelated to strlen etc.
« Last Edit: Jun 7th, 2022 at 3:18pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send TopicPrint