yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
ESP32 Core Board📖
1. ESP32 Introduction
  • 1. ESP32S3 Overview
  • 2. Environment Setup Introduction
  • 3. Dev Board Introduction
2. ESP-IDF Development Tutorial
1. Before Development
  • 1. Environment Setup (Windows)
  • 2. Environment Setup (Linux)
  • 3. Build and Flash
2. Basic Peripherals
  • 1. LED Control
  • 2. Button Detection
  • 3. Peripheral Interrupts
  • 4. ESP_TIMER
  • 5. GPTIMER
  • 6. Watchdog Timer
  • 7. DMA
  • 8. ADC
  • 9. PWM Breathing LED
  • 10. RGB LED Effects
3. Serial Communication and Storage System
  • 1. Serial UART Communication Experiment
  • 2. I2C_OLED Display Experiment
  • 3. SPI Bus Communication Experiment
  • 4. PSRAM External Memory Experiment
  • 5. Flash Read and Write Experiment
  • 6. USB Emulated Mass Storage Experiment
4. FreeRTOS operating system
  • 1.FreeRTOS Core Concepts Theory
  • 2.Task Creation and Management
  • 3.Queue
  • 4.Binary Semaphore
  • 5.Mutex
  • 6.Event Groups
  • 7.Software Timer
  • 8.Task Scheduler
  • 9.Low Power Mode
  • 10.Deadlock
  • 11.Priority Inversion
5. Network Protocols and Wireless Communication
  • 1. WIFI Network Basics
  • 2. WIFI STA Mode
  • 3. WIFI AP Mode
  • 4. UDP Client Experiment
  • 5. UDP Server Experiment
  • 6. TCP Client Experiment
  • 7. TCP Server Experiment
  • 8. Socket Programming Basics
  • 9. HTTP Client Experiment
  • 10. HTTP Server Experiment
  • 11. MQTT IoT Communication Protocol
  • 12. WIFI OTA Upgrade
  • 13. Bluetooth Fundamentals
  • 14. Bluetooth Slave Mode
  • 15. Bluetooth Master Mode
6. Audio Applications
  • 1.I2S Microphone Recording and U-Disk Playback
  • 2.I2S Audio Playback Experiment
  • 3.Repeater Experiment
7. Xiaozhi AI Voice
  • 1. Burn Xiaozhi Firmware
  • 2. Network and Configuration
  • 3. AI Agent Settings
  • 4. Program Analysis
  • 5. Free Chat
3. Arduino Development Course
1. Before Development
  • 1. Environment Setup
  • 2. Build and Flash
2. Basic Peripherals
  • 1. LED Control
  • 2. Button Detection
  • 3. Peripheral Interrupts
  • 4. ESP_TIMER
  • 5. GPTIMER
  • 6. Watchdog Timer
  • 7. ADC
  • 8. PWM Breathing LED
  • 9. RGB LED Effects
3. Serial Communication and Storage System
  • 1. Serial UART Communication
  • 2. I2C OLED Display
  • 3. SPI Bus Communication
  • 4. Flash Read and Write
  • 5. USB Emulated Mass Storage
4. Network Protocols and Wireless Communication
  • 1. WIFI Network Basics
  • 2. WIFI STA Mode
  • 3. WIFI AP Mode
  • 4. UDP Server Experiment
  • 5. UDP Client Experiment
  • 6. TCP Client Experiment
  • 7. TCP Server Experiment
  • 8. HTTP Client Experiment
  • 9. HTTP Server Experiment
  • 10. MQTT IoT Communication Protocol
  • 11. WIFI OTA Upgrade
  • 12. Bluetooth Fundamentals
  • 13. Bluetooth Slave Mode
  • 14. Bluetooth Master Mode
5. Audio Applications
  • 1.I2S Microphone Recording and U-Disk Playback
  • 2.I2S Audio Playback Experiment
  • 3.Repeater Experiment
4. MicroPython Development Course
1. Before Development
  • 1. Environment Setup
  • 2. Build and Flash
  • 3. Thonny IDE
2. Basic Peripherals
  • 1. LED Control
  • 2. Button Detection
  • 3. Peripheral Interrupts
  • 4. TIMER_IT
  • 5. Watchdog Timer
  • 6. ADC
  • 7. PWM Breathing LED
  • 8. RGB LED Effects
3. Serial Communication and Storage System
  • 1. Serial UART Communication Experiment
  • 2. I2C_OLED Display Experiment
  • 3. SPI Bus Communication Experiment
  • 4. Flash Read and Write Experiment
  • 5. Print Storage
4. Network Protocols and Wireless Communication
  • 1. WIFI Network Basics
  • 2. WIFI STA Mode
  • 3. WIFI AP Mode
  • 4. UDP Client Experiment
  • 5. UDP Server Experiment
  • 6. TCP Client Experiment
  • 7. TCP Server Experiment
  • 8. HTTP Client Experiment
  • 9. HTTP Server Experiment
  • 10. MQTT
  • 11. Bluetooth Fundamentals
  • 12. Bluetooth Slave Mode
  • 13. Bluetooth Master Mode
5. Audio Applications
  • 1. I2S Audio Playback Experiment
  • 2. Repeater Experiment
Download
  • Code
  • Hardware_Info
  • 3D_Model_File
  • Software_Tools
  • VMware
  • VM_File
Download ZIP

Welcome to ESP32 Core Board repository

3. SPI Bus Communication Experiment

SPI Bus Communication Experiment


SPI Bus Communication Experiment1. SPI Overview2. Core Concepts2.1 SPI Four-Wire System2.2 SPI Modes (CPOL & CPHA)2.3 DMA and Buffer Alignment2.4 Native IO MUX vs GPIO Matrix3. ESP32-S3 SPI Hardware Specifications4. Project Architecture and FlowTask TopologyData Flow5. Hardware Dependencies6. Source Code Details6.1 Header Files and Macro Configuration6.2 spi_master_init() — Master Initialization6.3 spi_slave_init() — Slave Initialization6.4 vSpiSlaveTask() — Slave Full-Duplex Transmit/Receive Task6.5 app_main() — Entry Point7. Operation Flow7.1 Build and Flash Process7.2 Normal Communication Log7.3 Four Abnormal Outputs and CausesCase 1: SLV_MOSI Not Connected (Slave Receive Line Disconnected)Case 2: SLV_MISO Not Connected (Slave Transmit Line Disconnected)Case 3: SLV_SCK Not Connected (Clock Line Disconnected)Case 4: SLV_CS Not Connected (Chip Select Line Disconnected)Summary Comparison of Four CasesSupplement: Master Using Non-Native Pins8. FAQ


1. SPI Overview

SPI (Serial Peripheral Interface) is a synchronous full-duplex serial communication protocol that transfers data at high speed between master and slave through 4 signal lines. Each SPI transfer has master and slave simultaneously sending and receiving data (full-duplex).

Typical use cases:

ScenarioDescription
Flash / SD CardHigh-speed data storage
Display ScreensTFT LCD, OLED (SPI interface)
SensorsAccelerometer, gyroscope, temperature sensor
CommunicationHigh-speed data exchange between MCUs (this example)

This project demonstrates ESP32-S3 internal SPI2 (master) ↔ SPI3 (slave) full-duplex communication. A single SPI transfer simultaneously completes bidirectional data exchange without handshaking or synchronization phases.


2. Core Concepts

2.1 SPI Four-Wire System

SignalDirectionFunction
SCK (Serial Clock)Master→SlaveClock signal, generated by master
MOSI (Master Out Slave In)Master→SlaveMaster sends, slave receives
MISO (Master In Slave Out)Slave→MasterSlave sends, master receives
CS (Chip Select)Master→SlaveChip select (active low), selects target slave

Key Feature: SPI is full-duplex — driven by SCK, data on MOSI and MISO transmits simultaneously, meaning while master sends 1 bit to slave, slave also sends 1 bit to master.

2.2 SPI Modes (CPOL & CPHA)

SPI has 4 modes, determined by CPOL (clock polarity) and CPHA (clock phase):

ModeCPOLCPHASCK Idle LevelSampling Edge
000LowRising edge
101LowFalling edge
210HighFalling edge
311HighRising edge

This example uses Mode 0 (CPOL=0, CPHA=0), SCK idle low, rising edge sampling. Master and slave must be set to the same mode.

2.3 DMA and Buffer Alignment

SPI uses DMA (Direct Memory Access) to automatically move data without CPU byte-by-byte participation. ESP32-S3's DMA requirements:

  • Buffer must be placed in internal SRAM (.bss / DRAM_ATTR), cannot be in PSRAM

  • Buffer must be 32-byte aligned (__attribute__((aligned(32))))

If the above requirements are violated, DMA will not report an error, but will silently read/write incorrect data (all 0xFF or dirty data).

2.4 Native IO MUX vs GPIO Matrix

ESP32-S3's SPI2 (FSPI) has native IO MUX pins, signals connect directly to SPI controller without going through GPIO exchange matrix:

SignalNative Pin
FSPICLK (SCK)GPIO 10
FSPIQ (MOSI)GPIO 12
FSPID (MISO)GPIO 13
FSPICS0 (CS)GPIO 11

Using native pins achieves the lowest timing deviation. If routing SPI signals to other pins through GPIO Matrix, MOSI timing deviation may cause slave to receive all 0xFF.


3. ESP32-S3 SPI Hardware Specifications

FeatureParameter
SPI Controller Count4 (SPI0/SPI1 for Flash/PSRAM, SPI2/SPI3 for user)
Max Clock Frequency80 MHz (SPI2/SPI3)
Mode Support0 / 1 / 2 / 3 (CPOL + CPHA)
Full-duplex / Half-duplexBoth supported
Data Bit Width1 / 2 / 4 / 8 wire
DMA SupportSupported (GDMA channel)
Master / SlaveSPI2/SPI3 can both be configured as master or slave

4. Project Architecture and Flow

​x
app_main()
  ├─ memset() Clear 4 DMA buffers
  ├─ strcpy() Fill mst_tx="Hello from MASTER", slv_tx="SLAVE IS READY!"
  ├─ spi_slave_init()              SPI3 slave initialization, DMA auto
  ├─ xTaskCreate(vSpiSlaveTask)    Create slave task, priority 10, 4KB stack
  ├─ vTaskDelay(800ms)             Wait for slave ready
  ├─ spi_master_init()             SPI2 master initialization, 40kHz, Mode 0
  └─ while(1)                      Main loop (2 second cycle)
       ├─ spi_device_transmit()    Full-duplex transfer: mst_tx → slave, slave → mst_rx
       └─ printf() bidirectional results

vSpiSlaveTask()                    Independent task, runs in parallel
  └─ while(1)
       └─ spi_slave_transmit()     Block wait, print slv_rx and slv_tx after receiving

Task Topology

TaskPriorityStackResponsibility
slave_task (vSpiSlaveTask)104096 BSlave blocks and waits for full-duplex transmit/receive
main (app_main)1 (default)3584 BMaster periodic full-duplex transmit/receive

Data Flow

xxxxxxxxxx
Master mst_tx ──MOSI (GPIO12→GPIO2)──▶ Slave slv_rx
Slave slv_tx ──MISO (GPIO3←GPIO13)──▶ Master mst_rx
              (Same SPI transfer completes simultaneously)

5. Hardware Dependencies

Hardware Connection (ESP32-S3 internal pin shorted):

SignalMaster (SPI2)Slave (SPI3)
SCKGPIO 10 (FSPICLK)GPIO 1
MOSIGPIO 12 (FSPIQ)GPIO 2
MISOGPIO 13 (FSPID)GPIO 3
CSGPIO 11 (FSPICS0)GPIO 9

Note: Master must use FSPI native IO MUX pins. Slave can use any GPIO (avoid PSRAM pins 33~37).

SPI Wiring Diagram

SPI Wiring Diagram Back

Required Components: driver/spi_master, driver/spi_slave, FreeRTOS


6. Source Code Details

6.1 Header Files and Macro Configuration

This code section includes header file references, pin macro definitions, and declarations of 4 DMA buffers. All buffers meet 32-byte alignment and are placed in internal SRAM.

xxxxxxxxxx
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/spi_master.h"
#include "driver/spi_slave.h"
#include "esp_log.h"

#define TAG "SPI_DOUBLE"

/* SPI2 Master (FSPI native IO MUX) */
#define MST_HOST        SPI2_HOST
#define MST_SCK         10     // FSPICLK
#define MST_MOSI        12     // FSPIQ
#define MST_MISO        13     // FSPID
#define MST_CS          11     // FSPICS0

/* SPI3 Slave */
#define SLV_HOST        SPI3_HOST
#define SLV_SCK         1
#define SLV_MOSI        2
#define SLV_MISO        3
#define SLV_CS          9

#define BUF_SIZE        64

/* DMA buffers: 32-byte aligned + internal SRAM */
static DRAM_ATTR uint8_t mst_tx[BUF_SIZE] __attribute__((aligned(32)));
static DRAM_ATTR uint8_t mst_rx[BUF_SIZE] __attribute__((aligned(32)));
static DRAM_ATTR uint8_t slv_tx[BUF_SIZE] __attribute__((aligned(32)));
static DRAM_ATTR uint8_t slv_rx[BUF_SIZE] __attribute__((aligned(32)));

DRAM_ATTR ensures variables are placed in internal DRAM (not PSRAM), aligned(32) meets DMA alignment requirements. Both are essential.

6.2 spi_master_init() — Master Initialization

This function initializes SPI2 as SPI master, configures bus pins, clock frequency (40kHz), and SPI mode (Mode 0), finally mounts the device to the bus.

xxxxxxxxxx
static void spi_master_init(void)
{
    spi_bus_config_t bus_cfg = {
        .mosi_io_num = MST_MOSI, .miso_io_num = MST_MISO,
        .sclk_io_num = MST_SCK,
        .quadwp_io_num = -1, .quadhd_io_num = -1,
        .max_transfer_sz = BUF_SIZE,
    };
    spi_bus_initialize(MST_HOST, &bus_cfg, SPI_DMA_CH_AUTO);

    spi_device_interface_config_t dev_cfg = {
        // 40kHz low speed for stability
        .clock_speed_hz = 40000,
        .mode = 0,
        .spics_io_num = MST_CS,
        .queue_size = 1,
    };
    spi_bus_add_device(MST_HOST, &dev_cfg, &spi_master);
}

6.3 spi_slave_init() — Slave Initialization

This function initializes SPI3 as SPI slave, configures bus pins, SPI mode (Mode 0), and chip select pin, consistent with master mode.

xxxxxxxxxx
static void spi_slave_init(void)
{
    spi_bus_config_t bus_cfg = {
        .mosi_io_num = SLV_MOSI, .miso_io_num = SLV_MISO,
        .sclk_io_num = SLV_SCK,
        .quadwp_io_num = -1, .quadhd_io_num = -1,
    };

    spi_slave_interface_config_t slv_cfg = {
        .mode = 0,
        .spics_io_num = SLV_CS,
        .queue_size = 1,
        .flags = 0,
    };
    spi_slave_initialize(SLV_HOST, &bus_cfg, &slv_cfg, SPI_DMA_CH_AUTO);
}

6.4 vSpiSlaveTask() — Slave Full-Duplex Transmit/Receive Task

The slave in an independent FreeRTOS task loops calling spi_slave_transmit() to block and wait for master to initiate transfer. Each transfer completes transmit and receive simultaneously:

  • slv_rx receives data sent by master

  • slv_tx content is sent to master

The slave task blocks in an independent thread waiting for master to initiate SPI transfer, completes transmit/receive simultaneously each transfer and prints results.

xxxxxxxxxx
void vSpiSlaveTask(void *arg)
{
    ESP_LOGI(TAG, "Slave started, waiting for master...");

    while (1) {
        memset(slv_rx, 0, BUF_SIZE);

        spi_slave_transaction_t t = {
            .length    = BUF_SIZE * 8,
            .tx_buffer = slv_tx,
            .rx_buffer = slv_rx,
        };
        spi_slave_transmit(SLV_HOST, &t, portMAX_DELAY);

        ESP_LOGI(TAG, "Slave received: %s", slv_rx);
        ESP_LOGI(TAG, "Slave sent:     %s", slv_tx);
    }
}

6.5 app_main() — Entry Point

The entry point function sequentially: clear DMA buffers, fill test data, start slave task, initialize master, finally enter main loop to periodically execute full-duplex SPI transfer and print bidirectional results.

xxxxxxxxxx
void app_main(void)
{
    memset(mst_tx, 0, BUF_SIZE);
    memset(mst_rx, 0, BUF_SIZE);
    memset(slv_tx, 0, BUF_SIZE);
    memset(slv_rx, 0, BUF_SIZE);

    strcpy((char *)mst_tx, "Hello from MASTER");
    strcpy((char *)slv_tx, "SLAVE IS READY!");

    // Start slave first, then master
    spi_slave_init();
    xTaskCreate(vSpiSlaveTask, "slave_task", 4096, NULL, 10, NULL);
    vTaskDelay(pdMS_TO_TICKS(800));

    spi_master_init();
    ESP_LOGI(TAG, "Master initialized!");

    while (1) {
        memset(mst_rx, 0, BUF_SIZE);

        spi_transaction_t t = {
            .length    = BUF_SIZE * 8,
            .tx_buffer = mst_tx,
            .rx_buffer = mst_rx,
        };

        ESP_LOGI(TAG, "Master sent:     %s", mst_tx);
        spi_device_transmit(spi_master, &t);
        ESP_LOGI(TAG, "Master received: %s", mst_rx);

        vTaskDelay(pdMS_TO_TICKS(2000));
    }
}

Why initialize slave first? Slave must be ready before master. If master starts first and sends signal to CS, but slave's spi_slave_transmit() is not yet queued, master will receive all 0xFF.


7. Operation Flow

7.1 Build and Flash Process

For detailed flash process: 1. Before Development → 3. Build and Flash

7.2 Normal Communication Log

After wiring according to pin table and powering on, bidirectional communication once every 2 seconds:

xxxxxxxxxx
I (1082) SPI_DOUBLE: Master initialized!
=============================================
I (1092) SPI_DOUBLE: Master sent:     Hello from MASTER
I (1102) SPI_DOUBLE: Slave received: Hello from MASTER
I (1102) SPI_DOUBLE: Slave sent:     SLAVE IS READY!
I (1102) SPI_DOUBLE: Master received: SLAVE IS READY!
=============================================

SPI Serial Status Print

Key verification points:

  • Master my_tx "Hello from MASTER" → slave slv_rx matches

  • Slave slv_tx "SLAVE IS READY!" → master mst_rx matches

7.3 Four Abnormal Outputs and Causes

Each of the four SPI signal lines has its own function. Any one disconnected causes different abnormal phenomena. Below analyzes each case of one line disconnected, the serial output and root cause.


Case 1: SLV_MOSI Not Connected (Slave Receive Line Disconnected)

Phenomenon: Master sends normally, slave receives all 0xFF; slave sends normally, master correctly receives slave data.

Cause: MOSI is the only channel for slave to receive data. After disconnection, slave MOSI pin floats (internal pull-up to high), SCK clock samples logic 1 each time, so slave receives 0xFF for each byte. But MISO is still normally connected, so master can correctly receive data sent by slave.

Serial output example:

xxxxxxxxxx
I (1082) SPI_DOUBLE: Master sent:     Hello from MASTER
I (1092) SPI_DOUBLE: Slave received:                       ← Received 0x00
I (1092) SPI_DOUBLE: Slave sent:     SLAVE IS READY!
I (1092) SPI_DOUBLE: Master received: SLAVE IS READY!      ← Master received normally

SLV_MOSI Pin Not Connected Serial Output


Case 2: SLV_MISO Not Connected (Slave Transmit Line Disconnected)

Phenomenon: Master sends normally, slave correctly receives master data; slave sends normally, but master receives all 0xFF.

Cause: MISO is the only channel for master to receive slave data. After disconnection, master MISO pin floats (internal pull-up to high), SCK clock samples logic 1 each time, so master receives 0xFF for each byte. But MOSI is still normally connected, so slave can correctly receive data sent by master.

Serial output example:

xxxxxxxxxx
I (1092) SPI_DOUBLE: Master sent:     Hello from MASTER
I (1092) SPI_DOUBLE: Slave received: Hello from MASTER     ← Slave received normally
I (1092) SPI_DOUBLE: Slave sent:     SLAVE IS READY!
I (1102) SPI_DOUBLE: Master received:                      ← Received 0x00

SLV_MISO Pin Not Connected Serial Output


Case 3: SLV_SCK Not Connected (Clock Line Disconnected)

Phenomenon: Both tasks run normally, but transmit/receive data is empty (buffer keeps original value after memset clear, all 0x00).

Cause: SCK is the clock signal that drives data shifting. After wire break, although CS correctly "selects" both sides into transfer state, without SCK transitions, data is not shifted out or sampled — shift register stays still. When CS deselects, spi_slave_transmit() still returns normally (triggered by CS rising edge), but both sides' rx_buffer contains 0x00 after memset, so printed as empty string.

Key difference: Slave does not block after SCK disconnected. ESP-IDF's spi_slave_transmit() is triggered to complete by CS signal's rising edge, not waiting for SCK transition. But data shifting must rely on SCK, so after CS pulls low→high, transfer "formally completes", actually no data flows.

Serial output example:

xxxxxxxxxx
I (1082) SPI_DOUBLE: Master sent:     Hello from MASTER
I (1092) SPI_DOUBLE: Slave received:
I (1092) SPI_DOUBLE: Slave sent:     SLAVE IS READY!
I (1092) SPI_DOUBLE: Master received:

SLV_SCLK Pin Not Connected Serial Output


Case 4: SLV_CS Not Connected (Chip Select Line Disconnected)

Phenomenon: Communication may be completely normal, slave correctly transmits/receives; or slave may not respond at all. Depends on floating level.

Cause: CS (Chip Select) is the signal line master uses to select target slave, active low (slave is selected when CS = 0). After CS pin is disconnected, it is in floating state, its input level is uncertain:

Floating LevelSlave StateCommunication Result
Float low (≈0V)Always selectedCommunication normal (no different from wiring)
Float high (≈3.3V)Never selectedSlave does not respond (blocks waiting)

Floating level of GPIO pin when floating is affected by:

  • Internal weak pull-down/pull-up resistor: ESP32-S3 IO pins have configurable weak pull-up/pull-down, default state after reset may make pin tend toward a certain level

  • Parasitic capacitance of PCB traces: Adjacent high-speed signal lines (such as SCK) may affect floating pin through capacitive coupling

  • Environmental noise: EMI can also affect floating pin's instantaneous level

Measured conclusion: Whether communication is normal after CS disconnected is uncertain, depends on specific hardware environment and floating level. In this single-slave scenario, as long as CS happens to float low, communication will work normally. This is also why CS wire can sometimes be omitted in single-slave systems — but when slave floats high it still blocks, do not rely on floating behavior in production environments.

Serial output example when floating low (communication normal):

xxxxxxxxxx
I (1092) SPI_DOUBLE: Master sent:     Hello from MASTER
I (1102) SPI_DOUBLE: Slave received: Hello from MASTER     ← Normal! Slave "always selected"
I (1102) SPI_DOUBLE: Slave sent:     SLAVE IS READY!
I (1102) SPI_DOUBLE: Master received: SLAVE IS READY!      ← Normal!

SLV_CS Pin Not Connected Serial Output

Serial output example when floating high (communication failed):

xxxxxxxxxx
I (1092) SPI_DOUBLE: Master sent:     Hello from MASTER
I (1102) SPI_DOUBLE: Master received:                       ← Master received 0xFF
                                                            ← Slave has no output!

Summary Comparison of Four Cases

Disconnected SignalMaster TX → Slave RXSlave TX → Master RXSlave Task Running
SLV_MOSI not connectedSlave receives 0x00NormalRuns normally
SLV_MISO not connectedNormalMaster receives 0x00Runs normally
SLV_SCK not connectedSlave receives empty (0x00)Master receives empty (0x00)Runs normally
SLV_CS not connectedUncertain (float low=normal, float high=slave blocks)Uncertain (float low=normal, float high=0x00)Depends on floating level

Tip: These four abnormal outputs are effective tools for locating SPI hardware wiring problems — based on "which side receives 0xFF" you can quickly locate the disconnected signal line.


Supplement: Master Using Non-Native Pins

Routing through GPIO Matrix introduces additional delay, slave may receive incorrect data. Always use FSPI native pins (10/12/13/11).


8. FAQ

SymptomCauseSolution
Master receives all 0xFFSlave not started / MISO floatingEnsure spi_slave_init() and vSpiSlaveTask run before master
Slave receives all 0xFFMOSI timing deviation / master uses non-native pinsMaster use FSPI native IO MUX pins (GPIO 10/12/13/11)
Both sides have 0xFF4 SPI wires not connectedCheck SCK, MOSI, MISO, CS four Dupont wires
Data occasionally misalignedClock frequency too high / cable too longLower clock_speed_hz (e.g., 10000), shorten Dupont wires
Build error spi_master.h not foundSPI driver not enabledmenuconfig → Component config → Driver → SPI driver
DMA buffer data abnormalBuffer not aligned or in PSRAMCheck DRAM_ATTR + aligned(32)
I2C_OLED Display Experiment
PSRAM External Memory Experiment

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文