This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Issue Linking Nordic Memory Module with IAR

Hello,

I'm having issues linking the nordic memory module to my IAR project. Under the project options for the C compiler and assembler, I have included the appropriate directories for mem_manager.c and mem_manager.h. I have also added the c files to the project workspace.

The specific error I get in IAR is "Error[Li005]: no definition for "nrf_mem_init"..." and "Error while running Linker."

image description

Hardware and software specifications listed below:

Chip: nRF52840 Preview Development Kit IDE: IAR Embedded Workbench 7.60 OS: Windows 10 Enterprise SDK: Nordic SDK for Thread v 0.10

image description

Currently working off of and adding to the thread_cloud_coap_client example.

Thank you very much in advance for any help you can provide! Let me know if you need any further information.

  • Hi,

    You will also need add the different mem_manager configs to the sdk_config.h file, and make sure that you have MEM_MANAGER_ENABLED set to 1.

    Add this code to sdk_config.h :

    // <e> MEM_MANAGER_ENABLED - mem_manager - Dynamic memory allocator
    //==========================================================
    #ifndef MEM_MANAGER_ENABLED
    #define MEM_MANAGER_ENABLED 1
    #endif
    // <o> MEMORY_MANAGER_SMALL_BLOCK_COUNT - Size of each memory blocks identified as 'small' block.  <0-255> 
    
    
    #ifndef MEMORY_MANAGER_SMALL_BLOCK_COUNT
    #define MEMORY_MANAGER_SMALL_BLOCK_COUNT 1
    #endif
    
    // <o> MEMORY_MANAGER_SMALL_BLOCK_SIZE -  Size of each memory blocks identified as 'small' block. 
    // <i>  Size of each memory blocks identified as 'small' block. Memory block are recommended to be word-sized.
    
    #ifndef MEMORY_MANAGER_SMALL_BLOCK_SIZE
    #define MEMORY_MANAGER_SMALL_BLOCK_SIZE 32
    #endif
    
    // <o> MEMORY_MANAGER_MEDIUM_BLOCK_COUNT - Size of each memory blocks identified as 'medium' block.  <0-255> 
    
    
    #ifndef MEMORY_MANAGER_MEDIUM_BLOCK_COUNT
    #define MEMORY_MANAGER_MEDIUM_BLOCK_COUNT 0
    #endif
    
    // <o> MEMORY_MANAGER_MEDIUM_BLOCK_SIZE -  Size of each memory blocks identified as 'medium' block. 
    // <i>  Size of each memory blocks identified as 'medium' block. Memory block are recommended to be word-sized.
    
    #ifndef MEMORY_MANAGER_MEDIUM_BLOCK_SIZE
    #define MEMORY_MANAGER_MEDIUM_BLOCK_SIZE 256
    #endif
    
    // <o> MEMORY_MANAGER_LARGE_BLOCK_COUNT - Size of each memory blocks identified as 'large' block.  <0-255> 
    
    
    #ifndef MEMORY_MANAGER_LARGE_BLOCK_COUNT
    #define MEMORY_MANAGER_LARGE_BLOCK_COUNT 0
    #endif
    
    // <o> MEMORY_MANAGER_LARGE_BLOCK_SIZE -  Size of each memory blocks identified as 'large' block. 
    // <i>  Size of each memory blocks identified as 'large' block. Memory block are recommended to be word-sized.
    
    #ifndef MEMORY_MANAGER_LARGE_BLOCK_SIZE
    #define MEMORY_MANAGER_LARGE_BLOCK_SIZE 256
    #endif
    
    // <o> MEMORY_MANAGER_XLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra large' block.  <0-255> 
    
    
    #ifndef MEMORY_MANAGER_XLARGE_BLOCK_COUNT
    #define MEMORY_MANAGER_XLARGE_BLOCK_COUNT 0
    #endif
    
    // <o> MEMORY_MANAGER_XLARGE_BLOCK_SIZE -  Size of each memory blocks identified as 'extra large' block. 
    // <i>  Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized.
    
    #ifndef MEMORY_MANAGER_XLARGE_BLOCK_SIZE
    #define MEMORY_MANAGER_XLARGE_BLOCK_SIZE 1320
    #endif
    
    // <o> MEMORY_MANAGER_XXLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra large' block.  <0-255> 
    
    
    #ifndef MEMORY_MANAGER_XXLARGE_BLOCK_COUNT
    #define MEMORY_MANAGER_XXLARGE_BLOCK_COUNT 0
    #endif
    
    // <o> MEMORY_MANAGER_XXLARGE_BLOCK_SIZE -  Size of each memory blocks identified as 'extra extra large' block. 
    // <i>  Size of each memory blocks identified as 'extra extra large' block. Memory block are recommended to be word-sized.
    
    #ifndef MEMORY_MANAGER_XXLARGE_BLOCK_SIZE
    #define MEMORY_MANAGER_XXLARGE_BLOCK_SIZE 3444
    #endif
    
    // <o> MEMORY_MANAGER_XSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra small' block.  <0-255> 
    
    
    #ifndef MEMORY_MANAGER_XSMALL_BLOCK_COUNT
    #define MEMORY_MANAGER_XSMALL_BLOCK_COUNT 0
    #endif
    
    // <o> MEMORY_MANAGER_XSMALL_BLOCK_SIZE -  Size of each memory blocks identified as 'extra small' block. 
    // <i>  Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized.
    
    #ifndef MEMORY_MANAGER_XSMALL_BLOCK_SIZE
    #define MEMORY_MANAGER_XSMALL_BLOCK_SIZE 64
    #endif
    
    // <o> MEMORY_MANAGER_XXSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra small' block.  <0-255> 
    
    
    #ifndef MEMORY_MANAGER_XXSMALL_BLOCK_COUNT
    #define MEMORY_MANAGER_XXSMALL_BLOCK_COUNT 0
    #endif
    
    // <o> MEMORY_MANAGER_XXSMALL_BLOCK_SIZE -  Size of each memory blocks identified as 'extra extra small' block. 
    // <i>  Size of each memory blocks identified as 'extra extra small' block. Memory block are recommended to be word-sized.
    
    #ifndef MEMORY_MANAGER_XXSMALL_BLOCK_SIZE
    #define MEMORY_MANAGER_XXSMALL_BLOCK_SIZE 32
    #endif
    
    // <e> MEM_MANAGER_CONFIG_LOG_ENABLED - Enables logging in the module.
    //==========================================================
    #ifndef MEM_MANAGER_CONFIG_LOG_ENABLED
    #define MEM_MANAGER_CONFIG_LOG_ENABLED 0
    #endif
    // <o> MEM_MANAGER_CONFIG_LOG_LEVEL  - Default Severity level
     
    // <0=> Off 
    // <1=> Error 
    // <2=> Warning 
    // <3=> Info 
    // <4=> Debug 
    
    #ifndef MEM_MANAGER_CONFIG_LOG_LEVEL
    #define MEM_MANAGER_CONFIG_LOG_LEVEL 3
    #endif
    
    // <o> MEM_MANAGER_CONFIG_INFO_COLOR  - ANSI escape code prefix.
     
    // <0=> Default 
    // <1=> Black 
    // <2=> Red 
    // <3=> Green 
    // <4=> Yellow 
    // <5=> Blue 
    // <6=> Magenta 
    // <7=> Cyan 
    // <8=> White 
    
    #ifndef MEM_MANAGER_CONFIG_INFO_COLOR
    #define MEM_MANAGER_CONFIG_INFO_COLOR 0
    #endif
    
    // <o> MEM_MANAGER_CONFIG_DEBUG_COLOR  - ANSI escape code prefix.
     
    // <0=> Default 
    // <1=> Black 
    // <2=> Red 
    // <3=> Green 
    // <4=> Yellow 
    // <5=> Blue 
    // <6=> Magenta 
    // <7=> Cyan 
    // <8=> White 
    
    #ifndef MEM_MANAGER_CONFIG_DEBUG_COLOR
    #define MEM_MANAGER_CONFIG_DEBUG_COLOR 0
    #endif
    
    // </e>
    
    // <q> MEM_MANAGER_DISABLE_API_PARAM_CHECK  - Disable API parameter checks in the module.
     
    
    #ifndef MEM_MANAGER_DISABLE_API_PARAM_CHECK
    #define MEM_MANAGER_DISABLE_API_PARAM_CHECK 0
    #endif
    
    // </e>
    
Related