Part Number: TMS320F28P559SG-Q1
Other Parts Discussed in Thread: C2000WARE
Using the Flash API lib of C2000Ware_6_00_01_00 with F28P55x we have questions regarding the register addresses that have to be passed to the Fapi functions.
Consulting Reference Guide TMS320F28P55x Flash API Version 4.00.00.00
3.1.1 Fapi_initializeAPI() Parameters:
"poFlashControlRegister [in] Pointer to the Flash Wrapper Registers' base address. Use FlashTech_CPU0_BASE_ADDRESS."
This is only #defined in "driverlib\f28p55x\examples\flash\flash_programming_f28p55x.h" as follows:
#define FLASH_WRAPPER_PROGRAM_BASE 0x51000U /*(FLASH0CMD_BASE - 0x1000UL)*/
#define FlashTech_CPU0_BASE_ADDRESS ((Fapi_FmcRegistersType *)FLASH_WRAPPER_PROGRAM_BASE)
But is this correct? The datasheet lists no peripheral at this address. Instead, it says in "Table 7-4. Peripheral Registers Memory Map":
Structure | DriverLib Name | Base Address
FLASH_CTRL_REGS | FLASH0CTRL_BASE | 0x0005_F800
Also, I wouldn't expect the definition in the 'examples' folder, but either in driverlib/f28p55x/driverlib/inc/hw_memmap.h (where we find #define FLASH0CTRL_BASE 0x0005F800U //FLASH_CTRL_REGS), or in 'libraries\flash_api\f28p55x\include\FlashAPI' (where we find nothing).
We are porting from F2800157 with C2000Ware_MotorControl_SDK_5_00_00_00.
There, we have c2000ware\libraries\flash_api\f280015x\include\FlashAPI\hw_flash_memmap.h that has:
#define FLASH0CMD_BASE 0x00052000U
#define FLASH0CTRL_BASE 0x0005F800U
#define FLASH_WRAPPER_PROGRAM_BASE 0x51000U /*(FLASH0CMD_BASE - 0x1000UL)*/
This file is gone in 5_04_00_00 and 6_00_01_00.
"C2000Ware_6_00_01_00\driverlib\f28p55x\driverlib\inc\hw_memmap.h" contains:
#define FLASH0CTRL_BASE 0x0005F800U //FLASH_CTRL_REGS
and "C2000Ware_6_00_01_00\libraries\flash_api\f28p55x\include\FlashAPI\Constants\F28P55x.h" contains:
#define CPU0_REGISTER_ADDRESS 0x0005F800
No #defines for 0x00051000 or 0x00052000.
Q1: What is the correct address/pointer to provide to Fapi_initializeAPI(??FlashTech_CPU0_BASE_ADDRESS??), and which header file provides it?
Q2: Same question for Fapi_setupBankSectorEnable( ??FLASH_WRAPPER_PROGRAM_BASE?? + FLASH_O_CMDWEPROTx).