Nucleo 144, Arduino IDE 2.3.2 not working blink, digitalWrite(), Seria;println()

Post here first, or if you can't find a relevant section!
DrMN
Posts: 22
Joined: Sun Dec 04, 2022 3:37 pm

Nucleo 144, Arduino IDE 2.3.2 not working blink, digitalWrite(), Seria;println()

Post by DrMN »

Hi,

I have a Nucleo-144 F722ZE

I am attempting to program it with the arduino 2.3.2 ide.

And so far, no blink, no digitalWrite() and no Serial.println()

Details are listed below.

Thank you in advance. I am sure it is trivial, and apologize for having to ask. I have not found any document that helps me solve the problem.


For setup, I followed the instructions here,

https://community.st.com/t5/stm32-mcus/ ... a-p/608514


Here is the blink code, from the arduino examples. This does not blink anything and does not produce any output on the Serial Monitor in the Arduino IDE

Code: Select all

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(9600);
  while( !Serial);
}

// the loop function runs over and over again forever
void loop() {
  Serial.println("here i am");
  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
}





Then I tried setting a specific pin by number, hoping to see it on an oscilloscope. Again, no result

Code: Select all

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(13, OUTPUT);
  Serial.begin(9600);
  while( !Serial);
}

// the loop function runs over and over again forever
void loop() {
  Serial.println("here i am");
  digitalWrite(13, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(13, LOW);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
}

And then after discovering PinNames.h, I tried this:

Code: Select all

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(PD_13, OUTPUT);
  Serial.begin(9600);
  while( !Serial);
}

// the loop function runs over and over again forever
void loop() {
  Serial.println("here i am");
  digitalWrite(PD_13, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(PD_13, LOW);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
}
by fpiSTM » Thu Aug 22, 2024 12:25 pm
DrMN wrote: Wed Aug 21, 2024 6:06 pm Hi,
I have a Nucleo-144 F722ZE
Then:
DrMN wrote: Wed Aug 21, 2024 6:06 pm NODE_F207ZG,NOD_F207ZG not found.
You have to select the correct part number, trying to flash code for F207 mcu to a F722 explain why it is not working.
Go to full post
STM32ardui
Posts: 142
Joined: Mon May 06, 2024 1:46 pm
Answers: 1
Location: Germany

Re: Nucleo 144, Arduino IDE 2.3.2 not working blink, digitalWrite(), Seria;println()

Post by STM32ardui »

From user manual UM1974:
To power the board connect the STM32 Nucleo-144 board to a PC with a USB cable
‘Type-A to Micro-B’ through the USB connector CN1 on the ST-LINK. As a result, the
green LED LD6 (PWR) and LD4 (COM) light up and the red LED LD3 blinks.
Do you observed this before uploading your own sketch?

And from chapter 6.5:
User LD1: a green user LED is connected to the STM32 I/O PB0 (SB120 ON and SB119
OFF) or PA5 (SB119 ON and SB120 OFF) corresponding to the ST Zio D13.
User LD2: a blue user LED is connected to PB7.
User LD3: a red user LED is connected to PB14
GonzoG
Posts: 491
Joined: Wed Jan 15, 2020 11:30 am
Answers: 36
Location: Prudnik, Poland

Re: Nucleo 144, Arduino IDE 2.3.2 not working blink, digitalWrite(), Seria;println()

Post by GonzoG »

delete "while(!Serial)" and check.
DrMN
Posts: 22
Joined: Sun Dec 04, 2022 3:37 pm

Re: Nucleo 144, Arduino IDE 2.3.2 not working blink, digitalWrite(), Seria;println()

Post by DrMN »

I deleted while(!Serial);

No change in the behaviour, the led is not blinking, pin is not changing state and nothing appears in the monitor.

One more perhaps important piece of information. I have been addressing the board a Generic STM32F7, because addressing the Nucleo-144 it does not load.

I am thinking there is a missing udev rules file. Does that sound right?

Nucleo-144 does show a /dev/tty/ACM0 Here is the error message from the loader with Nucleo-144 selected.
Sketch uses 15072 bytes (1%) of program storage space. Maximum is 1048576 bytes.
Global variables use 1216 bytes (0%) of dynamic memory, leaving 129856 bytes for local variables. Maximum is 131072 bytes.
NODE_F207ZG,NOD_F207ZG not found.
Please ensure the device is correctly connected and mounted.
Failed uploading: uploading error: exit status 3
Here is lsusb,
$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0bda:5411 Realtek Semiconductor Corp. RTS5411 Hub
Bus 001 Device 004: ID 0bda:5411 Realtek Semiconductor Corp. RTS5411 Hub
Bus 001 Device 006: ID 12c9:1021 Newmen Tech.,LTD 2.4G Wireless Mouse
Bus 001 Device 021: ID 0483:374b STMicroelectronics ST-LINK/V2.1
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 003: ID 058f:9410 Alcor Micro Corp. Keyboard
Bus 002 Device 004: ID 046d:c408 Logitech, Inc. Marble Mouse (4-button)
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 0bda:0411 Realtek Semiconductor Corp. Hub
Bus 003 Device 003: ID 0bda:0411 Realtek Semiconductor Corp. Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
And here are the all of the rules files that have vendor 0483
$ for f in /etc/udev/rules.d/*rules ; do if grep 0483 $f > /dev/null ; then echo $f ; fi ; done
/etc/udev/rules.d/40-dfuse.rules
/etc/udev/rules.d/49-stlinkv1.rules
/etc/udev/rules.d/49-stlinkv2-1.rules
/etc/udev/rules.d/49-stlinkv2.rules
/etc/udev/rules.d/49-stlinkv3.rules
$
And here are the contents of each of the above:
$ clear ; for f in /etc/udev/rules.d/*rules ; do if grep 0483 $f > /dev/null ; then echo -e "\n************************\n$f\n*****************************" ; cat $f ; fi ; done

************************
/etc/udev/rules.d/40-dfuse.rules
*****************************

# Adding STM32 bootloader mode UDEV rules

# Example udev rules (usually placed in /etc/udev/rules.d)
# Makes STM32 DfuSe device writeable for the "plugdev" group

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="664", GROUP="plugdev", TAG+="uaccess"

************************
/etc/udev/rules.d/49-stlinkv1.rules
*****************************
# stm32 discovery boards, with onboard st/linkv1
# ie, STM32VL.

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", \
MODE="660", GROUP="plugdev", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1", \
SYMLINK+="stlinkv1_%n"

************************
/etc/udev/rules.d/49-stlinkv2-1.rules
*****************************
# stm32 nucleo boards, with onboard st/linkv2-1
# ie, STM32F0, STM32F4.

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", \
MODE="660", GROUP="plugdev", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1", \
SYMLINK+="stlinkv2-1_%n"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3752", \
MODE="660", GROUP="plugdev", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1", \
SYMLINK+="stlinkv2-1_%n"


************************
/etc/udev/rules.d/49-stlinkv2.rules
*****************************
# stm32 discovery boards, with onboard st/linkv2
# ie, STM32L, STM32F4.

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", \
MODE="660", GROUP="plugdev", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1", \
SYMLINK+="stlinkv2_%n"

************************
/etc/udev/rules.d/49-stlinkv3.rules
*****************************
# stlink-v3 boards (standalone and embedded) in usbloader mode and standard (debug) mode

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374d", \
MODE="660", GROUP="plugdev", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1", \
SYMLINK+="stlinkv3loader_%n"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374e", \
MODE="660", GROUP="plugdev", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1", \
SYMLINK+="stlinkv3_%n"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374f", \
MODE="660", GROUP="plugdev", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1", \
SYMLINK+="stlinkv3_%n"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3753", \
MODE="660", GROUP="plugdev", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1", \
SYMLINK+="stlinkv3_%n"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3754", \
MODE="660", GROUP="plugdev", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1", \
SYMLINK+="stlinkv3_%n"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3755", \
MODE="660", GROUP="plugdev", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1", \
SYMLINK+="stlinkv3loader_%n"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3757", \
MODE="660", GROUP="plugdev", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1", \
SYMLINK+="stlinkv3_%n"
fpiSTM
Posts: 1944
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: Nucleo 144, Arduino IDE 2.3.2 not working blink, digitalWrite(), Seria;println()

Post by fpiSTM »

DrMN wrote: Wed Aug 21, 2024 6:06 pm Hi,
I have a Nucleo-144 F722ZE
Then:
DrMN wrote: Wed Aug 21, 2024 6:06 pm NODE_F207ZG,NOD_F207ZG not found.
You have to select the correct part number, trying to flash code for F207 mcu to a F722 explain why it is not working.
DrMN
Posts: 22
Joined: Sun Dec 04, 2022 3:37 pm

Re: Nucleo 144, Arduino IDE 2.3.2 not working blink, digitalWrite(), Seria;println()

Post by DrMN »

Where do I select the part number?

Have not seen any option for that.
DrMN
Posts: 22
Joined: Sun Dec 04, 2022 3:37 pm

Re: Nucleo 144, Arduino IDE 2.3.2 not working blink, digitalWrite(), Seria;println()

Post by DrMN »

Found it. It is another menu item further down

It gets stuck uploading, as shown here. The file navigator opens too. When closed, it reopens.
Sketch uses 17416 bytes (3%) of program storage space. Maximum is 524288 bytes.
Global variables use 1316 bytes (0%) of dynamic memory, leaving 260828 bytes for local variables. Maximum is 262144 bytes.
Found 'NOD_F722ZE' at '/run/media/nelson/NOD_F722ZE'
Copying /tmp/arduino/sketches/F9D3C9414FB08D0B0AA39ECAA481A040/Blink.ino.bin to /run/media/nelson/NOD_F722ZE...
Copy the referenced bin file to it. Now the light is blinking, and there is output in the serial monitor.

So that is a work around.

How do we fix the upload from the IDE?

Thank you
DrMN
Posts: 22
Joined: Sun Dec 04, 2022 3:37 pm

Re: Nucleo 144, Arduino IDE 2.3.2 not working blink, digitalWrite(), Seria;println()

Post by DrMN »

One further question, to save a bit of time:

I need to use interrupts, clocks, and SPI.

Usually I use the attachInterrupt() and detachInterrupt(), the intervalTimer or TimerOne library, and whatever SPI library is provided for the board.

Are those the right API's for those capabilities in this board? If not, what should I use?

Aside to that, I am especially interested in 50MHZ spi.

Thank you
fpiSTM
Posts: 1944
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: Nucleo 144, Arduino IDE 2.3.2 not working blink, digitalWrite(), Seria;println()

Post by fpiSTM »

DrMN wrote: Thu Aug 22, 2024 12:35 pm Found it. It is another menu item further down

It gets stuck uploading, as shown here. The file navigator opens too. When closed, it reopens.
Sketch uses 17416 bytes (3%) of program storage space. Maximum is 524288 bytes.
Global variables use 1316 bytes (0%) of dynamic memory, leaving 260828 bytes for local variables. Maximum is 262144 bytes.
Found 'NOD_F722ZE' at '/run/media/nelson/NOD_F722ZE'
Copying /tmp/arduino/sketches/F9D3C9414FB08D0B0AA39ECAA481A040/Blink.ino.bin to /run/media/nelson/NOD_F722ZE...
Copy the referenced bin file to it. Now the light is blinking, and there is output in the serial monitor.

So that is a work around.

How do we fix the upload from the IDE?

Thank you
I see no error in the upload log. Anyway if it does not work update the STLink firmware using the STM32CubeProgrammer.
GonzoG
Posts: 491
Joined: Wed Jan 15, 2020 11:30 am
Answers: 36
Location: Prudnik, Poland

Re: Nucleo 144, Arduino IDE 2.3.2 not working blink, digitalWrite(), Seria;println()

Post by GonzoG »

DrMN wrote: Thu Aug 22, 2024 12:56 pm Usually I use the attachInterrupt() and detachInterrupt(), the intervalTimer or TimerOne library, and whatever SPI library is provided for the board.
Interrupts work same way as on Arduino.
SPI, I2C are made to be compatible with arduino API but have more functionality as you can choose which interface to use and what pins should be used: https://github.com/stm32duino/Arduino_C ... 2/wiki/API

Timers work differently. There are 12 timers on F722 you can use in different modes. Only 2 of them are basic timers (no I/O channels). https://github.com/stm32duino/Arduino_C ... er-library

Always remember to check MCU datasheet.
Post Reply

Return to “General discussion”