Content
- Setting up an existing project for remote debugging
- Video instructions for setting up extension and remote device
- Third-party bash-scripts to install packages/libraries
- GPIO pin control
- Manage Device Tree overlays
- How the extension works
- About Armbian
- Launch configuration for remote debugging can be added to projects outside of creating the project itself from an extension template. To add Launch, you need to open the project and click on the Add Launch button:
- Select a device for remote debugging:
- Select a project template from which Launch and Tasks will be taken:
- Select a project:
- Created a Launch configuration to launch the application:
- Next, go to the Activity Bar
Run and Debug
, select the added Launch and run the application:
To simplify the configuration of the extension and the remote device, video clips (YouTube) were created:
- Step 1. Configuring SSH access;
- Step 2. Adding a device;
- Step 3. Installing packages;
- Step 4. Creating a .NET console application and remote debugging;
- Step 5. Using GPIO. Blink.
.NET SDK, .NET Runtimes, .NET Debugger (vsdbg), Libgpiod, Docker are downloaded from the official websites of package developers, with the exception of the Libgpiod library. The script for installing this library is downloaded from the GitHub resource - devdotnetorg/docker-libgpiod. Next, the downloaded script downloads the source code of the library from the official Libgpiod repository and compiles the library.
GPIO (general-purpose input/output) is a general purpose input/output interface. GPIOs are connected directly to the "processor" SoC (System-on-a-Chip - System on a chip). Most single board computers, in addition to the usual bidirectional Input / Output ports, have one or more interfaces: UART, SPI, I²C / TWI, PWM (PWM), but do not have ADC (ADC). GPIO - ports can usually be configured for input or output (Input / Output), the default state is usually INPUT. The following are connected to the GPIO ports: LEDs, buttons, relays, temperature and other sensors, various peripheral devices.
There are several ways to access GPIO programming:
- Via file device (sysfs) GPIO;
- Through direct access to the registers of the chip;
- Using ready-made libraries (libgpiod).
The extension provides for working with GPIO using the Libgpiod library. What is GPIO and how to manage pins using the Libgpiod library in publications:
- Working with GPIO on the example of Banana Pi BPI-M64. Part 1. sysfs LED interface and DS18B20;
- Working with GPIO in Linux. Part 6. Libgpiod Library;
- Controlling GPIO pins from C# .NET 5 on Linux on a Banana Pi M64 (ARM64) and Cubietruck (ARM32) single board computer;
- .NET IoT. Part 2. Blinking an LED using the Libgpiod library.
Device Tree overlays are used to enable/disable devices such as I2C, SPI, PWM, etc. Remote loading of *.DTS
files and enabling/disabling "layers" is available. More details in the publication Working with GPIO. Part 2. Device Tree overlays. Working with DTS is only supported in the Armbian distribution. To support other distributions, you need to implement the adapter using the interface IDtoAdapter.ts . An example implementation for Armbian is IoTDTOArmbianAdapter.ts.
The principle of operation of the extension and the internal mechanism are disclosed in publications:
- Remote debugging of a .NET 5.0 application in Visual Studio Code for ARM using Banana Pi BPI-M64 and Cubietruck (Armbian, Linux);
- Simple development of IoT applications in C# for Raspberry Pi and other single-board devices, on Linux.
Armbian is the most popular distribution for ARM and RISC-V single board computers. More information about Armbian can be found on the page Armbian - Linux distribution for development boards on ARM.