where does the '__heap_lock' error come from

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • where does the '__heap_lock' error come from

      I was trying to build a program, it passed compiling, but stucked at linking:
      E:/SEGGER/SEGGER Embedded Studio 3.12/lib/libc_v7em_fpv4_sp_d16_hard_t_le_eabi.a(libc2.o): In function `malloc':
      libc2.c:(.text.libc.malloc+0xe): undefined reference to `__heap_lock'
      libc2.c:(.text.libc.malloc+0x3a): undefined reference to `__heap_unlock'
      libc2.c:(.text.libc.malloc+0x74): undefined reference to `__heap_unlock'
      libc2.c:(.text.libc.malloc+0x7e): undefined reference to `__heap_unlock'
      E:/SEGGER/SEGGER Embedded Studio 3.12/lib/libc_v7em_fpv4_sp_d16_hard_t_le_eabi.a(libc2.o): In function `free':
      libc2.c:(.text.libc.free+0x8): undefined reference to `__heap_lock'
      libc2.c:(.text.libc.free+0x76): undefined reference to `__heap_unlock'
      Build failed
      I checked linker script file and noticed something different than before:
      __HEAPSIZE__ = 1024;
      __STACKSIZE_ABT__ = 0;
      __STACKSIZE_FIQ__ = 0;
      __STACKSIZE_IRQ__ = 0;
      __STACKSIZE_PROCESS__ = 0;
      __STACKSIZE_SVC__ = 0;
      __STACKSIZE_UND__ = 0;
      __STACKSIZE__ = 2048;
      Tabed lines are newly added.

      Any ideas on what's wrong?
    • Hello,

      Thank you for your inquiry.
      Could you try the latest Embedded Studio version?
      Does that improve the behaviour?
      Are the variables referenced in your project?

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support contact us per e-mail.
      Alternatively our support ticketing system can be used as well: segger.com/ticket/