Developing a Bare-Metal Environment for RISC-V

Modern applications rely on complex execution environments—ranging from standard libraries to operating systems—to manage resources and hardware interactions. To build a kernel from scratch, one must strip away these abstractions and interface directly with the CPU and memory. This process involves navigating the target platform's architecture, ...

Posted on Mon, 06 Jul 2026 16:13:44 +0000 by learningsql

Efficient Embedded Programming Techniques

Calculating Sturcture Member Size #include <stdio.h> // Get size of struct member #define MEMBER_SIZE(type, member) sizeof(((type*)0)->member) // Get offset of struct member #define MEMBER_OFFSET(type, member) ((size_t)(&(((type*)0)->member))) typedef struct { char x; char y; char z; } coord_t; typedef struct { ...

Posted on Thu, 02 Jul 2026 16:07:32 +0000 by Syranide

Multi-Channel ADC Data Acquisition Using DMA on STM32

Configure the ADC to sample across 5 channels and enable DMA in circular mode. Buffer Definition and Initialization #define CHANNEL_COUNT 5 #define SAMPLES_PER_CHANNEL 100 static uint16_t raw_adc_buffer[CHAMPLES_PER_CHANNEL * CHANNEL_COUNT]; /** * @brief Initialize ADC calibration and start DMA transfer */ void ADC_Startup(void) { ...

Posted on Tue, 23 Jun 2026 17:54:34 +0000 by Magestic

Rockchip RK3308 GPIO Controller Implementation

1, Overview 1.1, General Description The General Purpose Input/Output (GPIO) peripheral represents a programmable I/O interface that operates as an APB slave device. It controls external I/O signal outputs and their direction configuration. Additionally, it enables reading external signals through memory-mapped registers. Key features include: ...

Posted on Sun, 14 Jun 2026 16:22:03 +0000 by Charles256

Creating a Custom Project for RP2040-SMP

1. Project Setup After running the FreeRTOS-SMP-Demos, you have a basic understanding of how SMP operates. Now, create your own project and compile it. Follow the enstructions in "Creating Your Own Pico Project" to set up the pico_smp project. Create pico_smp.c and input: #include <stdio.h> #include "pico/stdlib.h" ...

Posted on Sat, 23 May 2026 22:31:14 +0000 by mrwutang

U-Boot Command Reference for Embedded Linux Flashing and Boot Configuration

Entering the U-Boot prompt When the board powers on, U-Boot waits for a short time for default boot sequence. The exact key sequence depends on the vendor: Press Enter on some boards. Type tpl on others. Any key may also work. A typical countdown message appears: Enter magic string to stop autoboot in 1 seconds Successful entry drops you int ...

Posted on Sat, 23 May 2026 20:48:00 +0000 by zoreli

Linux GPIO Subsystem: Legacy vs. Descriptor-Based APIs

Legacy GPIO Interface Kernel API /* Device-tree helper */ int of_get_gpio(struct device_node *np, int idx); /* Pin life-cycle */ int gpio_request(unsigned gpio, const char *label); void gpio_free(unsigned gpio); /* Direction */ int gpio_direction_input(unsigned gpio); int gpio_direction_output(unsigned gpio, int value); /* Value access */ ...

Posted on Thu, 07 May 2026 08:47:11 +0000 by cdorob