#ifdef MY_CODE
/* Export linker symbols into C context */
extern uint32_t __ocram_bss_start;
extern uint32_t __ocram_bss_end;
void zero_init_ocram_bss(void)
{
uint32_t *src = &__ocram_bss_start;
uint32_t *dst = &__ocram_bss_end;
/*
* Manually zero out the custom OCRAM BSS section
* to guarantee that posix_mutex_pool and posix_thread_pool
* contain clean zeros before any OS structures use them.
*/
while (src < dst) {
*src++ = 0;
}
}
#endif
int main(void)
{
#ifdef MY_CODE
/* Clear custom internal memory structures strictly before PJSIP starts */
zero_init_ocram_bss();
#endif
// Your standard pjsua_init() and start logic...
}