NUCLEO-H7A3ZI-Q Code loads but does not run

Post here first, or if you can't find a relevant section!
byquip
Posts: 11
Joined: Thu Jan 09, 2025 10:50 am

Re: NUCLEO-H7A3ZI-Q Code loads but does not run

Post by byquip »

I don't know if it's related to this problem or not but serial communication seems not works properly.
Example:

Code: Select all

#define ledPin PB0

void setup() {
  Serial.begin(9600);
  while(!Serial);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  digitalWrite(ledPin, !digitalRead(ledPin));
  delay(100);
  Serial.printf("Serial: %i\n", 1);
}
With "USB support (if available): None" configuration it just blink and no data in COM port received.
With "USB support (if available): CDC (generic 'Serial' supersede U(S)ART)" configuration it not even blinks.

Changing Serial to SerialUSB did not help.
ag123
Posts: 1899
Joined: Thu Dec 19, 2019 5:30 am
Answers: 30

Re: NUCLEO-H7A3ZI-Q Code loads but does not run

Post by ag123 »

try without the

Code: Select all

while(!Serial);
and does it blink? and I think 115200 baud is a 'comfortable' speed as you are using a H7 after all.
oh and for Nucleo, I think some of the Serial() actually goes to Serial1 which goes to st-link that in turns work as a usb-uart dongle.

https://www.st.com/resource/en/user_man ... ronics.pdf
6.10 USART communication
The USART3 interface available on PD8 and PD9 of the STM32H7 can be connected either
to ST-LINK or to the ST morpho connector. The choice is changed by setting the related
solder bridges. By default, the USART3 communication between the target STM32H7 and
the STLINK is enabled, to support the Virtual COM port for the Mbed (SB16 and SB17 ON).

maybe try Serial3

but apparently it also has USB,
6.11 USB OTG FS or device
fpiSTM
Posts: 1946
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: NUCLEO-H7A3ZI-Q Code loads but does not run

Post by fpiSTM »

The clock clock config is not complete. USB requires a 48 MHz clock and use HS in FS mode. I've tested on my branch and it works for Serial you have to set PD8 and PD9 as Tx an Rx.
byquip
Posts: 11
Joined: Thu Jan 09, 2025 10:50 am

Re: NUCLEO-H7A3ZI-Q Code loads but does not run

Post by byquip »

SB16 and SB17 are on.
without

Code: Select all

while(!Serial);
it does not blink for both Serial and SerialUSB (USB support (if available): CDC (generic 'Serial' supersede U(S)ART))
according to https://os.mbed.com/platforms/ST-Nucleo-H7A3ZI-Q/
PD9 and PD8 are Tx and Rx of UART4
I set:

Code: Select all

#define PIN_SERIAL_RX PD8
#define PIN_SERIAL_TX PD9
and used generic_clock.c from your branch with (USB support (if available): CDC (generic 'Serial' supersede U(S)ART)) and HS in FS mode it does not blink. (and no messages in serial)
fpiSTM
Posts: 1946
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: NUCLEO-H7A3ZI-Q Code loads but does not run

Post by fpiSTM »

I do not push my branch and define are not correct if it is in the sketch. use Serial.setTx() an setRx().
could you open a issue to request this board, please?
byquip
Posts: 11
Joined: Thu Jan 09, 2025 10:50 am

Re: NUCLEO-H7A3ZI-Q Code loads but does not run

Post by byquip »

done
https://github.com/stm32duino/Arduino_C ... ssues/2632

setRx/Tx seems like not works for me

I also tried to change clocks
Screenshot_2.png
Screenshot_2.png (14.13 KiB) Viewed 1319 times
fpiSTM
Posts: 1946
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: NUCLEO-H7A3ZI-Q Code loads but does not run

Post by fpiSTM »

USB requires 48MHz not USART.
To test Serial with the generic, you have to disable USB and do:

Code: Select all

Serial.setRx(PD9);
Serial.setTx(PD8);
Serial.begin(9600);
byquip
Posts: 11
Joined: Thu Jan 09, 2025 10:50 am

Re: NUCLEO-H7A3ZI-Q Code loads but does not run

Post by byquip »

Thank you, this was a bit not intuitive for me but it works now
fpiSTM
Posts: 1946
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: NUCLEO-H7A3ZI-Q Code loads but does not run

Post by fpiSTM »

The generic is in fact a mcu with default pin mapping, so if you use it with a specific board you have to customize with correct pins.
https://github.com/stm32duino/Arduino_C ... tance-pins
fpiSTM
Posts: 1946
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: NUCLEO-H7A3ZI-Q Code loads but does not run

Post by fpiSTM »

Post Reply

Return to “General discussion”