Skip to main content
Visitor II
March 23, 2024
Solved

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

  • March 23, 2024
  • 3 replies
  • 2323 views

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

    This topic has been closed for replies.
    Best answer by mƎALLEm

    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.

    3 replies

    Technical Moderator
    March 23, 2024

    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 

    Visitor II
    March 23, 2024

    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 ? 

    mƎALLEmAnswer
    Technical Moderator
    March 23, 2024

    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.

    Super User
    March 23, 2024

    @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.

     

    Visitor II
    March 26, 2024

    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 ?
    Explorer
    April 8, 2024

    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,