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.

AWR1642: IWR1843 qspiflash can't get manufacture info.

Part Number: AWR1642
Other Parts Discussed in Thread: IWR1843

Hi team,

SDK: SDK 03_01_00_02 

Chip: IWR1843

Question: 
When we use Secondary bootloader, we found we cannot get the id of flash.

Debug: Device info: Manufacturer: 0, Device type = 0, Capacity = 0

But we uses qspiflash test image, we could get correct flash info. (mmwave_sdk_03_01_00_02\packages\ti\drivers\qspiflash\test\xwr18xx)

Feature: QSPIFlash Open API : Passed
Debug: QSPIFlash Instance has been closed successfully
Feature: QSPIFlash re-Open API : Passed
Feature: QSPIFlash Read Id API: Manufacture MACRONIX(0xc2), device type = 0x23, capacity = 0x15: Passed

Do we miss anything?

Thanks.

  • Have you tried to replicate the code that is in the qspiflash driver? (eg. initializing qspi, reading).  I don't know of any reason why an SBL wouldn't be able to access flash memory.  Can you write known data to a known address (perhaps a flashed image) and read it from the SBL?

      -dave

  • Hi Dave,

    Yes, we've tried to do that.

    We try to replicate the code from qspiflash/test_common.c to SBL and MRR application, we always get the same result.

        int32_t         retVal = 0;
        uint32_t        flashAddr = 0U;
        SPIFLASH_devID  devId;
        uint32_t        index;
        uint32_t        testDataLen = 0U;
        uint8_t*        readDataArray;
        QSPI_Params     QSPIParams;
        QSPIFlash_Handle QSPIFlashHandle = NULL;
        uint32_t        dmaChan = 10;
        char            name[16] = {0};
        char            testCase[128];
    
        /**************************************************************************
         * Test: MCPI_Initialize
         **************************************************************************/
        /* Initialize MCPI logger framework */
        MCPI_Initialize ();
    
        /* Initialize the QSPI Driver */
        QSPI_init();
    
        /* Initialize the QSPI Flash */
        QSPIFlash_init();
    
        /* Open QSPI driver */
        QSPI_Params_init(&QSPIParams);
    
        /* Set the QSPI peripheral clock to 200MHz  */
        QSPIParams.qspiClk = 200 * 1000000U;
    
        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(=5, setup by QSPI driver internally)
         */
        QSPIParams.bitRate = 40 * 1000000U;
    
        gQSPIDrv = QSPI_open(&QSPIParams, &retVal);
    
        if(gQSPIDrv == NULL)
        {
            printf("QSPI_open failed with error=%d\n", retVal);
            goto Exit;
        }
    
        /**************************************************************************
         * Test: Open API test
         **************************************************************************/
    
        /* Open the QSPI Instance */
        QSPIFlashHandle = QSPIFlash_open(gQSPIDrv, &retVal);
        if (QSPIFlashHandle == NULL )
        {
            goto Exit;
        }
        else
        {
            /* Graceful shutdown */
            QSPIFlash_close(QSPIFlashHandle);
            System_printf("Debug: QSPIFlash Instance has been closed successfully\n");
        }
    
        /**************************************************************************
         * Test: Re-open for additional tests
         **************************************************************************/
        QSPIFlashHandle = QSPIFlash_open(gQSPIDrv, &retVal);
        if (QSPIFlashHandle == NULL )
        {
            goto Exit;
        }
        else
        {
        }
    
        /**************************************************************************
         * Test: Read ID API test
         **************************************************************************/
    
        /* Get SPI Flash id */
        QSPIFlash_getDeviceID(QSPIFlashHandle, &devId);
    
        if(devId.Manufacture == SPANSION_DEV)
        {
            snprintf(name, 16, "%s", "SPANSION");
        }
        else if (devId.Manufacture == MACRONIX_DEV)
        {
            snprintf(name, 16, "%s", "MACRONIX");
        }
        else
        {
            snprintf(name, 16, "%s", "UNKNOWN");
        }
    
        /* Log device information */
        snprintf(testCase, 128, "QSPIFlash Read Id API: Manufacture %s(0x%x), device type = 0x%x, capacity = 0x%x",
            name,
            devId.Manufacture,
            devId.device,
            devId.capacity);

  • It could be that you aren't initializing the pinmux correctly for the QSPI pins.  There is an SBL example in mmWave SDK 3.1.0.2, found in this directory: C:\ti\mmwave_sdk_03_01_00_02\packages\ti\utils\sbl.

    This example shows the pinmux (for 18xx) and shows how to initialize and read from the flash as well as get the device ID.  You will just need to change the pinmux names for the 1642 equivalents.

      -dave

  • Hi Dave,
    Yes, we have changed the pinmux name for our platform.
    The pinmux is correct.
    Do you have a chance to give a try?

    Thanks
  • Hi,

    Unfortunately Dave was not able to run this test.

    Please try this on your side

    I will close this thread since there has not been activity for almost a month. I apologize for that.

    If there are still issues please open a new thread

    thank you
    Cesar