eclipse-threadx / netxduo

Eclipse ThreadX - NetXDuo is an advanced, industrial-grade TCP/IP network stack designed specifically for deeply embedded real-time and IoT applications
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/netx-duo/index.md
MIT License
230 stars 131 forks source link

Getting hardfault in _nx_packet_release function #194

Closed kaushaleinfo closed 6 months ago

kaushaleinfo commented 9 months ago

Hi all, I am using stm32f205 mcu and using threadx, netx 6.2 version, Random time I am getting hardfault from _nx_packet_release so I did depth debugging and found where exact it is generating hardFault, So it is generating while / Update the links of the adjacent threads. / in _nx_packet_release function,

/ Determine if there are any threads suspended on the block pool. / thread_ptr = pool_ptr -> nx_packet_pool_suspension_list; if (thread_ptr) { / Remove the suspended thread from the list. /

        /* See if this is the only suspended thread on the list.  */
        if (thread_ptr == thread_ptr -> tx_thread_suspended_next)
        {

            /* Yes, the only suspended thread.  */

            /* Update the head pointer.  */
            pool_ptr -> nx_packet_pool_suspension_list =  NX_NULL;
        }
        else
        {

            /* At least one more thread is on the same expiration list.  */ 

            /* Update the list head pointer.  */
            pool_ptr -> nx_packet_pool_suspension_list =  thread_ptr -> tx_thread_suspended_next;

----------->>>> from below line code it is generating a hardFault, <<<<------------------

            **/* Update the links of the adjacent threads.  */
            (thread_ptr -> tx_thread_suspended_next) -> tx_thread_suspended_previous =
                thread_ptr -> tx_thread_suspended_previous;**

Mostly it is generating after discover DHCP packet, Could you guys tell me why this is happening or where should I look?

TiejunMS commented 7 months ago

It sounds like memory corruption or illegal usage of packet. Could you try to disable all logics from application and run DHCP only? See if the problem is still there.

TiejunMS commented 6 months ago

Closing as no response.