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

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

Closed
tookitogo opened this issue Jul 2, 2023 · 1 comment
Closed

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

tookitogo opened this issue Jul 2, 2023 · 1 comment

Comments

@tookitogo
Copy link

tookitogo commented Jul 2, 2023

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
#include <Arduino.h>

// 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 valeros closed this as completed in ff0a46f Jul 3, 2023
@valeros
Copy link
Member

valeros commented Jul 3, 2023

Thanks for reporting, fixed in the dev branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants