2018-07-13 09:06 AM
Hi guys,
I have recently started to work with Keil uVision and I am porting my code that I have previously coined with SW4STM32. I bumped into some problems with the network component (I would like to switch from previously used LwIP to keil’s network implementation, so I need to rewrite this part). Fore some reason only reception works but board does not respond with anything. I work with NUCLEO 144 and STM32H743IT. Here I give you the description of how I included a network component into a default project and my minimal implementation to start the network interface with IPv4. Then I describe the problem more closely, also the debug log is attached.I use cubeMX API for peripherals configuration and have done following things:In “STM32Cube Framework (API)� -> CubeMX enabled ETH perhiperal and configured it like in
, that is: RMII mode, in configuration parameters I left default MAC 00:80:E1:00:00:00 and TX/RX descriptors, from 0x30040000 and on. Rx buffer length 1524 (default), I enabled global ETH interrupt. In GPIO all pins speed set to high, only PC1 (ETH_MDC) to low (high is not available for some reason). Chip is running at 400MHz and peripherals are running at either 200 or 100Mhz. I generated the project files. *_hal_eth.c and *_hal_eth_ex.c as well as IT, MSP and other core files are generated.
http://www.keil.com/pack/doc/mw/Network/html/nw_resource_requirements.html
259 371.999350 AsustekC_ac:66:3f Broadcast ARP 42 Who has 192.168.137.10? Tell 192.168.137.2
, then I see that that the chip executes SendFrame (EMAC_STM32H7xx.c) and the transfer complete HAL_ETH_TxCpltCallback (stm32h7xx_hal_eth.c) is called afterwards but no data ever reaches my host (nor does eth transmit diode blink). Other than during my ping attempt, these functions are never called.
I would be glad for some insights on what could I be missing. Btw. Hardware interface, cables etc. etc. are ok, as my “old� code works well on the same board.Thanks,JeremiKey parts of main:#include 'main.h'
#include 'stm32h7xx_hal.h'#include 'string.h'/* USER CODE BEGIN Includes */
#include 'cmsis_os2.h' // ::CMSIS:RTOS2#include 'rl_net.h'__attribute__((at(0x30040000))) ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT];
__attribute__((at(0x30040060))) ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT];__attribute__((at(0x30040200))) uint8_t Rx_Buff[ETH_RX_DESC_CNT][ETH_MAX_PACKET_SIZE];ETH_TxPacketConfig TxConfig;ETH_HandleTypeDef heth;
void SystemClock_Config(void);
static void MX_GPIO_Init(void);static void MX_ETH_Init(void);uint32_t tcp_cb_server (int32_t socket, netTCP_Event event,
const NET_ADDR *addr, const uint8_t *buf, uint32_t len);__NO_RETURN void LED_Thread (void *argument) {
netInitialize ();
uint8_t ip4_addr[NET_ADDR_IP4_LEN];
char ip_ascii[40]; for (;;) { osDelay(1000); HAL_GPIO_TogglePin(LD1_GPIO_Port, LD1_Pin);netIF_GetOption (NET_IF_CLASS_ETH | 0, netIF_OptionIP4_Address, ip4_addr, sizeof (ip4_addr));
netIP_ntoa (NET_ADDR_IP4, &ip4_addr[0], ip_ascii, sizeof (ip_ascii));
printf ('Current IP address: %s\n', ip_ascii); }}int main(void)
{osKernelInitialize(); HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_ETH_Init(); osThreadNew(LED_Thread, NULL, NULL); osKernelStart(); while (1){}}
Debug console:
000.0 SYS:Network 7.9.0000.0 SYS:Init system000.0 MEM:Init MemPool 12000 bytes000.0 MEM: Limit0=9000, Limit1=6000 bytes000.0 ETH:Init interface000.0 ETH:MAC (1E-30-6C-A2-45-5E)000.0 ARP:Init Cache, 10 entries000.0 LOOP:Init interface000.0 IP4:Init IPv4 core000.0 ICMP:Init Client000.0 IGMP:Init Table, 5 entries000.9 SYS:GetOption ETH, IP4-AddrCurrent IP address: 192.168.137.10001.9 ETH:Link up001.9 ETH: 100M, Full duplex001.9 MEM:Alloc 72 bytes001.9 MEM: Used 72 bytes (1 blocks)001.9 MEM:Free 72 bytes001.9 MEM: Used 0 bytes (0 blocks)001.9 ARP:Send_Request001.9 MEM:Alloc 56 bytes001.9 MEM: Used 56 bytes (1 blocks)001.9 ARP: Opcode ARP-REQUEST001.9 ARP: SendIp 192.168.137.10001.9 ARP: TargIp 192.168.137.10001.9 ARP: SendMac 1E-30-6C-A2-45-5E001.9 ARP: TargMac 00-00-00-00-00-00001.9 MEM:Free 56 bytes001.9 MEM: Used 0 bytes (0 blocks)001.9 SYS:GetOption ETH, IP4-AddrCurrent IP address: 192.168.137.10002.0 MEM:Alloc 72 bytes002.0 MEM: Used 72 bytes (1 blocks)002.0 ETH:*** Processing frame ***002.0 ETH: DstMAC FF-FF-FF-FF-FF-FF002.0 ETH: SrcMAC D0-17-C2-AC-66-3F002.0 ETH: Proto ARP, 60 bytes002.0 ARP:*** Processing frame ***002.0 ARP: Opcode ARP-REQUEST002.0 ARP: SendIp 0.0.0.0002.0 ARP: TargIp 192.168.137.2002.0 ARP: SendMac D0-17-C2-AC-66-3F002.0 ARP: TargMac 00-00-00-00-00-00002.0 ARP: Discarded, SendAddr invalid002.0 MEM:Free 72 bytes002.0 MEM: Used 0 bytes (0 blocks)2018-08-08 02:07 PM
Can't help you, bumping you off my feed
2018-09-11 12:29 AM
Hi, have you had a look at the Linker scatter file used in the STM32H7 Nucleo 144 ethernet demo file.
I copied this in my project and that fixed it.
RJG
2021-03-24 07:21 AM
Hello,
I am facing the same problem with H723. Have you been able to solve the problem. Could you describe what solved it please ?
Thanks
Frank