cancel
Showing results for 
Search instead for 
Did you mean: 

stm32H745i-disco board lwip + freertos + stmcubemx 6.10 code generation guide

khodifadlalit
Associate II

i wand to work on ethernet of stm32H745i disco board , i need to generate code  lwip + freertos using tool

stm32cubemx version 6.10.0 please give simple demo working project that generated by stm32cubemx version 6.10.0

or guide me how to enable lwip and freertos and ethernet driver for stm32H745i-disco board. please help me

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

Have a look at this link on how to create a project for STM32H7 with Ethernet and LwIP stack.

Look at this github link.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
STTwo-32
ST Employee

Hello @khodifadlalit 

I suggest you to take a look at the examples using the STM32H745i-DISCO in this github repository. You can also refer to this FAQ.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks for reply

this example code made by stmcubemx 6.9.0 tool. i use  stmcubemx 6.10.0 i need to  generate code using  stmcubemx 6.10.0 , this possible ? i generate code stmcubemx 6.10.0 not work, please help what change required ? 

Hello,

Have a look at this link on how to create a project for STM32H7 with Ethernet and LwIP stack.

Look at this github link.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Pavel A.
Evangelist III

@khodifadlalit Please begin from the example advised by SofLit, exactly as is

Do not change anything or re-generate code in "configuration tool", until you get this example working. At least, responding to ping.

 

thanks for help

above link is 

example advised by SofLit, working for ping.

i generate the code using stm32cubemx version 6.10.0 and and change flash.ld file as below

/* ETH_CODE: add placement of DMA descriptors and RX buffers */
.lwip_sec (NOLOAD) :
{
. = ABSOLUTE(0x30040000);
*(.RxDecripSection)

. = ABSOLUTE(0x30040100);
*(.TxDecripSection)

. = ABSOLUTE(0x30040200);
*(.Rx_PoolSection)
} >RAM_D2

than generate code ping  successfully .

than i want to move forward for send message using UDP i add  

  • Add following include files at the beginning of main.c:
#includelwip/udp.h#include <string.h>
 
  • Modify the StartDefaultTask in main.c with the following code:
/* USER CODE BEGIN 5 */
const char* message = "Hello UDP message!\n\r";

osDelay(1000);

ip_addr_t PC_IPADDR;
IP_ADDR4(&PC_IPADDR, 192, 168, 1, 1);

struct udp_pcb* my_udp = udp_new();
udp_connect(my_udp, &PC_IPADDR, 55151);
struct pbuf* udp_buffer = NULL;

/* Infinite loop */
for (;;) {
  osDelay(1000);
  /* !! PBUF_RAM is critical for correct operation !! */
  udp_buffer = pbuf_alloc(PBUF_TRANSPORT, strlen(message), PBUF_RAM);

  if (udp_buffer != NULL) {
    memcpy(udp_buffer->payload, message, strlen(message));
    udp_send(my_udp, udp_buffer);
    pbuf_free(udp_buffer);
  }
}
/* USER CODE END 5 */ but that not work
Please help ?

thanks for help

above link is

example advised by SofLit, working for ping.

i generate the code using stm32cubemx version 6.10.0 and and change flash.ld file as below

/* ETH_CODE: add placement of DMA descriptors and RX buffers */
.lwip_sec (NOLOAD) :
{
. = ABSOLUTE(0x30040000);
*(.RxDecripSection)

. = ABSOLUTE(0x30040100);
*(.TxDecripSection)

. = ABSOLUTE(0x30040200);
*(.Rx_PoolSection)
} >RAM_D2

than generate code ping successfully .

than i want to move forward for send message using UDP i add

Add following include files at the beginning of main.c:
#include “lwip/udp.h”
#include <string.h>

Modify the StartDefaultTask in main.c with the following code:
/* USER CODE BEGIN 5 */
const char* message = "Hello UDP message!\n\r";

osDelay(1000);

ip_addr_t PC_IPADDR;
IP_ADDR4(&PC_IPADDR, 192, 168, 1, 1);

struct udp_pcb* my_udp = udp_new();
udp_connect(my_udp, &PC_IPADDR, 55151);
struct pbuf* udp_buffer = NULL;

/* Infinite loop */
for (;;) {
osDelay(1000);
/* !! PBUF_RAM is critical for correct operation !! */
udp_buffer = pbuf_alloc(PBUF_TRANSPORT, strlen(message), PBUF_RAM);

if (udp_buffer != NULL) {
memcpy(udp_buffer->payload, message, strlen(message));
udp_send(my_udp, udp_buffer);
pbuf_free(udp_buffer);
}
}
/* USER CODE END 5 */ but that not work
Please help ?

LinasSt
Associate

Similar issue I have on the board with Mx version 6.11.0. not possible to set FREERTOS in LWIP. NO_SYS = OS Not Used. On older version the project was generated successfully. I do not know from which version it happened. After latest update I needed to config ioc file and got this issue,