Skip to main content
Joerg Wagner
Senior III
January 4, 2018
Solved

STM32H743 CubeMX 4.23.0 FreeRTOS LwIP (UDP) hangs

  • January 4, 2018
  • 1 reply
  • 755 views
Posted on January 04, 2018 at 12:09

Hello.

I have a simple SW4STM32 project just using FreeRTOS and LwIP on NUCLEO-H743ZI.

Initialize UDP in a task with:

  struct netconn *conn_udp;

  conn_udp = netconn_new(NETCONN_UDP);

FreeRTOS hangs forever in portmacro.h:

portFORCE_INLINE static void vPortRaiseBASEPRI( void )

{

uint32_t ulNewBASEPRI;

    __asm volatile

    (

        '    mov %0, %1                                                \n'    \

        '    cpsid i                                                    \n' \

        '    msr basepri, %0                                            \n' \

        '    isb                                                        \n' \

        '    dsb                                                        \n' \

        '    cpsie i                                                    \n' \

        :'=r' (ulNewBASEPRI) : 'i' ( configMAX_SYSCALL_INTERRUPT_PRIORITY )

    );

}

.data/.bss are in D1 domain, ETH Descriptors are in D2 domain, RMII GPIO Pins corrected,

no DCACHE (   //SCB_CleanInvalidateDCache(); in ethernetif.c ), MPU is configured

I had so many 'Hard Faults' during  MX_LWIP_Init(); in a similar project, concerning FreeRTOS (semaphores, mutexes)

My advice: Do not use CubeMX 4.23.0 with NUCLEO-H743ZI or you love to kill time.

PS: I can provide the project files if someone is interested.

    This topic has been closed for replies.
    Best answer by Joerg Wagner
    Posted on January 08, 2018 at 23:20

    This my bad.

    I guess I converted a NO_SYS project into RTOS.

    In MX_LWIP_Init() was a

      /* Initilialize the LwIP stack without RTOS */

      lwip_init();

    but it must be

      /* Initilialize the LwIP stack with RTOS */

      tcpip_init( NULL, NULL );

    Sorry.

    1 reply

    Joerg Wagner
    Joerg WagnerAuthorBest answer
    Senior III
    January 8, 2018
    Posted on January 08, 2018 at 23:20

    This my bad.

    I guess I converted a NO_SYS project into RTOS.

    In MX_LWIP_Init() was a

      /* Initilialize the LwIP stack without RTOS */

      lwip_init();

    but it must be

      /* Initilialize the LwIP stack with RTOS */

      tcpip_init( NULL, NULL );

    Sorry.