void main(void) { /* Enable additional fault handlers */ SCB->SHCSR |= (SCB_SHCSR_BUSFAULTENA_Msk | /*SCB_SHCSR_USGFAULTENA_Msk |*/ SCB_SHCSR_MEMFAULTENA_Msk); /* Init board hardware */ /* Relocate Vector Table */ #if RELOCATE_VECTOR_TABLE BOARD_RelocateVectorTableToRam(); #endif BOARD_ConfigMPU(); BOARD_InitBootPins(); BOARD_BootClockRUN(); BOARD_InitDebugConsole(); /* Setup Crypto HW */ CRYPTO_InitHardware(); /* Set flash management callbacks */ sln_flash_mgmt_cbs_t flash_mgmt_cbs = {pdm_to_pcm_mics_off, pdm_to_pcm_mics_on}; SLN_FLASH_MGMT_SetCbs(&flash_mgmt_cbs); /* Initialize Flash to allow writing */ SLN_Flash_Init(); /* Initialize flash management */ SLN_FLASH_MGMT_Init((sln_flash_entry_t *)g_fileTable, false); /* * AUDIO PLL setting: Frequency = Fref * (DIV_SELECT + NUM / DENOM) * = 24 * (32 + 77/100) * = 786.48 MHz */ const clock_audio_pll_config_t audioPllConfig = { .loopDivider = 32, /* PLL loop divider. Valid range for DIV_SELECT divider value: 27~54. */ .postDivider = 1, /* Divider after the PLL, should only be 1, 2, 4, 8, 16. */ .numerator = 77, /* 30 bit numerator of fractional loop divider. */ .denominator = 100, /* 30 bit denominator of fractional loop divider */ }; CLOCK_InitAudioPll(&audioPllConfig); CLOCK_SetMux(kCLOCK_Sai1Mux, BOARD_PDM_SAI_CLOCK_SOURCE_SELECT); CLOCK_SetDiv(kCLOCK_Sai1PreDiv, BOARD_PDM_SAI_CLOCK_SOURCE_PRE_DIVIDER); CLOCK_SetDiv(kCLOCK_Sai1Div, BOARD_PDM_SAI_CLOCK_SOURCE_DIVIDER); CLOCK_EnableClock(kCLOCK_Sai1); CLOCK_SetMux(kCLOCK_Sai2Mux, BOARD_PDM_SAI_CLOCK_SOURCE_SELECT); CLOCK_SetDiv(kCLOCK_Sai2PreDiv, BOARD_PDM_SAI_CLOCK_SOURCE_PRE_DIVIDER); CLOCK_SetDiv(kCLOCK_Sai2Div, BOARD_PDM_SAI_CLOCK_SOURCE_DIVIDER); CLOCK_EnableClock(kCLOCK_Sai2); edma_config_t dmaConfig = {0}; EDMA_GetDefaultConfig(&dmaConfig); EDMA_Init(DMA0, &dmaConfig); DMAMUX_Init(DMAMUX); RGB_LED_Init(); RGB_LED_SetColor(LED_COLOR_GREEN); sln_shell_init(); TCP_OTA_Server_Start(); xTaskCreate(appTask, "APP_Task", 512, NULL, configMAX_PRIORITIES - 4, &appTaskHandle); xTaskCreate(sln_shell_task, "Shell_Task", 1024, NULL, tskIDLE_PRIORITY + 1, NULL); xTaskCreate(local_voice_task, "Local_Voice_Task", 4096, NULL, configMAX_PRIORITIES - 4, NULL); /* Run RTOS */ vTaskStartScheduler(); /* Should not reach this statement */ while (1) ; }