From c44feda797145384e1b5a8e506a9653ffcce842a Mon Sep 17 00:00:00 2001 From: Ikjoon Jang Date: Thu, 11 Apr 2024 02:50:27 +0000 Subject: Apply chip-reset right before FW downloading To explictly have FW downloading mode, Apply chip-reset right before FW download. Remove chip-reset from phTmlUwb_spi_open_and_configure(), which is called from phNxpUciHal_open(). Bug: 332268554 Test: HAL init from sr100 and sr200, akash daemon Merged-in: Ic6982ed1ee8f388d187660628c7caf7c65bdacdd Change-Id: Ic6982ed1ee8f388d187660628c7caf7c65bdacdd --- halimpl/hal/sr1xx/NxpUwbChipSr1xx.cc | 4 ++-- halimpl/tml/phTmlUwb_spi.cc | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/halimpl/hal/sr1xx/NxpUwbChipSr1xx.cc b/halimpl/hal/sr1xx/NxpUwbChipSr1xx.cc index 32c65b0..f39ccae 100644 --- a/halimpl/hal/sr1xx/NxpUwbChipSr1xx.cc +++ b/halimpl/hal/sr1xx/NxpUwbChipSr1xx.cc @@ -566,6 +566,8 @@ tHAL_UWB_STATUS NxpUwbChipSr1xx::chip_init() NXPLOG_UCIHAL_D("Start SR1XX FW download"); for (int i = 0; i < 5; i++) { + phTmlUwb_Chip_Reset(); + status = phNxpUciHal_fw_download(); if (status == UWBSTATUS_SUCCESS) { @@ -576,8 +578,6 @@ tHAL_UWB_STATUS NxpUwbChipSr1xx::chip_init() break; } else { NXPLOG_UCIHAL_E("FW download failed, status= 0x%x, retry.", status); - phTmlUwb_Chip_Reset(); - usleep(5000); } } diff --git a/halimpl/tml/phTmlUwb_spi.cc b/halimpl/tml/phTmlUwb_spi.cc index e51261f..132a990 100644 --- a/halimpl/tml/phTmlUwb_spi.cc +++ b/halimpl/tml/phTmlUwb_spi.cc @@ -60,12 +60,6 @@ tHAL_UWB_STATUS phTmlUwb_spi_open_and_configure(const char* pDevName, void** pLi *pLinkHandle = (void*)((intptr_t)nHandle); - /*Reset SR100 */ - phTmlUwb_Spi_Ioctl((void*)((intptr_t)nHandle), phTmlUwb_ControlCode_t::SetPower, 0); - usleep(1000); - phTmlUwb_Spi_Ioctl((void*)((intptr_t)nHandle), phTmlUwb_ControlCode_t::SetPower, 1); - usleep(10000); - return UWBSTATUS_SUCCESS; } -- cgit v1.2.3