From 2cd0f2b6b7c0b629a880f38a38c5b55adde06427 Mon Sep 17 00:00:00 2001 From: rosahay-silabs Date: Tue, 23 May 2023 14:53:52 +0530 Subject: [PATCH] Added error logs --- .../platform/silabs/efr32/rs911x/hal/efx_spi.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/examples/platform/silabs/efr32/rs911x/hal/efx_spi.c b/examples/platform/silabs/efr32/rs911x/hal/efx_spi.c index b3471bb405eac2..183e468b5befed 100644 --- a/examples/platform/silabs/efr32/rs911x/hal/efx_spi.c +++ b/examples/platform/silabs/efr32/rs911x/hal/efx_spi.c @@ -246,8 +246,13 @@ 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__); } @@ -255,8 +260,14 @@ void sl_wfx_host_pre_bootloader_spi_transfer() 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__);