Part Number:TMS320F280033
手册zhcuao0b Page12 中提到
示例代码如下:
u32CurrentAddress = Bzero_Sector8_start; oReturnCheck = Fapi_issueBankEraseCommand((uint32 *)u32CurrentAddress, 0x001F); // Wait until FSM is done with bank erase operation while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady) { // // Initialize the Erase Pulses to zero after issuing max pulses // if(HWREG(FLASH0CTRL_BASE + FLASH_O_ACC_EP) > MAX_ERASE_PULSE) { EALLOW; // // Enable Flash Optimization // HWREG(FLASH0CTRL_BASE + FLASH_O_OPT) = OPT_ENABLE; HWREG(FLASH0CTRL_BASE + FLASH_O_ERA_PUL) = HWREG(FLASH0CTRL_BASE + FLASH_O_ERA_PUL) & ~(uint32_t)FLASH_ERA_PUL_MAX_ERA_PUL_M; // // Disable Flash Optimization // HWREG(FLASH0CTRL_BASE + FLASH_O_OPT) = OPT_DISABLE; EDIS; } }
代码中使用driverlib模式操作寄存器。
其中用到的几个宏定义如下(位于文件flash_programming_f28003x.h中):
#define FLASH0CTRL_BASE0x0005F800U #define FLASH0ECC_BASE0x0005FB00U // // FMC Registers, Masks and Values // #define FLASH_O_ACC_EP0x148U// Flash Accumulated Erase Pulses #define FLASH_O_ERA_PUL0x136U// Flash Max Erase Pulses #define FLASH_O_OPT0x144U// Flash Optimization #define FLASH_ERA_PUL_MAX_ERA_PUL_M0xFFFU // Flash Max Erase Pulses Mask #define OPT_ENABLE0x5U// Flash Optimization Enable #define OPT_DISABLE0x2U// Flash Optimization Disable #define MAX_ERASE_PULSE0x7D0U // Flash Max Erase Pulses
在28003x参考手册sprui33f 中FLASH0_CTRL_REGS定义如下:
参考手册中并没有偏移地址为以下几个地址的寄存器说明:
0x148U // Flash Accumulated Erase Pulses
0x136U // Flash Max Erase Pulses
0x144U // Flash Optimization
请问那里可以看到这几个寄存器的具体定义以及说明?
如果不使用driverlib,如何定义这些寄存器呢?(的f28003x_flash.h中没有定义这几个寄存器)
struct FLASH_CTRL_REGS {unionFRDCNTL_REGFRDCNTL;// Flash Read Control RegisterUint16rsvd1[28];// ReservedunionFBAC_REGFBAC;// Flash Bank Access Control RegisterunionFBFALLBACK_REGFBFALLBACK;// Flash Bank Fallback Power RegisterunionFBPRDY_REGFBPRDY;// Flash Bank Pump Ready RegisterunionFPAC1_REGFPAC1;// Flash Pump Access Control Register 1unionFPAC2_REGFPAC2;// Flash Pump Access Control Register 2Uint16rsvd2[2];// ReservedunionFMSTAT_REGFMSTAT;// Flash Module Status RegisterUint16rsvd3[340];// ReservedunionFRD_INTF_CTRL_REGFRD_INTF_CTRL;// Flash Read Interface Control Register };
BarbiQ -:
可供参考的文档:
https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1048528/implementation-for-fapi_issuebankerasecommand
,
Ben Qin:
你好,我需要咨询下相关工程师,一旦有回复会立即回复您。
,
Ben Qin:
参考下工程师的回复:
These registers are not part of the flash read interface. Hence they are not documented in the TRM section that you posted.
We did not want customers to modify that code to ensure that bank erase gets exited without any fault. However, if the customer is not using driverlib, we can provide the details to them offline.
,
BarbiQ -:
谢谢。如何才能得到不使用driverlib的详细资料呢?
,
Ben Qin:
我帮你问一下,一旦得到回复就会立即回复给您。
,
Ben Qin:
已向您发送好友申请,我们通过好友交流吧。