QSPI reset device triggers assertion

ID: COBALTSDK-1137

Status: Open

First reported: 10.2.4.44

Fixed in: TBD

Description

he qspi_int_reset_device() calls the flash_reset_continuous_mode() twice with different break_seq_size. The first call with break_seq_size = HW_QSPI_BREAK_SEQ_SIZE_1B is redundant, because the second call with break_seq_size = HW_QSPI_BREAK_SEQ_SIZE_2B does the job in either case (exits any memory from continuous mode of operation regardless its address size, i.e. 24bit or 32bit).

Calling the flash_reset_continuous_mode() with HW_QSPI_BREAK_SEQ_SIZE_1B for memories with 32bit address size triggers the assertion:

ASSERT_WARNING(((QSPI_GET_DEVICE_PARAM(QSPI_GET_CONFIG_IDX(id), address_size) == HW_QSPI_ADDR_SIZE_32)
                && (break_seq_size == HW_QSPI_BREAK_SEQ_SIZE_2B)) ||
                (QSPI_GET_DEVICE_PARAM(QSPI_GET_CONFIG_IDX(id), address_size) == HW_QSPI_ADDR_SIZE_24));

This assertion prevents the users from calling the function with wrong arguments, which cannot exit the connected flash memory from continuous mode of operation.

Workaround

in sdk/bsp/memory/src/qspi_automode.c:

@@ -1695,8 +1695,6 @@ __RETAINED_CODE void qspi_int_reset_device(HW_QSPIC_ID id)
         flash_set_bus_mode(id, HW_QSPI_BUS_MODE_SINGLE);
         flash_write(id, &power_up_cmd, 1);
 
-        /* Reset continuous mode using both one and two break bytes to cover all cases */
-        flash_reset_continuous_mode(id, HW_QSPI_BREAK_SEQ_SIZE_1B);
         flash_reset_continuous_mode(id, HW_QSPI_BREAK_SEQ_SIZE_2B);
 
         /* Reset QSPI FLASH/RAM in SINGLE mode */