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.

TMS570LC4357内部flash读写问题

Other Parts Discussed in Thread: TMS570LC4357, UNIFLASH

各位大神!我在调试TMS570LC4357内部flash时,发现flash的bank0和bank1一上电内部就随机分布一些数据,这些有数据的地址无法正常擦除和写入数据,我目前想操作bank1,但上电有数的地方我无法操作,请问这个问题怎么解决?

麻烦各位大神指点!

  • Flash Bank: A separate block of logic consisting of 1 to 16 sectors. Each flash bank normally has a customer-OTP and a TI-OTP area.

    您现在Flash Bank Sector Enable Register (FBSE)/Flash Bank Protection Register (FBPROT)是如何设置的?

    有没有使用flash API 来擦除flash试试?
  • /* Purpose : main function for flash wrapper testing
     */
    
    #include <stdio.h>
    #include <stdlib.h>
    #include "Constants.h"
    #include "Helpers.h"
    #include "Registers.h"
    #include "Types.h"
    #include "F021.h"
    
    /* added to verify the erase and program operation on EEPROM memory */
    
    
    void Fapi_BlockProgram( unsigned int Bank, unsigned int Flash_Start_Address, unsigned int Data_Start_Address, unsigned int Size_In_Bytes, unsigned int Freq_In_MHz);
    void Fapi_SectorErase( unsigned int Bank, unsigned int Flash_Start_Address, unsigned int Freq_In_MHz);
    
    void Fapi_BlockProgram( unsigned int Bank, unsigned int Flash_Start_Address, unsigned int Data_Start_Address, unsigned int Size_In_Bytes, unsigned int Freq_In_MHz)
    {
    	register unsigned int src = Data_Start_Address;
    	register unsigned int dst = Flash_Start_Address;
    	register unsigned int bytes_remain = Size_In_Bytes;
    
    	Fapi_initializeAPI((Fapi_FmcRegistersType *)0xfff87000,Freq_In_MHz);
    
    	Fapi_setActiveFlashBank(Bank);
    
     	while( bytes_remain > 0)
    	{
    		Fapi_issueProgrammingCommand((unsigned int *)dst, 
    									 (unsigned char *)src,
    									 (unsigned long) 16, 
    									 0,
    									 0,
    									 Fapi_AutoEccGeneration);
    
     		while( Fapi_checkFsmForReady() == Fapi_Status_FsmBusy );
    
    		src += 0x10;
    		dst += 0x10;
            bytes_remain -= 0x10;
        }
    
    }
    
    void Fapi_SectorErase( unsigned int Bank, unsigned int Sector_Start_Address, unsigned int Freq_In_MHz);
    {
    
    	Fapi_initializeAPI((Fapi_FmcRegistersType *)0xfff87000,Freq_In_MHz);
    
    	Fapi_setActiveFlashBank(Bank);
    
    	Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, (uint32 *)Sector_Start_Address);
    
    	while( Fapi_checkFsmForReady() == Fapi_Status_FsmBusy );
    
    }
    

  • 你好,我是用的 F021 FLASH API (02.01.01)进行flash调试的。

    其中,Flash Bank Sector Enable Register (FBSE) =  0x00000400;Flash Bank Protection Register (FBPROT) = 0x00000001;

    下面图1为写FLASH的代码:

    图2为擦FLASH的代码:

    请问哪里配置还有问题吗?flash上电部分地址有数是正常现象吗?有数的地方应如何擦除呢?

  • 关于擦除和写入,您可以看一下下面文档的3.3 Erasing Operations 以及 3.2 Programming Operations

    的示例代码

    www.ti.com/.../spna148.pdf

    “flash上电部分地址有数” 感觉不应该这样。您这个板子之前是烧录过程序吗?
  • 找了个开发板测试了一下,如下图

    板子内有预设的程序,所以flash内是有数据的

    之后使用uniflash进行擦除

    擦除后如下图所示

  • 我们现在是这样的,我们的程序通过仿真器直接下载到芯片FLASH的bank0了,从bank0的起始地址到bank0的某某地址为我们的代码,这部分地址有数据我理解,但是除了代码地址段,其他地方也随机分布着一些数据,而且我现在是要通过烧录的代码去操作bank1,bank1一上电它里面的数据是下图这样的,并不是全FF,bank0的非代码区也并不是全FF,这种现象是否正常?

  • 我看你上面用的芯片是TMS570LS43X系列的,我的芯片是TMS570LC43X系列的,这跟芯片型号有关系吗?
  • 你好,你开发板芯片型号是TMS570LS43X系列,我用的芯片是TMS570LC43X系列的,这有区别吗?

  • 请问一下,这个问题解决了吗?我现在也遇到了这个问题
  • 还没有,暂停中,如果你有新进展麻烦告知一下,谢谢!