This is cmake c++ template app for raspberry pi cross compiling and remote debugging in visual studio code
- install cross compilers
- g++-arm-linux-gnueabihf
- gcc-arm-linux-gnueabihf
- g++-aarch64-linux-gnu
- gcc-aarch64-linux-gnu
- Install gdb
- gdb-multiarch
- Install ssh rsync sshpass
ubuntu/debian installation command:
sudo apt-get install g++-arm-linux-gnueabihf \
g++-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
gdb-multiarch \
rsync \
sshpass
- install gdb
- rename
settings.example.json
tosettings.json
, input required info. Make sure raspberry pi is accessible by ssh with entered credentials - install recommended vscode extensions "Beyond gdb", "Cmake tools"
- run cmake command:
cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/arm-linux-gnueabihf-g++ -Bbuild -G Ninja
note: the compiler can be switched in "Cmake tools" panel, no need to run cmake manually then
- add breakpoints and press "play" button!