Malloc or OS_malloc before OS_start

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

  • Malloc or OS_malloc before OS_start

    Env: IAR 4.41, embOS 3.52e, LPC2138, libmode DT

    I want to use malloc to allocate a couple of buffers before calling OS_start(). I am calling OS_INIT_SYS_LOCKS after OS_InitKern as recommended. This is before my call to malloc. The malloc call does not return because it ends up calling OS_LockSys, which calls some trace macro. I lost track of the final call that bombs, but it leads to OS_ERR_ILLEGAL_IN_TIMER. I can get around this by delaying my call to OS_INIT_SYS_LOCKS() until after I do the malloc. Any problem with that, or did I overlook something ?