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.

Programming SPI flash with FlashAndBootUtils_2.40

Other Parts Discussed in Thread: OMAPL138, AM1810

Hi,

platform : customed board based on omapl138 lcdk.

flash SPI : SST25vf032b

I can't copy ubl into flash SPI with FlashAndBootUtils_2.40 tool; I get this msg :

The erase seems working good.


I changed structure hDEVICE_SPI_config with different manner.

Is it possible my flash is incompatible?

Do you know how to configure it.

Thanks

Seb

  • Hi Sebastien,

    The error seems to be you have wrongly modified the SFH tool source code and please check & review.

    Have you modified appropriate SPI bus not and CS signal in SFH tool source code ?

    I hope you have correctly , that why you are able to flash successfully without any errors (ie you able to access the SPI 

    Could you please list the changes and files name.

    Did you modified other than mentioned in below TI wiki ?

    http://processors.wiki.ti.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L138#Modifications_for_Custom_Boards

    I changed structure hDEVICE_SPI_config with different manner.

    Please explain bit or provide your changes.

  • No, about spi flash, I've just modified device_spi.c on stucture DEVICE_SPI_params (not DEVICE_SPI_config : sorry I made an errror) like this :

    const SPI_MEM_ParamsObj DEVICE_SPI_MEM_params =
    {
      SPI_MEM_TYPE_FLASH,
      24,                     // addrWidth
      256,                    // pageSize
      #ifdef AM1810
      4096,                   // sectorSize
      #else
      0,                   // sectorSize
      #endif
      64*1024,                // blockSize
      4*1024*1024 /*8*1024*1024 */            // memorySize          
    };

     

  • Hi Sebastien,

    Please ensure that you have referred the SPI data sheet and applied appropriate changes (width & size) "device_spi.c"

    Could you revert back the changes in this file and try it.

  • Hi,

    In fact, I receive 0xFF (from SPIBUF register) after each writing byte (to SPIDAT1 register) to flash.

    But I don't know why?

    See :

    Uint32 SPI_xferBytes(SPI_InfoHandle hSPIInfo, Uint32 numBytes, Uint8 *spiBuf )
    {
      VUint32 *spiTxReg;
      Uint32  i;
     
      DEVICE_SPIRegs *SPI = (DEVICE_SPIRegs *) hSPIInfo->regs;

      spiTxReg = &(SPI->SPIDAT[DEVICE_SPI_DATOFFSET]);

      // Clear any overrun conditions
      if (SPI->SPIFLG & SPI_SPIFLG_OVRNINTFLG)
      {
        spiBuf[0] = (SPI->SPIBUF);
        SPI->SPIFLG &= SPI_SPIFLG_OVRNINTFLG;  
      }
     
      // Write output data
      for (i=0; i< numBytes; i++)
      {
        // Wait for transmit ready
        while (!(SPI->SPIFLG & SPI_SPIFLG_TXINTFLAG));  
     
        // Transmit data
        *spiTxReg = spiBuf[i];
        
        while (!(SPI->SPIFLG & SPI_SPIFLG_RXINTFLAG));
        
        spiBuf[i] = (SPI->SPIBUF);
      }

      return E_PASS;
    }