Skip to content

Commit

Permalink
Added error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rosahay-silabs committed May 23, 2023
1 parent 4e4d194 commit 2cd0f2b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions examples/platform/silabs/efr32/rs911x/hal/efx_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,28 @@ void sl_wfx_host_pre_bootloader_spi_transfer()
SPIDRV_DeInit(SL_SPIDRV_HANDLE);
spi_enabled = false;
}
bootloader_init();
int32_t status = bootloader_init();
// bootloader_init takes care of SPIDRV_Init()
if (status != BOOTLOADER_OK)
{
SILABS_LOG("%s: bootloader_init failed with error code: %d", __func__, status);
return;
}
sl_wfx_host_spiflash_cs_assert();
SILABS_LOG("%s completed.", __func__);
}

void sl_wfx_host_post_bootloader_spi_transfer()
{
SILABS_LOG("%s started.", __func__);
bootloader_deinit();
GPIO->USARTROUTE[0].ROUTEEN = 0;
int32_t status = bootloader_deinit();
// bootloader_deinit will do USART disable
if (status != BOOTLOADER_OK)
{
SILABS_LOG("%s: bootloader_deinit failed with error code: %d", __func__, status);
return;
}
GPIO->USARTROUTE[SL_MX25_FLASH_SHUTDOWN_PERIPHERAL_NO].ROUTEEN = 0;
sl_wfx_host_spiflash_cs_deassert();
xSemaphoreGive(spi_sem_sync_hdl);
SILABS_LOG("%s completed.", __func__);
Expand Down

0 comments on commit 2cd0f2b

Please sign in to comment.