cancel
Showing results for 
Search instead for 
Did you mean: 

LwIP + FreeRTOS not working on STM32F746

RCont.1
Associate II

Hello folks!

I have a STM32F746 MCU on my custom board and I'm trying to get the LwIP + FreeRTOS stack to work, especially the netconn tcp_echo_server example.

It's not a hardware related problem, because the same HW has been used on another board (STM32F2 and STM32F3) and everything works fine. It must be a software problem but I can't figure out what it is.

I simply generated the code with the STM32CubeIDE, copied the example from the repository and started the application. This worked on the other board (STM33F2 and STM33F3) but not in this one (STM32F746).

Looking at the example of the repository, there are some differences compared to the generated code, especially regarding the addressing of the DMA buffers as follow.

...._RAM.ld
 
/* GENERATED CODE */
 
MEMORY
{
  RAM      (xrw)   : ORIGIN = 0x20000000, LENGTH = 320K  
  FLASH    (rx)    : ORIGIN = 0x08000000, LENGTH = 512K
}
 
/* EXAMPLE CODE */
 
MEMORY
{
  RAM      (xrw)   : ORIGIN = 0x20000000, LENGTH = 307K
  FLASH    (rx)    : ORIGIN = 0x08000000, LENGTH = 512K
  Memory_B1(xrw)   : ORIGIN = 0x2004C000, LENGTH = 0x80
  Memory_B2(xrw)   : ORIGIN = 0x2004C080, LENGTH = 0x80
  Memory_B3(xrw)   : ORIGIN = 0x2004C100, LENGTH = 0x17D0 
  Memory_B4(xrw)   : ORIGIN = 0x2004D8D0, LENGTH = 0x17D0 
}
 
  .RxDescripSection (NOLOAD) : { *(.RxDescripSection) } >Memory_B1
  .TxDescripSection (NOLOAD) : { *(.TxDescripSection) } >Memory_B2
  .RxarraySection   (NOLOAD) : { *(.RxBUF) } >Memory_B3
  .TxarraySection   (NOLOAD) : { *(.TxBUF) } >Memory_B4

ethernetif.c
 
/* GENERATED CODE */
 
#if defined ( __ICCARM__ ) /*!< IAR Compiler */
  #pragma data_alignment=4
#endif
__ALIGN_BEGIN ETH_DMADescTypeDef  DMARxDscrTab[ETH_RXBUFNB] __ALIGN_END;/* Ethernet Rx MA Descriptor */
 
#if defined ( __ICCARM__ ) /*!< IAR Compiler */
  #pragma data_alignment=4
#endif
__ALIGN_BEGIN ETH_DMADescTypeDef  DMATxDscrTab[ETH_TXBUFNB] __ALIGN_END;/* Ethernet Tx DMA Descriptor */
 
#if defined ( __ICCARM__ ) /*!< IAR Compiler */
  #pragma data_alignment=4
#endif
__ALIGN_BEGIN uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __ALIGN_END; /* Ethernet Receive Buffer */
 
#if defined ( __ICCARM__ ) /*!< IAR Compiler */
  #pragma data_alignment=4
#endif
__ALIGN_BEGIN uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __ALIGN_END; /* Ethernet Transmit Buffer */
 
****************************************************************
 
/* EXAMPLE CODE */
 
ETH_DMADescTypeDef  DMARxDscrTab[ETH_RXBUFNB] __attribute__((section(".RxDescripSection")));/* Ethernet Rx DMA Descriptors */
 
ETH_DMADescTypeDef  DMATxDscrTab[ETH_TXBUFNB] __attribute__((section(".TxDescripSection")));/* Ethernet Tx DMA Descriptors */
 
uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __attribute__((section(".RxarraySection"))); /* Ethernet Receive Buffers */
 
uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __attribute__((section(".TxarraySection"))); /* Ethernet Transmit Buffers */

The "application" code, is exactly the same as in the netconn tcp_echo_server example

Is there anyone who managed to use the LwIP stack on this MCU STM32F746?

Tnx.

11 REPLIES 11

While waiting for more helpful replies, you can look for help with your project here.

 

Hello sir

 

Please guide me how to make TCP working on stm32f746 discovery, even I am struggling to make it work for days.
Any inputs are highly appreciated, I am a beginner in embedded systems.

 

Thankyou.