7 Replies Latest reply on Feb 16, 2016 6:11 PM by nasac_2167841

    How to exclude DNS, TCP when a application is compiled?

    SeKi_2184131

      WICED-SDK project is set Symbols LWIP_DNS and LWIP_TCP,

      but I want to use UDP and Socket Libraries only to develop app.

       

      So I have erased LWIP_DNS and LWIP_TCP , but related DNS flash and static data are included in compile log,

      and some DSN functions are included with udp libraries of LwIP,

       

      How to set the function to be disable DSN and TCP?

        • 1. Re: How to exclude DNS, TCP when a application is compiled?

          Currently this is not possible. The WICED APIs do support both udp and tcp via the same source files, and so unless you modify the source by yourself this is not just a #define change.

           

          Having said that - any particular reason why you need these to be disabled? Even if you are using just UDP - you would need DNS unless you plan to hard-code IP addresses.

           

          And TCP support while it will take some room in Flash should not be significant i.e. not more than a few KB at max

          • 2. Re: How to exclude DNS, TCP when a application is compiled?
            SeKi_2184131

            Since our target board's SRAM memory size does not sufficient to operate completely demo app while run-time, optimization of network stack's code that takes largest size of SRAM memory as stack or heap will be required.

            • 3. Re: How to exclude DNS, TCP when a application is compiled?

              From SRAM perspective TCP and DNS should not take any additional memory if you are not using those protocols. The buffers used for the network stack are shared between protocols.

               

              What MCU are you trying to fit this into?

               

              You might be better off to reduce the network packet buffer numbers to save memory.

               

              Look at tuning -

               

              GLOBAL_DEFINES +=

                               TX_PACKET_POOL_SIZE=10 \

                                RX_PACKET_POOL_SIZE=10 \

               

              To smaller numbers

              • 4. Re: How to exclude DNS, TCP when a application is compiled?
                SeKi_2184131

                Thanks to your reply.

                 

                That option already is applied.

                 

                #Set Values

                GLOBAL_DEFINES += PBUF_POOL_TX_SIZE=2

                GLOBAL_DEFINES += PBUF_POOL_RX_SIZE=2

                GLOBAL_DEFINES += WICED_PAYLOAD_MTU=600 \

                TX_PACKET_POOL_SIZE=1 \

                RX_PACKET_POOL_SIZE=1

                 

                Any other variable or definition that can be further optimized exists?

                 

                Though DNS function does not use in app, why DNS takes the memory size in compile log?

                And What does mean 'Other'  in compile log?

                • 5. Re: How to exclude DNS, TCP when a application is compiled?

                  Please look at the map file from the build which tells you exactly where the symbols are being included and how much space they occupy

                   

                  the _map.csv in the build binary directory

                   

                  You seem to be only using 20KB of SRAM. Which MCU are you using that is running out of memory? Most MCUs the SDK support should have plenty of memory left over at this point for the heap

                  • 6. Re: How to exclude DNS, TCP when a application is compiled?
                    SeKi_2184131

                    Our MCU ported WICED-SDK has 256KB Flash, 64KB SRAM and 8Mbit Ext. EEPROM.

                    Assigned memory map is equal to stm32f205, So Most of all apps are running well.

                     

                    But Some apps that occupy most size of SRAM are dead soon and reboot the program.

                    When Network Stack is initialized, Only about 27KB of SRAM is available to perform the App but this size is not enough.

                     

                    [Compile Log]

                    ----------------------------------|---------|---------|

                                                      |         |  Static |

                                  Module              |  Flash  |   RAM   |

                    ----------------------------------+---------+---------|

                    App                               |     807 |       4 |

                    FreeRTOS                          |    4661 |     416 |

                    Interrupt Vectors                 |     322 |       0 |

                    libc                              |   22767 |    3064 |

                    LwIP                              |   19706 |    2077 |

                    Networking                        |     624 |     288 |

                    NVRam                             |     965 |       0 |

                    Other                             |    7297 |    1797 |

                    Packet Buffers                    |       0 |    6516 |

                    platform                          |     924 |      84 |

                    RAM Initialisation                |    2260 |       0 |

                    resources                         |      28 |       0 |

                    Ring_Buffer                       |      14 |       0 |

                    SPI_Flash_Library_AC34MC256WOT1_ex|     508 |       0 |

                    Startup Stack & Link Script fill  |      51 |      32 |

                    WICED                             |    2558 |      54 |

                    Wiced_RO_FS                       |     568 |       0 |

                    WWD                               |    9514 |     156 |

                    ----------------------------------+---------+---------|

                    TOTAL (bytes)                     |   71314 |   14488 |

                    ----------------------------------|---------|---------|

                     

                     

                    [Console Log]

                     

                    Starting WICED v3.3.1

                    Platform AC34MC256WOT1_ext initialised

                    Started FreeRTOS v7.5.2

                    Initialising LwIP v1.4.0.rc1

                    WWD SPI interface initialised

                    WLAN MAC Address : 2C:E2:A8:30:30:B1

                    WLAN Firmware    : wl0: Nov  7 2014 16:03:45 version 5.90.230.12 FWID 01-78010cdf

                    malloc_info {

                            arena:          22376;  /* total space allocated from system */

                            ordblks:            1;  /* number of non-inuse chunks */

                            smblks:             0;  /* unused -- always zero */

                            hblks:              0;  /* number of mmapped regions */

                            hblkhd:             0;  /* total space in mmapped regions */

                            usmblks:            0;  /* unused -- always zero */

                            fsmblks:            0;  /* unused -- always zero */

                            uordblks:       21280;  /* total allocated space */

                            fordblks:        1096;  /* total non-inuse space */

                            keepcost:        1096;  /* top-most, releasable (via malloc_trim) space */

                    };

                    ********* Malloc : 0x20008BC0, 0, 16 *********

                    • 7. Re: How to exclude DNS, TCP when a application is compiled?

                      Most of the SDK reference applications won't run in 64KB of SRAM

                       

                      In order to run in 64KB of SRAM - you have to customize very strictly what application you are building and minimize heap and stack usage.

                       

                      We don't generally recommend running in this small of SRAM anymore for a generic WIFI device. 128KB is a better starting point.