Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Memory is allocated to µC/HTTPs instance through the µCµC/HTTPs is using µC/LIB to allocated internal data such as OS objects (semaphore, mutex), application buffers and connection control structure, etc. µC/HTTPs internal tasks stack is also allocated using µC/LIB. Therefore µC/LIB memory module . You must enable and configure the size of the µC/LIB memory heap available to the system. The following configuration constants should be defined from within lib_cfg.h and set to match the application requirements.

#define LIB_MEM_CFG_ALLOC_EN DEF_ENABLED
#define LIB_MEM_CFG_HEAP_SIZE 58000

The heap size is specified in bytes. If the heap size is must be configured properly for µC/HTTPs. If the heap size is not configured large enough, an error will be returned during the web server instance initialization.

Since the needed heap size is related to the module configuration (http-s_cfg.h), it’s ) and each instance configuration  (http-s_instance_cfg.*) it’s not possible to provide an exact formula to calculate it. Thus to optimize the heap size, you should try different heap size until no error is returned for all interfaces addedinstance initialized.

Note: The memory module module must be  be initialized by the application by calling Memprior to calling HTTPs_Init() prior to calling HTTPs_InstanceInit(). We recommend initializing the memory module before calling OSStart()starting the RTOS, or near the top of the startup task.

Please refer to section µC/LIB Documentation for more details on the µC/LIB module and its configuration.