platformio / platform-ststm32

ST STM32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm32
Apache License 2.0
405 stars 312 forks source link

Nucleo U575ZI-Q Red LED doesn't light #708

Closed tookitogo closed 1 year ago

tookitogo commented 1 year ago

Environment: PlatformIO v3.2.0 in VS Code 1.79.2 on Windows 11 (22H2 22621.1848).

Something is going wrong with the board definition or toolchain for the Nucleo U575ZI-Q.

While the blue and green LEDs (LED_BLUE and LED_GREEN, respectively) work fine, the red LED (LED_RED) does not.

The same exact test code pasted into Arduino IDE 2.1.1 (using the latest STM32 board support, 2.5.0 currently) works perfectly.

What I can rule out is an issue in the pin definition macros themselves: in both PlatformIO and in Arduino IDE, the LED_RED resolves to LED_LD3, which in turn resolves to PG2, and ultimately to pin number 105.

Test code ```c++ #include // put function declarations here: void blink(void); enum speeds { fast = 100, medium = 500, slow = 1000 }; speeds mydelay = slow; enum LEDs { none, red, green, blue }; LEDs myled = red; void setup() { // put your setup code here, to run once: pinMode(LED_RED, OUTPUT); pinMode(LED_GREEN, OUTPUT); pinMode(LED_BLUE, OUTPUT); } void loop() { // put your main code here, to run repeatedly: blink(); } // put function definitions here: void blink(void) { delay(mydelay); // delay by current setting // toggle between colors switch (myled) { case none: digitalWrite(LED_RED, LOW); digitalWrite(LED_GREEN, LOW); digitalWrite(LED_BLUE, LOW); myled = red; break; case red: digitalWrite(LED_RED, HIGH); digitalWrite(LED_GREEN, LOW); digitalWrite(LED_BLUE, LOW); myled = green; break; case green: digitalWrite(LED_RED, LOW); digitalWrite(LED_GREEN, HIGH); digitalWrite(LED_BLUE, LOW); myled = blue; break; case blue: digitalWrite(LED_RED, LOW); digitalWrite(LED_GREEN, LOW); digitalWrite(LED_BLUE, HIGH); myled = red; break; default: break; } } ```

Additionally, addressing the red LED in STM32CubeIDE also works fine.

I haven't tested any other GPIOs, but can do so if requested.

valeros commented 1 year ago

Thanks for reporting, fixed in the dev branch.