UltimaSerial AVR32 lwIP Workshop: Worknotes
 

Data logger
UltimaSerial

 

Windaq add-ons
Windaq Add-ons

 

Spectrogram
UltimaWaterfall

 

Ultimaserial XChart
XChart

 

FFT1024
FFT1024

 

Ultimaserial Classroom
Lessons

  • lwipopts.h contains settings you can tweak the performance of lwIP
  • Before enabling lwIP, the AVR32's lwIP example will change the CPU clock from 12Mhz to 48Mhz, thus all serial communication baud rate, which is also used by print_dbg, goes up.
  • Like 2), if SDRAM is used in the project, sdram_init(48000000) should be called after enabling lwIP
  • To increase output bandwidth, increase the number of  TCP_SND_BUF
  • To increase input bandwidth, increase the number of  TCP_WND
  • To increase input buffer size, increase PBUF_POOL_SIZE and PBUF_POOL_BUFSIZE.
  • Watch out for the product of PBUF_POOL_SIZE and PBUF_POOL_BUFSIZE and TCP_SND_BUF, when they add up close to 64K, be aware of memory problem!
  • Backing up the entire project directory is NOT enough to preserve the configuration of a project. If a project is trashed and you need to bring back the backed up directory, use import to bring the backup directory back. Unfortunately, the framework will no longer recognize the project
  • Due to the way FreeRTOS handles priority, make sure you either keep all threads in the same priority or make sure the higher priority thread goes into blocked state periodically, such as vTaskDelay( 1 ), or the highest priority thread will never let the lower ones to run.
  • Unfortunately, lwip_send doesn't report the err code from its lower layer netconn_send,  which can be:

    #define ERR_OK 0 /* No error, everything OK. */
    #define ERR_MEM -1 /* Out of memory error. */
    #define ERR_BUF -2 /* Buffer error. */
    #define ERR_RTE -3 /* Routing problem. */
    #define ERR_ABRT -4 /* Connection aborted. */
    #define ERR_RST -5 /* Connection reset. */
    #define ERR_CLSD -6 /* Connection closed. */
    #define ERR_CONN -7 /* Not connected. */
    #define ERR_VAL -8 /* Illegal value. */
    #define ERR_ARG -9 /* Illegal argument. */
    #define ERR_USE -10 /* Address in use. */
    #define ERR_IF -11 /* Low-level netif error */
    #define ERR_ISCONN -12 /* Already connected. */
    #define ERR_TIMEOUT -13 /* Timeout. */
    #define ERR_INPROGRESS -14 /* Operation in progress */

 

Find out how to upgrade to the latest lwIP

 

 

 Last update: 05/18/12