STM32 H743ZI Nucleo doesn't support most libraries?

Hi ,
I was using STM32F429Zi Nucleo board with Arduino platform for our project ,so far tested wifi101 with ATWINC1500,and on board ethernet .Everything works until I change the board to Nucleo H743ZI since our developers need more RAM .

The pin map is exactly similart to the 144 STM32F429Zi Nucleo board which i used before .Hooked up the wifi module the same way i hooked up for the 429Zi board .Compiled successfully and flashed ,but the wifi doesn’t work .Then tested the on board ethernet with same libraries use for the 429Zi board . Which the 429ZI compiled and ran successfully ,but with the H743ZI board it gives errors as follows ,

      |                                     ^~~~~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_h743zi\STM32duino LwIP\src\utility\ethernetif.cpp:559:22: error: 'PHY_SPEED_STATUS' was not declared in this scope
  559 |       if (regvalue & PHY_SPEED_STATUS) {
      |                      ^~~~~~~~~~~~~~~~
.pio\libdeps\nucleo_h743zi\STM32duino LwIP\src\utility\ethernetif.cpp:561:24: error: 'struct ETH_InitTypeDef' has no member named 'Speed'
  561 |         EthHandle.Init.Speed = ETH_SPEED_10M;
      |                        ^~~~~
.pio\libdeps\nucleo_h743zi\STM32duino LwIP\src\utility\ethernetif.cpp:564:24: error: 'struct ETH_InitTypeDef' has no member named 'Speed'
  564 |         EthHandle.Init.Speed = ETH_SPEED_100M;
      |                        ^~~~~
.pio\libdeps\nucleo_h743zi\STM32duino LwIP\src\utility\ethernetif.cpp:573:44: error: 'PHY_BCR' was not declared in this scope
  573 |       HAL_ETH_WritePHYRegister(&EthHandle, PHY_BCR, ((uint16_t)(EthHandle.Init.DuplexMode >> 3) |
      |                                            ^~~~~~~
.pio\libdeps\nucleo_h743zi\STM32duino LwIP\src\utility\ethernetif.cpp:573:80: error: 'struct ETH_InitTypeDef' has no member named 'DuplexMode'
  573 |       HAL_ETH_WritePHYRegister(&EthHandle, PHY_BCR, ((uint16_t)(EthHandle.Init.DuplexMode >> 3) |
      |                                                                                ^~~~~~~~~~
.pio\libdeps\nucleo_h743zi\STM32duino LwIP\src\utility\ethernetif.cpp:574:80: error: 'struct ETH_InitTypeDef' has no member named 'Speed'
  574 |                                                      (uint16_t)(EthHandle.Init.Speed >> 1)));
      |                                                                                ^~~~~
.pio\libdeps\nucleo_h743zi\STM32duino LwIP\src\utility\ethernetif.cpp:578:36: error: 'ETH_MACInitTypeDef' was not declared in this scope; did you mean 'ETH_InitTypeDef'?
  578 |     HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef *) NULL);
      |                                    ^~~~~~~~~~~~~~~~~~
      |                                    ETH_InitTypeDef
.pio\libdeps\nucleo_h743zi\STM32duino LwIP\src\utility\ethernetif.cpp:578:56: error: expected primary-expression before ')' token
  578 |     HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef *) NULL);
      |                                                        ^
.pio\libdeps\nucleo_h743zi\STM32duino LwIP\src\utility\ethernetif.cpp:578:5: error: 'HAL_ETH_ConfigMAC' was not declared in this scope
  578 |     HAL_ETH_ConfigMAC(&EthHandle, (ETH_MACInitTypeDef *) NULL);
      |     ^~~~~~~~~~~~~~~~~
*** [.pio\build\nucleo_h743zi\lib51d\STM32duino LwIP\utility\ethernetif.cpp.o] Error 1
==================================================== [FAILED] Took 13.94 seconds ====================================================
The terminal process "C:\Users\Sid\.platformio\penv\Scripts\pio.exe 'run'" terminated with exit code: 1.

Not sure if they use a different ethernet module .But my main focus is now to get the wifi board working since our project is kind of stuck without it .Appreciate if someone can help with this .

The .ini config as follows,

[env:nucleo_h743zi]
platform = ststm32
board = nucleo_h743zi
framework = arduino
lib_deps = arduino-libraries/WiFi101@^0.16.1

Thank you ,
Samson.

The library that’s being used here states in Support Nucleo-H743 · Issue #21 · stm32duino/STM32Ethernet · GitHub that STM32H7 support does not work.

Same is repeated in Use Async Web Server with Nucleo-H743 or H745 · Issue #3 · khoih-prog/AsyncWebServer_STM32 · GitHub.

And again in this issue mqtt_STM32Ethernet.ino doesn't compile with Nucleo H743ZI2 · Issue #28 · stm32duino/STM32Examples · GitHub

I’m afraid you’ll have to use a diffrent library or framework for this, or ping the developers of the library above.

Note that just the Wifi101 library example from WiFi101/examples/WiFiWebClient at master · arduino-libraries/WiFi101 · GitHub compiles when applying the code fix in attachInterrupt() on wifi101 unidentified - #4 by maxgerhardt. It’s the ethernet part that’s giving you problems.

PS: I’ve also checked the latest git version which differs from the latest released version but it does still not compile. The way the STM32H7 HAL layer is accessed with the structures and macros is wrong.

[env:nucleo_h743zi]
platform = ststm32
board = nucleo_h743zi
framework = arduino
lib_deps = 
    arduino-libraries/WiFi101@^0.16.1
    stm32duino/STM32duino LwIP @ ^2.1.2
    https://github.com/stm32duino/STM32Ethernet.git

.pio\libdeps\nucleo_h743zi\STM32Ethernet@src-d06a072c7077098d2d1f015983f255fd\src\utility\stm32_eth.cpp:67:4: warning: #warning "Default timer used to call ethernet scheduler at regular interval: TIM14" [-Wcpp]
   67 |   #warning "Default timer used to call ethernet scheduler at regular interval: TIM14"
      |    ^~~~~~~
Compiling .pio\build\nucleo_h743zi\libf01\WiFi101\WiFiUdp.cpp.o
.pio\libdeps\nucleo_h743zi\STM32Ethernet@src-d06a072c7077098d2d1f015983f255fd\src\utility\ethernetif.cpp:80:48: error: 'ETH_RXBUFNB' was not declared in this scope
   80 | __ALIGN_BEGIN ETH_DMADescTypeDef  DMARxDscrTab[ETH_RXBUFNB] __ALIGN_END;/* Ethernet Rx MA Descriptor */
      |                                                ^~~~~~~~~~~
.pio\libdeps\nucleo_h743zi\STM32Ethernet@src-d06a072c7077098d2d1f015983f255fd\src\utility\ethernetif.cpp:85:48: error: 'ETH_TXBUFNB' was not declared in this scope
   85 | __ALIGN_BEGIN ETH_DMADescTypeDef  DMATxDscrTab[ETH_TXBUFNB] __ALIGN_END;/* Ethernet Tx DMA Descriptor */
      |                                                ^~~~~~~~~~~
.pio\libdeps\nucleo_h743zi\STM32Ethernet@src-d06a072c7077098d2d1f015983f255fd\src\utility\ethernetif.cpp:90:31: error: 'ETH_RXBUFNB' was not declared in this scope
   90 | __ALIGN_BEGIN uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __ALIGN_END; /* Ethernet Receive Buffer */
      |                               ^~~~~~~~~~~
.pio\libdeps\nucleo_h743zi\STM32Ethernet@src-d06a072c7077098d2d1f015983f255fd\src\utility\ethernetif.cpp:90:44: error: 'ETH_RX_BUF_SIZE' was not declared in this scope
Compiling .pio\build\nucleo_h743zi\libf01\WiFi101\bsp\source\nm_bsp_arduino.c.o
...
.pio\libdeps\nucleo_h743zi\STM32Ethernet@src-d06a072c7077098d2d1f015983f255fd\src\utility\ethernetif.cpp:184:18: error: 'struct ETH_InitTypeDef' has no member named 'PhyAddress'
  184 |   EthHandle.Init.PhyAddress = LAN8742A_PHY_ADDRESS;
..

Hi Max ,

Thank you for your response ,I checked the STM32duino forum and they mentions the ethernet doesn’t support currently.
But even after adding the interrupt to the main for wifi101 with no compile errors and when i upload the code to the H743ZI board, still it doesn’t work .Not sure if its something to do with the SPI as well .

If you’re on a nucleo you have the STLink debugger on board, so PlatformIO’s unified debugger works out of the box with it. You can step through the library code to see what it’s doing.

Also the Wifi101 library has debug prints which you can activate by writing

build_flags = -DCONF_WINC_DEBUG=1 -DCONF_WINC_PRINTF=printf -DM2M_LOG_LEVEL=M2M_LOG_DBG

in the platformio.ini. (Yes there’ll be a dozen warnings for not including stdio.h first but there’s no nice way to do that without changing library code and it will compile).

That should give further hints.

Thank you ! I just ran the debug the f429ZI gives the following messages ,

(APP)(INFO)Chip ID 1503a0
(APP)(INFO)DriverVerInfo: 0x13521352
(APP)(INFO)Firmware ver   : 19.6.1 Svnrev 16761
(APP)(INFO)Firmware Build May 23 2018 Time 14:39:16
(APP)(INFO)Firmware Min driver ver : 19.3.0
(APP)(INFO)Driver ver: 19.5.2
(APP)(INFO)Driver built at Feb  2 2021  18:52:05
(APP)(ERR)[hif_isr][587](hif) host app didn't set RX Done <5><6>

and the board H743 stuck after the following message

(APP)(INFO)Chip ID fff5ffff

Is this related to SPI issue ? or the interrupt ?

Also seems like when compile ,the board RAM shows 512k instead of 1M ,I think I may need to switch to a different board since this board is not fully compliant with the Arudino core .

Thank you !

Hm maybe the interrupt wasn’t actually fired or the implementation / filler for attachInterruptMultiArch is wrong. You should add more debugging there and see where in the library its called and what target function it is supposed to be reached, then set a breakpoint there and see if it is actually reached in the debugger. You can then also recheck the interrupt pin is correct and the wireup matches. Generally, dig deeper when exactly that error message is thrown in the driver and what is supposed to happen before that, and then figure out why that doesn’t happen before.

Hi Max ,

It seems like I have the H743ZI2 variant ,so there are some differences in H743ZI and H743ZI2 .
https://github.com/stm32duino/Arduino_Core_STM32/blob/master/variants/NUCLEO_H743ZI/variant.h
Also the SPI doesn’t work at all everything else works .I.E digital I/O,UART,I2C…
Unfortunately I couldn’t find a Nucleo board with H743ZI ( which is not the revision V )
since its been discontinued on Digikey/Mouser
So hope that PlatformIO will do the changes to support H743ZI2 in the future .Also when I compile it shows 512kb RAM which should be 1M RAM .
Anyhow I will keep this board aside for now for our testing and switch to F767Zi which comes with 512K RAM .

Thanks,
Samson.

Fixed the issue by re-defining the pins .Since H743ZI/H743ZI2 pin maps are different, need to re-define pins on the Wifi101 library.
on the nm_bus_wrapper_samd21.cpp have to define ,

//#if !defined(WINC1501_SPI)
 SPIClass SPI_1(PB5, PA6, PA5);
  #define WINC1501_SPI SPI_1
//#endif

Also on the WiFi.setPins instead of using the default Arduino pin config which is
WiFi.setPins(8,7,4);

I re-defined ,
WiFi.setPins(PE11,PE15,PF3);

Wish the wifi101 had a API to do the SPI config on the main instead of doing it on the
nm_bus_wrapper_samd21.cpp
Still I will not use this board since the on board ethernet having issues .

Thanks,
Samson.

1 Like