LC3 initialization causes a restart

Hi,

    I tried porting LC3 to my own 5340 project with reference to the SDK(nrf5340_audio_nrf5340_audio_dk_0.4.0), but I had a restart problem when initializing LC3  

    

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
static void lc3_encoder_configure(void)
{
int ret;
printk("lc3_encoder_configure init");
sw_codec_lc3_init(NULL, NULL, LC3_FRAME_SIZE_US);
ret = sw_codec_lc3_enc_init(PCM_SAMPLE_RATE, PCM_BIT_DEPTH,LC3_FRAME_SIZE_US, LC3_BITRATE,
SW_CODEC_MONO, &pcm_bytes_req_enc);
exit_if(ret,"lc3_enc_init did not return zero");
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

sw_codec_lc3_init(NULL, NULL, LC3_FRAME_SIZE_US);   The NULL argument passed in here causes memory to be allocated dynamically during initialization,I strongly suspect the reboot has something to do with it.
I'd like to ask you:
   Q1: Differences between malloc and k_malloc in Zephyr systems(LC3 uses malloc)? Can the malloc region fall within the defined CONFIG_HEAP_MEM_POOL_SIZE  ?
   Q2: Can the space of k_malloc in thread A be freed by K_FREE in thread B  ?