|
From: | Noam Weissman |
Subject: | Re: [lwip-users] freertos + lwip = no uart ? |
Date: | Tue, 28 Jul 2015 15:54:09 +0300 |
Hi, I am not familiar with atxmega128a3u so I hope my input here will help and not confuse you. I never had problems with UARTS but I did have problems with LwIP when interrupts priorities were not defined properly versus the FreeRTOS interrupt. 1. Check that your interrupts are configured properly meaning the TCP stack cannot have a priority higher than the FreeRTOS !! The following are my settings, these are for STM32F4xx a an M-Cortex micro Check the following (if this applicable for your cpu): /* The lowest interrupt priority that can be used in a call to a "set priority" function. */ #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xF /* The highest interrupt priority that can be used by any interrupt service routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER PRIORITY THAN THIS! (higher priorities are lower numeric values. */ #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 /* Interrupt priorities used by the kernel port layer itself. These are generic to all Cortex-M ports, and do not rely on any particular library functions. */ #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) #define ETH_ISR_PRIO (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY + 5) #define IR_TIMERS_ISR_PRIO (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY + 2) #define SERIAL_ISR_PRIO (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY + 1) 2. I have seen that your micro is 8 bit and has just 8KB of RAM ?... how much is for the OS and how much for LwIP ??? ---------------------------------------------------------------------------------------------- I was able to run only FreeRTOS on a micro with just 10K … how do you ran the OS and LwIP With only 8K ??? BR, Noam. From: address@hidden [mailto:address@hidden On Behalf Of unnamed about memory - i need more time to check that, .map file is confusing for me right now and i don't know how to check it and be 100% sure i'am right :) must read some tutorials first :) for uart i tested like 3 approaches found on internet 1 interrupt based is from here 2 no interrupts, function names like in above examples, pretty unique i think usartBufferPutString(), PrintChar(), nothing like send() 3 right now i'am using printf() for every uart message (prinf linked to function PrintChar) no interrupts, so there are basicly 3 function tested on 9600 and 115200 baud rate lwip_debug is disabled in lwipopts.h "?" is showing upon initializing function without lwip files in makefile every approach works fine 2015-07-28 10:21 GMT+02:00 Grzegorz Niemirowski [via lwIP] <[hidden email]>: Damian, could you provide a piece of code you use for accessing UART? Do you use functions named like send()? Maybe you have LWIP_COMPAT_SOCKETS defined and functions redefined? #define send(a,b,c,d)        lwip_send(a,b,c,d) Best regards, Grzegorz Niemirowski On Tue, Jul 28, 2015 at 10:06 AM, Damian Martyniuk <[hidden email]> wrote: hi, hmm i don't see any messages about memory exceeding the resources available or something like "memory could not be "Written"" - but i never looked at map file so i could be wrong (following this http://www.codeproject.com/Articles/3472/Finding-crash-information-using-the-MAP-file) - what should i be searching for ? nothing seems wrong for my level of knowledge. for me it's wierd that only uart is not working, freertos tasks are fine, application is working - the only thing is that i don't get messages to my terminal. maybe i should buy external crystal ? i'am working on 32Mhz internal xmega clock right now. 2015-07-28 9:18 GMT+02:00 Adam Fullerton <[hidden email]>:
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-tp24724p24732.html To unsubscribe from freertos + lwip = no uart ?, click here. View this message in context: Re: freertos + lwip = no uart ? ************************************************************************************ This footnote confirms that this email message has been scanned by PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses. ************************************************************************************ |
[Prev in Thread] | Current Thread | [Next in Thread] |