lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] freertos + lwip = no uart ?


From: unnamed
Subject: Re: [lwip-users] freertos + lwip = no uart ?
Date: Sat, 1 Aug 2015 14:33:38 -0700 (MST)

hi again, so after a couple of days fighting with raw lwip porting i'am stuck again, but i did some progress. Right now i can complie and init lwip with basic project on xmega with enc28j60. Uart works, debug messages work :)

But as soon as my project is bigger than 41.50% of my flash memory everything stops working, why is that ?
After flashing with my programmer i get "0xD600 bytes written into 0x20000 bytes memory (41.80%)." - whole program stops working but when i remove some portions of my code (not importan code) and i get for example
0xD000 bytes written into 0x20000 bytes memory (40.62%). - everything starts to work (or at least i think so) i get on my console:

netif_set_ipaddr: netif address being changed
netif: IP address of interface  set to 192.168.0.110
netif: netmask of interface  set to 255.255.255.0
netif: GW address of interface  set to 192.168.0.1
Starting mchdrv_init.
Driver initialized
netif: added interface  IP addr 192.168.0.110 netmask 255.255.255.0
netif: setting default interface
encWBMencWBM2transmitted. 44 00 c0 00 44 00 00
sent 44 bytes.
mchinitdone
httpdinit

end later i get some info from my driver, looks like this:
read with header (00 e2) db 00 c0 03.
incoming: 1 packages, first read into 3b2f
received with result 0

what can be the cause of that behaviour ?

thanks for any help, last posts were a lot of help and i'am starting to figure some things out - lwip is not easy for a begginer like me :)


2015-07-28 22:23 GMT+02:00 Krzysztof Wesołowski [via lwIP] <[hidden email]>:
Hello,

first thing first - i have no experience with XMEGA, but have learned many things about  STM32 - sometimes the hard way :)

If adding LWIP without initialization (you written it is only compiled, not initialized, so basically adding global variables (sections .data /.bss) and not called code (sections .text)) alters your system behavior IMHO you are in realatively deep "voodo programming", and not tracking root of the problem would probably "hit you later".

Teoretically adding new code can also replace so called "weak references" to interrupt handlers (so for example addin LWIP can change ETH IRQ handler), but if this IRQ is disabled it shoudl not change anything.

Are you using debugger so you can track values in variables/registers to check UART registers when app is not working??

Are you sure your linker script has correctly configured memory areas (if so extra variables will cause link time section overflow information, if linker has bigger memories than MCU some variables are not actually store'able/readable).

If you use dynamic memory allocation are you sure that:
a) there is enough memory in FreeRTOS heap?
b) if other parts of code (linke printf) call malloc do you use wrapper redirecting malloc to FreeRTOS heap / are you sure that you malloc implementation is ok and works with linker script?

I have also have seen some linker scripts where heap is happily growing from other end of RAM (and _sbrk and malloc are used), waiting from stacks to come other way - it is rather ticking timebomb :)

Do you have ASSERT configured in FreeRTOS so you can detect misconfigurations?

Basically there is 98% chance (2% is for you calling LWIP without knowing) that at the moment UART is working "by luck/accident" :)

Regards,
Krzysztof Wesołowski

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users


If you reply to this email, your message will be added to the discussion below:
http://lwip.100.n7.nabble.com/freertos-lwip-no-uart-tp24724p24742.html
To unsubscribe from freertos + lwip = no uart ?, click here.
NAML



View this message in context: Re: freertos + lwip = no uart ?
Sent from the lwip-users mailing list archive at Nabble.com.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]