cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get Ethernet working on STM32H745 DISCOVERY BOARD using AZURE RTOS (THREADX) and NETX

HKapo.1
Associate III

Hello All,

I am trying to create a simple project for transmitting some UDP packet but it is not working.

I have used STM32cube to generate the project with below configuration:

Change Timebase to TIM6

0693W00000GVsksQAD.png 

Setup the MPU and enable D and I Cache

0693W00000GVsjvQAD.png 

Selected below middleware

0693W00000GVscRQAT.pngChanged the linker script

     .tcp_sec (NOLOAD) : {
 
    . = ABSOLUTE(0x30040000);
    *(.RxDecripSection)
 
    . = ABSOLUTE(0x30040060);
    *(.TxDecripSection)
 
  } >RAM_D2 AT> FLASH
 
  
.nx_data 0x30040200 (NOLOAD):
 {
   *(.NetXPoolSection)
 
 } >RAM_D2 AT >FLASH   

   Added below code to app_netx_duo.c

  /* Create the main NX_IP instance */
  IpAddress = IP_ADDRESS(10, 10, 1, 56);
  ret = nx_ip_create(&IpInstance, "Main Ip instance", IpAddress, 0xFFFFFF00UL, &AppPool, nx_stm32_eth_driver,
                     pointer, 2 * DEFAULT_MEMORY_SIZE, DEFAULT_PRIORITY);
 
  if (ret != NX_SUCCESS)
  {
    return NX_NOT_ENABLED;
  }
 
  /* Allocate the memory for ARP */
  if (tx_byte_allocate(byte_pool, (VOID **) &pointer, DEFAULT_MEMORY_SIZE, TX_NO_WAIT) != TX_SUCCESS)
  {
    return TX_POOL_ERROR;
  }
 
  /* Enable the ARP protocol and provide the ARP cache size for the IP instance */
  ret = nx_arp_enable(&IpInstance, (VOID *)pointer, DEFAULT_MEMORY_SIZE);
 
  if (ret != NX_SUCCESS)
  {
    return NX_NOT_ENABLED;
  }
 
  /* Enable the ICMP */
  ret = nx_icmp_enable(&IpInstance);
 
  if (ret != NX_SUCCESS)
  {
    return NX_NOT_ENABLED;
  }
//#ifdef NEVER
  /* Enable the UDP protocol required for  DHCP communication */
  ret = nx_udp_enable(&IpInstance);
 
  /* Allocate the memory for main thread   */
  if (tx_byte_allocate(byte_pool, (VOID **) &pointer,2 *  DEFAULT_MEMORY_SIZE, TX_NO_WAIT) != TX_SUCCESS)
  {
    return TX_POOL_ERROR;
  }
 
 
  /* Allocate the memory for UDP client thread   */
  if (tx_byte_allocate(byte_pool, (VOID **) &pointer,2 *  DEFAULT_MEMORY_SIZE, TX_NO_WAIT) != TX_SUCCESS)
  {
    return TX_POOL_ERROR;
  }
  /* create the UDP client thread */
  ret = tx_thread_create(&AppUDPThread, "App UDP Thread", App_UDP_Thread_Entry, 0, pointer, 2 * DEFAULT_MEMORY_SIZE,
                         DEFAULT_PRIORITY, DEFAULT_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START);
 
  if (ret != TX_SUCCESS)
  {
    return NX_NOT_ENABLED;
  }

I have created a static IP address rather than dynamic IP address. Also changed my PC IP Address similarly.

If I try using freertos and LWIP then it all works suggesting that link to board and PC are fine.

Can you please suggest if I am missing anything.

Kind Regards

1 REPLY 1

Hello @Community member​ 

Could you, please, provide the code for the task that handles the UDP communication?

Thanks in advance.

BeST Regards,

Walid