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:闪存擦除

Guru**** 2459090 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1100232/tms570lc4357-flash-erase

部件号:TMS570LC4357

仍在等待您的营销部门发送NDA,以便我们可以查看库源代码。  由于认证原因,我们不能使用F021库。

我正在尝试擦除闪存扇区,但收到PCV错误。   我是否需要以某种方式预处理闪存?   我是否正确访问未记录的FsmSector寄存器?  

测试呼叫:   

CpfSelectFlashBank(1);      //已验证:FMAC ==1.
CpfEraseSector (1,0);       //失败: PCV == 1

静态空CpfEraseSector(UINT32 uBankNum, UINT32 uSectorNum)


  断言(uBankNum=1)
  while (CpfIsBankBusy(uBankNum));//     待办:添加超时


  //设置FBSE - 1 =为WR/Erase启用扇区
  //--------------------------------------------
  cpfL2F -> Fbprot.u32Register = 1;             //启用FBSE访问
  cpfL2F -> Fbse.u32Register =(UINT32) 0xFFFF;       //启用所有扇区
  cpfL2F -> Fbprot.u32Register = 0;             //禁用FBSE访问

  CpfClearStatus();

  //仅将“写入启用”设置为要擦除的扇区
  //------------------------------------------------
  cpfL2F -> FsmWrEna.u32Register = 5;                  //启用对FSM_Sector的访问
  UINT32 umask =~(0x1万<uSectorNum);
  cpfL2F -> FsmSector.u32Register = umask;             //未记录的寄存器:高位似乎映射到FSM_SECTOR1
  cpfL2F -> FsmWrEna.u32Register = 0;                  //禁用对FSM_Sector的访问

  //将地址寄存器设置为“扇区内的任意”
  cpfL2F -> Faddr.u32Register =(0x20万 * uBankNum)+ 0x2万 * uSectorNum;

  CpfSetCmd (F021Cmd_EraseSector);    //命令= erase_sector
  CpfExecute();//                      开始
}


此致,

Mark Samarin

AFuzion公司

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Mark,您好!

     UINT32 umask =~(0x1万<uSectorNum);
     cpfL2F -> FsmSector.u32Register = umask;         

    在您的代码中寄存器FsmSector的地址偏移量是多少? 对于LC43x,应使用FSmSector1。 FsmSector1的偏移为0x2C0。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    请参阅F021库文件夹中的头文件: C:\ti\Hercules\F021 02.01 API\Flash API.01\include

    Registers_FMC_BE.h  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    如果我使用:

    cpfL2F -> FsmSector1.u32Register =~(1 << uSectorNum);      

    (我尝试了不同的事情,但没有改变)

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Mark,您好!

    您是否有闪存库的源代码?