This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AWR1843: QSPIFlash Open API failed

Expert 2050 points
Part Number: AWR1843

We have a custom AWR1843 device. The device uses QSPI Flash memory IS25LP016D which is different from that of AWR1843Boost Evb.

We test this custom AWR1843 device with automotive lab demo lab0012_can_sbl and get Error: QSPIFlash Open API failed.

But the lab demo works well with my AWR1843BOOST Evm. 

Can you please give some hints of solving the error?

Kind regards 

  • Hi Lei,

    The relevant expert for this is on leave and will be back tomorrow. 

    In the meantime, could I ask you to get the error code from the QSPIFlash Open API?

    Regards,

    Aayush

  • Thanks Aayush,

    Please find part of the relevant code as below:

    void SBL_initTask(UArg arg0, UArg arg1)
    {
        int32_t             retVal = 0;
        uint32_t            flashAddr = 0U;
        SPIFLASH_devID      devId;
        uint8_t             userInput = 0;
        uint8_t             autoboot = SBL_AUTOBOOT_COUNT;
        uint32_t            metaimageUpdate = 0;
        QSPI_Params         QSPIParams;
        QSPIFlash_Handle    qspiFlashHandle = NULL;
    
        /* Initialize transport peripheral */
        SBL_transportInit();
    
        /* Configure transport peripheral */
        retVal = SBL_transportConfig();
    
        /* Check if the transport peripheral was configured successfully? */
        if (retVal != 0)
        {
            DebugP_assert(0);
        }
    
        SBL_printf ("\r\n");
        SBL_printf ("**********************************************\r\n");
        SBL_printf ("Debug: Secondary Bootloader Application Start \r\n");
        SBL_printf ("**********************************************\r\n");
    
        SBL_printf ("Press any key to stop auto boot and Update Meta Image...\r\n");
        SBL_printf ("Loading existing Meta Image from Flash in ");
    
        do
        {
            retVal = SBL_transportRead((uint8_t*)&userInput, 1U);
            if(retVal != 1U){
                retVal = CAN_fwUpdateReqRcv();
            }
    
            /* Check if user interrupted the autoboot */
            if (retVal == 1U)
            {
                metaimageUpdate = 1;
                SBL_printf ("\r\nDebug: Update Meta Image selected\r\n");
            }
            else
            {
                SBL_printf ("  %d", autoboot--);
                CAN_FW_Update_Waiting();
                continue;
            }
        }while((retVal == 0) && (autoboot != 0));
    
        /* Initialize the QSPI Driver */
        QSPI_init();
    
        /* Initialize the QSPI Flash */
        QSPIFlash_init();
    
        /* Open QSPI driver */
        QSPI_Params_init(&QSPIParams);
    
        /* Set the QSPI peripheral clock  */
        QSPIParams.qspiClk = SOC_getMSSVCLKFrequency(gSblMCB.socHandle, &retVal);
    
        QSPIParams.clkMode = QSPI_CLOCK_MODE_0;
    
        /* Running at 40MHz QSPI bit rate
         * QSPI bit clock rate derives from QSPI peripheral clock(qspiClk)
         and divide clock internally down to bit clock rate
         BitClockRate = qspiClk/divisor(setup by QSPI driver internally)
         */
        QSPIParams.bitRate = 40 * 1000000U;
    
        gSblMCB.qspiHandle = QSPI_open(&QSPIParams, &retVal);
    
        if (gSblMCB.qspiHandle == NULL)
        {
            SBL_printf("Error: QSPI_open failed [Error code %d]\r\n", retVal);
            DebugP_assert(0);
        }
    
        /* Open the QSPI Instance */
        qspiFlashHandle = QSPIFlash_open(gSblMCB.qspiHandle, &retVal);
        if (qspiFlashHandle == NULL)
        {
            SBL_printf("Error: QSPIFlash Open API failed.\r\n");
            DebugP_assert(0);
        }
        ...

    It does work well with AWR1843Boost Evb, but trigger the error with our customized device.

    Error: QSPIFlash Open API failed.

  • Hi,

    Please check if pin mapping of custom device is same as AWR1843BOOST EVM

    and the QSPI driver is supported as given in the SDK driver.

    Regards,

    Jitendra

  • Thank Jitendra,

    Yes. The PIN mapping is the same. 

    The flash memory is IS25LP016D and mmwave SDK version is 3.1.0.2. Can you please tell me how to check if the QSPI driver is supported in the SDK driver?

    Kind regards 

  • I can see these sFlash device ID in the QSPIFLASH driver

    /* SPI flash manufacture id */
    #define SPANSION_DEV (0x01U)
    #define MACRONIX_DEV (0xC2U)
    #define MICRON_DEV (0x20U)

    C:\ti\mmwave_sdk_03_05_00_04\packages\ti\drivers\qspiflash\qspiflash.h

    And for the above error (QSPIFlash Open API failed), please step into the QSPIFlash_open function to check the cause of returning this function NULL.

  • I confirm the error is: QSPIFLASH_ENOTSUPPORTED

    Function QSPIFlashGetDeviceID returns a device id which has no supported manufacture id. 

    Does TI provide driver for Flash memory IS25LP016D ?

  • mmWave SDK supports few sets of sFlash parts

    To support new part, you can write supporting driver file : qspiflash_device_<sflash_part>.c and connect it to qspiflash driver library.

    Regards,

    Jitendra

  • Thanks. I copied qspiflash_device_spansion.c to a new driver file: qspiflash_device_issi.c.

    Do I need to change below the value to match IS25LP016D? Do you have these information?

    #define FLASH_CONFIG_QUADREAD_ENABLE        0x2U
    
    ...
    
    ptrFlashParams->readDataCmd = FLASH_CMD_FAST_SINGLE_READ;
    
    /* Protection bit mask in status register */
    ptrFlashParams->protectBitsMask = (uint8_t)0x1CU;

  • I'm not fully aware for your sflash part.

    You need to check datasheet of that part and update QUADREAD_ENABLE, readDataCmd and protectBitsMask.

    It should match with the part detail you are using.

    Regards,

    Jitendra