Skip to content

LEDC missing SemaphoreHandle_t (alpha 3 issue) building for M5Stack Core #9133

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

Closed
1 task done
sgryphon opened this issue Jan 18, 2024 · 1 comment · Fixed by #9134
Closed
1 task done

LEDC missing SemaphoreHandle_t (alpha 3 issue) building for M5Stack Core #9133

sgryphon opened this issue Jan 18, 2024 · 1 comment · Fixed by #9134
Labels
Area: Peripherals API Relates to peripheral's APIs.

Comments

@sgryphon
Copy link
Contributor

Board

m5stack-core2

Device Description

M5Stack Core2 ESP32 IoT Development Kit for AWS IoT Kit, https://shop.m5stack.com/products/m5stack-core2-esp32-iot-development-kit-for-aws-iot-edukit?variant=37687799251116

Hardware Configuration

Just the M5Stack Core2

Version

latest master (checkout manually)

IDE Name

PlatformIO

Operating System

Ubuntu 22.04

Flash frequency

240Mhz

PSRAM enabled

yes

Upload speed

115200

Description

Note that you don't actually need an M5Stack Core2 to reproduce the issue, as it happens at build stage (before connecting to the device).

Steps to reproduce:

  1. Open VS Code with PlatformIO, and open the PlatformIO CLI.
  2. Create a new project, e.g.
mkdir TestM5
cd TestM5
pio project init --board m5stack-core2
  1. Install the M5Unified package
pio pkg install --library M5Unified
  1. Create src/main.cpp with the code as per Sketch below.

  2. Check the project builds

pio run
  1. Configure the project to use the Arduino ESP32 alpha 3.0.0 by replacing the platform section in platform.ini with:
platform = https://github.com/sgryphon/platform-espressif32.git#sgryphon/add-esp32-arduino-libs
platform_packages =
    platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#master
    platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
  1. Try and build the project, and observe errors.
pio run

What should happen

Build should succeed (although there will be warnings)

Sketch

#include <Arduino.h>
#include <M5Unified.h>

void setup() {
  M5.begin();
  M5.Lcd.print("Hello M5Stack Core2\n(with Arduino framework)\nvia PlatformIO");
}

void loop() {
}

Debug Message

### What happens:

Build fails, with some warnings and the following error:


In file included from .pio/libdeps/m5stack-core2/M5GFX/src/lgfx/v1/platforms/esp32/Light_PWM.cpp:24:
/home/sly/.platformio/packages/framework-arduinoespressif32@src-cba3def1496a47e6af73c0b73bd2e13c/cores/esp32/esp32-hal-ledc.h:44:5: error: 'SemaphoreHandle_t' does not name a type
   44 |     SemaphoreHandle_t lock;        //xSemaphoreCreateBinary


### Other Steps to Reproduce

This is a compilation error and it looks like a missing include / definition.

You can fix the build with the following work around:

### Work around

Open the downloaded package file: `.platformio/packages/framework-arduinoespressif32@src-
cba3def1496a47e6af73c0b73bd2e13c/cores/esp32/esp32-hal-ledc.h`

Modify to add the following includes, immediate after the existing includes:

```cpp
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"

After that you can build (although there are warnings), and the app runs successfully on the device.

pio run --target upload

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

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@sgryphon sgryphon added the Status: Awaiting triage Issue is waiting for triage label Jan 18, 2024
sgryphon added a commit to sgryphon/arduino-esp32 that referenced this issue Jan 18, 2024
@P-R-O-C-H-Y P-R-O-C-H-Y added Area: Peripherals API Relates to peripheral's APIs. and removed Status: Awaiting triage Issue is waiting for triage labels Jan 18, 2024
@P-R-O-C-H-Y
Copy link
Member

Thanks @sgryphon for opening a PR with a the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Peripherals API Relates to peripheral's APIs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants