We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I cannot connect Ethernet in Keil µVision V5.42 and NUCLEO-H753ZI.
There is no response for ARP or Ping.
How do I connect NUCLEO-H753ZI to a PC via Ethernet in Keil RTX5?
Have I forgotten to configure something?
This environment is as follows.
Board : NUCLEO-H753ZI (CPU:STM32H753ZI)
IDE : µVision V5.42.0.0
Compiler : ARM Compiler v6
RTOS : Keil RTX5
Others : STM32CubeMX Ver.6.15.0
I have done as follows:
1. µVision Pack Install
ARM::CMSIS ver.6.2.0
ARM::CMSIS-Driver ver.2.10.0
ARM::CMSIS-Driver_STM32 ver.1.2.0
ARM::CMSIS-RTX ver.5.9.0
Keil::MDK-Middleware ver.8.1.0
Keil::STM32H7xx_DFP ver.4.1.0
2. µVision RTE
"CMSIS -> CORE (ver.6.1.1)" Enabled
"CMSIS -> RTOS2 (API) -> Keil RTX5 (ver.5.9.0)" Enabled
"CMSIS Driver -> Ehternet MAC (API) -> Ethernet MAC (ver.3.1.0)" Enabled
"CMSIS Driver -> Ehternet PHY (API) -> LAN8742A (ver.1.3.0)" Enabled
"Device -> CobeMX (Ver.1.0.0)" Enabled (For details, see Chapter 3,4,5. STM32CubeMX)
"Network -> CORE (ver.8.1.0)" Enabled
"Network -> Interface -> ETH" to 1
"Network -> Socket -> TCP" Enabled
"Network -> Socket -> UDP" Enabled
3. STM32CubeMX "Pinout & Configuration" Tab
"Connectivity -> ETH"
"Mode" to RMII
"GPIO Settings"
PA1 ETH_REF_CLK
PA2 ETH_MDIO
PA7 ETH_CRS_DV
PB13 ETH_TXD1
PC1 ETH_MDC
PC4 ETH_RXD0
PC5 ETH_RXD1
PG11 ETH_TX_EN (Not default)
PG13 ETH_TXD0 (Not default)
"Parameters Settings" (by default)
Ethernet MAC Address : 00:80:E1:00:00:00
Tx Descriptor Length : 4
First Tx Descriptor Address : 0x30000080
Rx Descriptor Length : 4
First RX Descriptor Address : 0x30000000
Rx Buffers Address : 0x30000100
Rx Buffers Length : 1536
"NVIC Settings"
Ethernet global interrupt : Enabled
"System Core -> CORETEX_M7"
MPU Control Mode : MPU NOT USED
"System Core -> GPIO"
Maximum output speed : I set Maximum output speed of All GPIO to High.
"System Core -> NVIC -> Code generation"
System service call via SWI instruction : Generate IRQ handler : Disabled
Pendable request for system service : Generate IRQ handler : Disabled
Time base : System tick timer : Generate IRQ handler : Disabled
4. STM32CubeMX "Clock Configuration" Tab
"To CPU Clocks (MHz)/ To CPU Systick Clock (MHz)" is 400MHz.
Peripheral clocks is 200MHz or 100MHz.
5. STM32CubeMX "Project Manager" Tab
"Project" Tab
Toolchain/IDE to MDK-ARM, Min Version to V5.32
6. Do "GENERATE CODE"
7. RTX Configuration (RTX_Config.h)
"Thread Configuration -> Default Thread Stack size [bytes]" to 4096 (4K)
Others are default.
8. Net Configuration (Net_Config.h)
"Network Core -> Variant" to IPv4 only
9. Net(ETH0) Configuration (Net_Config_ETH_0.h)
"Ethernet Network Interface 0 -> Dynamic Host Configuration" Disabled
"Ethernet Network Interface 0 -> Dynamic Host IPv6" Disabled
Others are default. ETH0 is ip address 192.168.0.100, mask 255.255.255.0, gateway 192.168.0.254.
10. Option for Target
"Option for Target -> C/C++ (AC6) -> Language C" to C11
"Option for Target -> C/C++ (AC6) -> Short enums/wchar" Disabled
"Option for Target -> Linker -> Use Memory Layout from Target Dialog" Disabled
Modify Scatter File.
LR_IROM1 0x08000000 0x00100000 { ; load region size_region ER_IROM1 0x08000000 0x00100000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) .ANY (+XO) } RW_IRAM2 0x24000000 0x00080000 { ; RW data .ANY (+RW +ZI) } RW_DMARxDscrTab 0x30000000 0x00000080 { ; RW data *(.RxDescripSection) } RW_DMATxDscrTab 0x30000080 0x00000080 { ; RW data *(.TxDescripSection) } RW_Rx_Buff 0x30000100 0x00000F00 { ; RW data *(.RxArraySection) } }
"Option for Target -> Debug -> Use" To ST-Link Debugger
11. Add code in Main.c
Add Includes
/* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "cmsis_os2.h" #include "rl_net.h" /* USER CODE END Includes */
Add USER CODE 2
/* Initialize all configured peripherals */ MX_GPIO_Init(); MX_ETH_Init(); /* USER CODE BEGIN 2 */ SystemCoreClockUpdate(); osKernelInitialize(); netInitialize(); osKernelStart(); /* USER CODE END 2 */
12. Setup Windows PC
ip address 192.168.0.10, mask 255.255.255.0, gateway {empty}
In this environment, when I send "arp -a" or "ping 192.168.0.100" from a Windows PC, I get no response...
Thank you for coming back to share the solution you found!