This is an automated email from the ASF dual-hosted git repository.

agross pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 382446f9932a9bfe8c230e340a267f0e8a239390
Author: Andy Gross <[email protected]>
AuthorDate: Mon Sep 26 18:13:16 2022 -0500

    da146x: hal_flash: Fix rdid issue on Gigadevice
    
    This patch moves the set manual mode and adds a busy status check before
    executing the read rdid qspi command.  On gigadevice flash devices, the read
    rdid would fail intermittently due to the device not being ready for the
    command.
    
    Signed-off-by: Andy Gross <[email protected]>
---
 hw/mcu/dialog/da1469x/src/hal_flash.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/mcu/dialog/da1469x/src/hal_flash.c 
b/hw/mcu/dialog/da1469x/src/hal_flash.c
index 7d5c69832..6004e2594 100644
--- a/hw/mcu/dialog/da1469x/src/hal_flash.c
+++ b/hw/mcu/dialog/da1469x/src/hal_flash.c
@@ -430,6 +430,9 @@ qspi_read_rdid(const struct hal_flash *dev)
     int i;
     uint32_t result;
 
+    da1469x_qspi_mode_manual(dev);
+    da1469x_qspi_wait_busy(dev);
+
     /* Issue a read rdid command (0x9F) and get 24 bit response */
     QSPIC->QSPIC_CTRLBUS_REG = QSPIC_QSPIC_CTRLBUS_REG_QSPIC_EN_CS_Msk;
     da1469x_qspi_write8(dev, 0x9f);
@@ -454,7 +457,6 @@ da1469x_hff_mcu_custom_init(const struct hal_flash *dev)
     uint32_t primask;
 
     __HAL_DISABLE_INTERRUPTS(primask);
-    da1469x_qspi_mode_manual(dev);
 
     /* detect flash device and use correct configuration */
     config = qspi_read_rdid(dev);

Reply via email to