Skip to content

FM6124EJ-32x32 pixel LED board #126

Description

@bitwlzxzq

I am using an ESP32P4 to control a 32x32 pixel LED board. The control chip should be an FM6124EJ. Currently, the compilation is fine, but the program fails to initialize. If I change to a different control chip, the display is still not normal.
FM6124A: FM6124 initialization not yet implemented
LED board . HUB75: shift driver initialization failed:ESP_ERR_NOT_SUPPORTED
simple_colors:failed to initialize HUB75 driver!

Image

`

#include "hub75.h"
#include "board_config.h"
#include <esp_log.h>
#include <freertos/FreeRTOS.h> // NOLINT(misc-header-include-cycle)
#include <freertos/task.h>

static const char *const TAG = "simple_colors";

extern "C" void app_main() {
ESP_LOGI(TAG, "HUB75 Simple Colors Example Starting...");

// Load configuration from menuconfig
// Hub75Config config = getMenuConfigSettings();
Hub75Config config{};
config.panel_width = 32;
config.panel_height = 32;
config.shift_driver = Hub75ShiftDriver::FM6124; // Try this if GENERIC doesn't work

// Set GPIO pins (example for ESP32-S3)
config.pins.r1 = 42; config.pins.g1 = 41; config.pins.b1 = 40;
config.pins.r2 = 38; config.pins.g2 = 39; config.pins.b2 = 37;
config.pins.a = 45; config.pins.b = 36; config.pins.c = 48;
config.pins.d = 35; config.pins.e = 21;
config.pins.lat = 47; config.pins.oe = 6; config.pins.clk = 2;

// Print configuration summary
ESP_LOGI(TAG, "Configuration:");
ESP_LOGI(TAG, " Panel: %dx%d pixels (%d-bit, %d Hz min refresh)", config.panel_width, config.panel_height,
HUB75_BIT_DEPTH, config.min_refresh_rate);
ESP_LOGI(TAG, " Layout: %dx%d panels (total %dx%d display)", config.layout_cols, config.layout_rows,
config.panel_width * config.layout_cols, config.panel_height * config.layout_rows);

// Print pin configuration
printPinConfig(config.pins);

// Create driver instance
Hub75Driver driver(config);

// Initialize and start continuous refresh
if (!driver.begin()) {
ESP_LOGE(TAG, "Failed to initialize HUB75 driver!");
return;
}

ESP_LOGI(TAG, "Driver initialized successfully");
ESP_LOGI(TAG, "Display: %dx%d pixels", driver.get_width(), driver.get_height());

// Clear display
driver.clear();

// Draw colored squares in corners
// Uses both fill() (optimized) and set_pixel() loops to demonstrate both APIs
const uint16_t square_size = 8;

// Top-left: Red (using fill - optimized for solid rectangles)
driver.fill(0, 0, square_size, square_size, 255, 0, 0);

// Top-right: Green (using set_pixel loop - for comparison)
for (uint16_t y = 0; y < square_size; y++) {
for (uint16_t x = driver.get_width() - square_size; x < driver.get_width(); x++) {
driver.set_pixel(x, y, 0, 255, 0);
}
}

// Bottom-left: Blue (using set_pixel loop - for comparison)
for (uint16_t y = driver.get_height() - square_size; y < driver.get_height(); y++) {
for (uint16_t x = 0; x < square_size; x++) {
driver.set_pixel(x, y, 0, 0, 255);
}
}

// Bottom-right: White (using fill - optimized for solid rectangles)
driver.fill(driver.get_width() - square_size, driver.get_height() - square_size, square_size, square_size, 255, 255,
255);

// Draw center cross in cyan
uint16_t cx = driver.get_width() / 2;
uint16_t cy = driver.get_height() / 2;

// Horizontal line
for (uint16_t x = cx - 10; x <= cx + 10; x++) {
driver.set_pixel(x, cy, 0, 255, 255);
}

// Vertical line
for (uint16_t y = cy - 10; y <= cy + 10; y++) {
driver.set_pixel(cx, y, 0, 255, 255);
}

ESP_LOGI(TAG, "Test pattern displayed");
ESP_LOGI(TAG, "Expected output:");
ESP_LOGI(TAG, " - Red square in top-left corner");
ESP_LOGI(TAG, " - Green square in top-right corner");
ESP_LOGI(TAG, " - Blue square in bottom-left corner");
ESP_LOGI(TAG, " - White square in bottom-right corner");
ESP_LOGI(TAG, " - Cyan cross in center");

// Idle loop (display continues refresh via DMA)
while (true) {
vTaskDelay(pdMS_TO_TICKS(1000));
}
}

`
Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions