Pi: Debug Your Raspberry Pi Like a BOSS with Visual Studio

Pi: Debug Your Raspberry Pi Like a BOSS with Visual Studio

Dave shows you how to single-step C++ code live in the Visual Studio debugger as it runs remotely on a Pi running Raspbian Linux.

Don’t forget to check out my book on Autism and read the “Burgers with Bill Gates” sample chapter!
https://amzn.to/3EUe321

Discord: https://discord.gg/eMVWUvrkP6
----

IMPORTANT STEP THAT'S NOT SHOWN IN THE VIDEO: CONNECTION MANAGER in Visual Studio
- To connect to the Pi, you must set up the Connection to it in Connection Manager as follows:
- In the Debug-Options menu, under Cross Platform, open the Connection Manager. Add an SSH connection to your Pi using it’s hostname and your credentials, and it will verify that the connection works for you.
- Here’s some additional info on the connection manager if needed:
https://docs.microsoft.com/en-us/cpp/linux/connect-to-your-remote-linux-computer?view=msvc-160

ON THE PI:
sudo apt update
sudo apt upgrade
sudo apt-get install openssh-server g++ gdb gdbserver wiringpi install make ninja-build rsync zip
sudo groupadd gpio
sudo usermod -a -G gpio YOURUSERNAME
sudo grep gpio /etc/group
sudo chown root.gpio /dev/gpiomem
sudo chmod g+rw /dev/gpiomem

--- If you need a source copy of WiringPi:
Using WSL and your favorite Linux distribution:
git clone https://github.com/zhaolei/WiringOP.git -b h3
cd WiringOP
chmod +x ./build
sudo ./build

--- More helpful info
I found this page quite helpful and recommend it:
https://dogfeatherdesign.com/2017/01/17/debugging-cc-code-on-a-raspberry-pi-with-visual-studio/

pi c++ debugdebugc++

Post a Comment

0 Comments