Page 3 of 3
Re: NUCLEO-H7A3ZI-Q Code loads but does not run
Posted: Tue Jan 14, 2025 3:47 pm
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.
Re: NUCLEO-H7A3ZI-Q Code loads but does not run
Posted: Tue Jan 14, 2025 4:10 pm
by ag123
try without the
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
Re: NUCLEO-H7A3ZI-Q Code loads but does not run
Posted: Tue Jan 14, 2025 5:54 pm
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.
Re: NUCLEO-H7A3ZI-Q Code loads but does not run
Posted: Wed Jan 15, 2025 10:46 am
by byquip
SB16 and SB17 are on.
without
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)
Re: NUCLEO-H7A3ZI-Q Code loads but does not run
Posted: Wed Jan 15, 2025 10:53 am
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?
Re: NUCLEO-H7A3ZI-Q Code loads but does not run
Posted: Wed Jan 15, 2025 1:06 pm
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 (14.13 KiB) Viewed 1701 times
Re: NUCLEO-H7A3ZI-Q Code loads but does not run
Posted: Wed Jan 15, 2025 1:22 pm
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);
Re: NUCLEO-H7A3ZI-Q Code loads but does not run
Posted: Wed Jan 15, 2025 1:35 pm
by byquip
Thank you, this was a bit not intuitive for me but it works now
Re: NUCLEO-H7A3ZI-Q Code loads but does not run
Posted: Wed Jan 15, 2025 1:40 pm
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
Re: NUCLEO-H7A3ZI-Q Code loads but does not run
Posted: Wed Jan 15, 2025 4:28 pm
by fpiSTM