Problem about porting TCP/IP Stack

Christian Mauderer christian.mauderer at embedded-brains.de
Fri Mar 27 15:27:57 UTC 2020


On 27/03/2020 15:58, jameszxj wrote:
> Hi all,
>         Since rtems-libbsd is too heavy for our project, so I tried to
> port Lightweight TCP/IP stacks.  First I tried lwip, it worked but
> crashed now and then.
> The PC pointed at function _Heap_Block_split(),I could not figure it
> out. So I tried cycloneTCP . It is more simple than lwip.  But I
> encountered the same problem.
> System still crashed at _Heap_Block_split() sometimes (random),  It made
> me crazy :(
>        I tried on diffrent CPUs (zynq7020, sunxi-t3), the problem was
> still there.  _Heap_Block_split() is a core function, It seems to have
> nothing to do with the stack.
> Attachments are error messages and disassembly code. Any advices?
>        Thanks.
> 
> 
> 

Hello,

I'm quite sure that I've seen some mails regarding lwIP. So there should
be already users for that.

Without having a detailed look at the crash message: If there are
problems with the heap you might want to use

    --enable-rtems-debug

during RTEMS configure and maybe add

    #define CONFIGURE_STACK_CHECKER_ENABLED

to your configuration. Problems with the heap can be from some part of
the application writing over the end of a buffer or similar. If that
destroys heap structures, you might get problems as soon as RTEMS want's
to do something with the heap. The rtems_debug enables quite a lot of
run time checks like a heap protection. That can help finding the bug.

Note that you have to re-build all libraries after you enable or disable
rtems-debug because some data structures change with that.

Best regards

Christian
-- 
--------------------------------------------
embedded brains GmbH
Herr Christian Mauderer
Dornierstr. 4
D-82178 Puchheim
Germany
email: christian.mauderer at embedded-brains.de
Phone: +49-89-18 94 741 - 18
Fax:   +49-89-18 94 741 - 08
PGP: Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


More information about the devel mailing list