Skip to content

Wrong LED_BUILTIN definition for m5stack_atoms3 variant #11688

@brice-fr

Description

@brice-fr

Board

M5AtomS3

Device Description

M5Stack AtomS3-Lite with built-in button and RGB Led on GPIO #35
See M5 Stack wiki

Hardware Configuration

No external device connected

Version

v3.3.0

Type

Bug

IDE Name

Arduino IDE 1.8.19

Operating System

Windows 11

Flash frequency

80 Mhz

PSRAM enabled

no

Upload speed

921600

Description

When compiling and flashing Blink.ino or BlinkRGB.ino nothing happens on the board and the led does not change state.

Sketch

/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
  the correct LED pin independent of which board is used.
  If you want to know what pin the on-board LED is connected to on your Arduino
  model, check the Technical Specs of your board at:
  https://www.arduino.cc/en/Main/Products

  modified 8 May 2014
  by Scott Fitzgerald
  modified 2 Sep 2016
  by Arturo Guadalupi
  modified 8 Sep 2016
  by Colby Newman

  This example code is in the public domain.

  https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
*/

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

Debug Message

22:13:09.161 -> ESP-ROM:esp32s3-20210327
22:13:09.161 -> =========== Before Setup Start ===========
22:13:09.161 -> Chip Info:
22:13:09.161 -> ------------------------------------------
22:13:09.161 ->   Model             : ESP32-S3
22:13:09.161 ->   Package           : 0
22:13:09.161 ->   Revision          : 0.01
22:13:09.161 ->   Cores             : 2
22:13:09.161 ->   CPU Frequency     : 240 MHz
22:13:09.161 ->   XTAL Frequency    : 40 MHz
22:13:09.161 ->   Features Bitfield : 0x00000012
22:13:09.161 ->   Embedded Flash    : No
22:13:09.161 ->   Embedded PSRAM    : No
22:13:09.161 ->   2.4GHz WiFi       : Yes
22:13:09.161 ->   Classic BT        : No
22:13:09.161 ->   BT Low Energy     : Yes
22:13:09.161 ->   IEEE 802.15.4     : No
22:13:09.161 -> ------------------------------------------
22:13:09.161 -> INTERNAL Memory Info:
22:13:09.161 -> ------------------------------------------
22:13:09.161 ->   Total Size        :   389396 B ( 380.3 KB)
22:13:09.161 ->   Free Bytes        :   351888 B ( 343.6 KB)
22:13:09.161 ->   Allocated Bytes   :    32508 B (  31.7 KB)
22:13:09.161 ->   Minimum Free Bytes:   346740 B ( 338.6 KB)
22:13:09.161 ->   Largest Free Block:   294900 B ( 288.0 KB)
22:13:09.161 -> ------------------------------------------
22:13:09.161 -> Flash Info:
22:13:09.161 -> ------------------------------------------
22:13:09.161 ->   Chip Size         :  8388608 B (8 MB)
22:13:09.161 ->   Block Size        :    65536 B (  64.0 KB)
22:13:09.161 ->   Sector Size       :     4096 B (   4.0 KB)
22:13:09.161 ->   Page Size         :      256 B (   0.2 KB)
22:13:09.161 ->   Bus Speed         : 80 MHz
22:13:09.161 ->   Bus Mode          : QIO
22:13:09.161 -> ------------------------------------------
22:13:09.161 -> Partitions Info:
22:13:09.161 -> ------------------------------------------
22:13:09.161 ->                 nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
22:13:09.161 ->             otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
22:13:09.161 ->                app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
22:13:09.161 ->                app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
22:13:09.161 ->              spiffs : addr: 0x00290000, size:  1408.0 KB, type: DATA, subtype: SPIFFS
22:13:09.161 ->            coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
22:13:09.161 -> ------------------------------------------
22:13:09.161 -> Software Info:
22:13:09.161 -> ------------------------------------------
22:13:09.161 ->   Compile Date/Time : Aug  2 2025 22:08:14
22:13:09.161 ->   Compile Host OS   : windows
22:13:09.161 ->   ESP-IDF Version   : v5.5-1-gb66b5448e0
22:13:09.161 ->   Arduino Version   : 3.3.0
22:13:09.161 -> ------------------------------------------
22:13:09.161 -> Board Info:
22:13:09.161 -> ------------------------------------------
22:13:09.161 ->   Arduino Board     : M5STACK_ATOMS3
22:13:09.161 ->   Arduino Variant   : m5stack_atoms3
22:13:09.161 ->   Arduino FQBN      : esp32:esp32:m5stack_atoms3:JTAGAdapter=default,PSRAM=disabled,FlashMode=qio,FlashSize=8M,LoopCore=1,EventsCore=1,USBMode=hwcdc,CDCOnBoot=cdc,MSCOnBoot=default,DFUOnBoot=default,UploadMode=default,PartitionScheme=default,CPUFreq=240,UploadSpeed=921600,DebugLevel=debug,EraseFlash=none
22:13:09.161 -> ============ Before Setup End ============
22:13:09.267 -> =========== After Setup Start ============
22:13:09.267 -> INTERNAL Memory Info:
22:13:09.267 -> ------------------------------------------
22:13:09.267 ->   Total Size        :   389396 B ( 380.3 KB)
22:13:09.267 ->   Free Bytes        :   351800 B ( 343.6 KB)
22:13:09.267 ->   Allocated Bytes   :    32564 B (  31.8 KB)
22:13:09.267 ->   Minimum Free Bytes:   346328 B ( 338.2 KB)
22:13:09.267 ->   Largest Free Block:   294900 B ( 288.0 KB)
22:13:09.267 -> ------------------------------------------
22:13:09.267 -> GPIO Info:
22:13:09.267 -> ------------------------------------------
22:13:09.267 ->   GPIO : BUS_TYPE[bus/unit][chan]
22:13:09.267 ->   --------------------------------------  
22:13:09.267 ->     19 : USB_DM
22:13:09.267 ->     20 : USB_DP
22:13:09.267 ->     35 : GPIO
22:13:09.267 ->     43 : UART_TX[0]
22:13:09.267 ->     44 : UART_RX[0]
22:13:09.267 -> ============ After Setup End =============

Other Steps to Reproduce

By manually changing locally the pins_arduino.h of the variant with this code instead of what seems a copy-paste of the generic ESP32S3 code mentioning pin 48:

#define PIN_RGB_LED 35
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;

the proper blicking behaviour is observed

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

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions