Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong PIN for RGB LED on board lolin_s3_mini #9037

Closed
1 task done
mp-se opened this issue Dec 25, 2023 · 7 comments · Fixed by #9381
Closed
1 task done

Wrong PIN for RGB LED on board lolin_s3_mini #9037

mp-se opened this issue Dec 25, 2023 · 7 comments · Fixed by #9381
Assignees
Labels
Status: In Progress Issue is in progress
Milestone

Comments

@mp-se
Copy link

mp-se commented Dec 25, 2023

Board

lolin_s3_mini

Device Description

Its not possible to control the RGB led on this board with the neopixelWrite() function since the PIN number is wrong in the pins_arduino.h

The pin definition for this board is
#define RGB_BUILTIN LED_BUILTIN

In neopixelWrite the following operation is done

#ifdef RGB_BUILTIN
  if(pin == RGB_BUILTIN){
    _pin = RGB_BUILTIN-SOC_GPIO_PIN_COUNT;
  }
#endif

So the for this to work the definition for this board needs to be
#define RGB_BUILTIN LED_BUILTIN+SOC_GPIO_PIN_COUNT

Not sure if the macro or the LED_BUILTIN constant should be changed so I put it as a bug report instead of PR.

If this is changed its possible to change the rgb led color on this board.

Hardware Configuration

Just plain board not connections

Version

v2.0.14

IDE Name

PlatformIO

Operating System

Windows 11

Flash frequency

40

PSRAM enabled

yes

Upload speed

115200

Description

It should be possible to control the RGB led with neopixel on this board.

Sketch

#include <Arduino.h>

void setup() {
  neopixelWrite(RGB_BUILTIN, 255, 0, 0);
  delay(1000);
  neopixelWrite(RGB_BUILTIN, 0, 255, 0);
  delay(1000);
  neopixelWrite(RGB_BUILTIN, 0, 0, 255);
}

void loop() {
}

Debug Message

E (240) rmt: rmt_set_gpio(526): RMT GPIO ERROR
E (240) rmt: rmt_config(686): set gpio for RMT driver failed
[   331][D][esp32-hal-rmt.c:615] rmtInit():  -- TX RMT - CH 0 - 1 RAM Blocks - pin 254
[   337][E][esp32-hal-rmt.c:631] rmtInit(): RMT failed to initilize.
[   343][E][esp32-hal-rgb-led.c:18] neopixelWrite(): RGB LED driver initialization failed!

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@Eric-IOT
Copy link

Eric-IOT commented Mar 4, 2024

hello,
SIMILIAR BEHAVIOUR
running IDE on windows 10 :
Version: 2.3.0
Date: 2024-02-07T14:04:32.754Z
CLI Version: 0.35.2
and
Adafruit NeoPixel version 1.12.0

i get similar warnings when loading code, but the code is running

In the pin definition for LOLIN S3mini, i made the proposed changes of @mp-se and the warning have disapeared.

@mp-se
Copy link
Author

mp-se commented Mar 4, 2024

The change has already been implemented for the esp32s3 board here https://github.com/espressif/arduino-esp32/blob/master/variants/esp32s3/pins_arduino.h. So it has partly been implemented for some of the s3 boards but this should apply for all boards based on the s3 variant.

@einglis
Copy link

einglis commented Mar 9, 2024

I believe the colour order is different too? The example sketch BlinkRGB should go:

  • White, Red, Green, Blue, ...
    but actually goes:
  • White, Green, Red, Blue, ...

Indeed, esp32-hal-rgb-led.c even says:

  int color[] = {green_val, red_val, blue_val};  // Color coding is in order GREEN, RED, BLUE

@SuGlider
Copy link
Collaborator

@SuGlider
Copy link
Collaborator

We are close to release Arduino 2.0.15.
Therefore, we may submit a PR to release/v2.x branch in order to apply changes for all the board.

@SuGlider
Copy link
Collaborator

We are close to release Arduino 2.0.15. Therefore, we may submit a PR to release/v2.x branch in order to apply changes for all the board.

PR #9381 will add/backport all changes to 2.0.15

@SuGlider SuGlider linked a pull request Mar 16, 2024 that will close this issue
@VojtechBartoska VojtechBartoska added Status: In Progress Issue is in progress and removed Status: Awaiting triage Issue is waiting for triage labels Mar 18, 2024
@VojtechBartoska VojtechBartoska added this to the 2.0.15 milestone Mar 18, 2024
@SuGlider
Copy link
Collaborator

Fixed by #9381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress Issue is in progress
Projects
Development

Successfully merging a pull request may close this issue.

5 participants