STM32L476RG problem

All about boards manufactured by ST
Post Reply
luka.banfi
Posts: 10
Joined: Fri Dec 11, 2020 3:09 pm

STM32L476RG problem

Post by luka.banfi »

I followed the getting started guide, selected the Mass Storage upload option (since Nucleo boards integrate a ST-Link), verified and uploaded blink example, but the LED doesn't blink. It works using the Mbed compiler. What am I missing or doing wrong? This is just for testing purposes.
Image
Blink example code:

Code: Select all

/*
  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.

  http://www.arduino.cc/en/Tutorial/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
}
by fpiSTM » Sat Dec 12, 2020 2:59 pm
Try to disable the USB CDC as the Nucleo L476RG as no USB connector maybe the clock for USB is not properly configured.

Edit:
I've tested with USB enabled and it's failed due to clock init.
This will be fixed in the variant rework anyway simply disable USB as it is not required or redefine the SystemClock_Config to configure properly the USB at 48 MHz.
Go to full post
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32L476RG problem

Post by fpiSTM »

Seems strange works for me.
Could you try to update the STLink FW?
luka.banfi
Posts: 10
Joined: Fri Dec 11, 2020 3:09 pm

Re: STM32L476RG problem

Post by luka.banfi »

fpiSTM wrote: Fri Dec 11, 2020 5:57 pm Seems strange works for me.
Could you try to update the STLink FW?
I updated the firmware to version V2.J37.M26 using STM32 ST-LINK Utility, verified and uploaded the compiled code, but the problem persists.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32L476RG problem

Post by fpiSTM »

Could you shared all your config?
core version, Arduino IDE version, selected options...
luka.banfi
Posts: 10
Joined: Fri Dec 11, 2020 3:09 pm

Re: STM32L476RG problem

Post by luka.banfi »

fpiSTM wrote: Sat Dec 12, 2020 7:10 am Could you shared all your config?
core version, Arduino IDE version, selected options...
STM32 Cores version 1.9.0 and Arduino IDE version 1.8.13 installed.

Selected options:
  • Board: "Nucleo-64"
  • Board part number: "Nucleo L476RG"
  • U(S)ART support: "Enabled (generic 'Serial')"
  • USB support (if available): "CDC (generic 'Serial' supersede U(S)ART)"
  • USB speed (if available): "Low/Full Speed"
  • Optimize: "Smallest (-Os default)"
  • C Runtime Library: "Newlib Nano (default)"
  • Upload method: "Mass Storage"
  • Port: "COM3"
Upload method: "Mass Storage" output:

Code: Select all

1 File(s) copied
Upload complete on NODE_L476RG (D:)
Remaining upload methods produce following outputs:

Upload method: "STM32CubeProgrammer (SWD)"

Code: Select all

      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.6.0                  
      -------------------------------------------------------------------

ST-LINK SN  : 066BFF565653756687243410
ST-LINK FW  : V2J37M26
Board       : NUCLEO-L476RG
Voltage     : 3.26V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x415
Revision ID : Rev 4
Device name : STM32L4x1/STM32L475xx/STM32L476xx/STM32L486xx
Flash size  : 1 MBytes
Device type : MCU
Device CPU  : Cortex-M4



Memory Programming ...
Opening and parsing file: Blink.ino.bin
  File          : Blink.ino.bin
  Size          : 23124 Bytes
  Address       : 0x08000000 


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 11]
Download in Progress:


File download complete
Time elapsed during download operation: 00:00:00.875

RUNNING Program ... 
  Address:      : 0x8000000
Application is running
Start operation achieved successfully
Upload method: "STM32CubeProgrammer (Serial)"

Code: Select all

      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.6.0                  
      -------------------------------------------------------------------

Serial Port COM3 is successfully opened.
Port configuration: parity = even, baudrate = 115200, data-bit = 8,
                     stop-bit = 1.0, flow-control = off

Timeout error occured while waiting for acknowledgement.

Timeout error occured while waiting for acknowledgement.
Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again...
Upload method: "STM32CubeProgrammer (DFU)"

Code: Select all

      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.6.0                  
      -------------------------------------------------------------------



Error: Target device not found
Establishing connection with the device failed
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32L476RG problem

Post by fpiSTM »

Try to disable the USB CDC as the Nucleo L476RG as no USB connector maybe the clock for USB is not properly configured.

Edit:
I've tested with USB enabled and it's failed due to clock init.
This will be fixed in the variant rework anyway simply disable USB as it is not required or redefine the SystemClock_Config to configure properly the USB at 48 MHz.
luka.banfi
Posts: 10
Joined: Fri Dec 11, 2020 3:09 pm

Re: STM32L476RG problem

Post by luka.banfi »

fpiSTM wrote: Sat Dec 12, 2020 2:59 pm Try to disable the USB CDC as the Nucleo L476RG as no USB connector maybe the clock for USB is not properly configured.

Edit:
I've tested with USB enabled and it's failed due to clock init.
This will be fixed in the variant rework anyway simply disable USB as it is not required or redefine the SystemClock_Config to configure properly the USB at 48 MHz.
This resolved the issue, thank you very much!
parisianos
Posts: 11
Joined: Tue Jan 18, 2022 11:17 pm

Re: STM32L476RG problem

Post by parisianos »

Please I have the same problem only with blackpill STM32F411CE
I am in Arduino IDE
All cards that I have works except this. I tryed all possibilities without resolved the problem. This card worked before the failed
Have some other suggestions?
Thank you
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: STM32L476RG problem

Post by ag123 »

did you choose the right variant STM32F411CE WeAct Black Pill ?
https://github.com/stm32duino/Arduino_C ... 2f4-boards
for 3rd party boards, the key is the crystal frequency, once you figure out how to configure clocks for the HSE crystal, you could make your own variant for just about any board.
strictly speaking, even with a wrong HSE crystal frequency you should still be able to blink the led. just that usb (serial) won't work.
Post Reply

Return to “STM boards (Discovery, Eval, Nucleo, ...)”