Hello,
I am looking into the use of bank 7 on the RM48 HDK flash for storage of runtime fault histories in my application. I have create a simple project in CCS v5 with a barebones HALcogen generated set of drivers. The drivers have a heartbeat output on PWM0 Het1 pin 15 only. All others are disabled.
I have taken example code that comes with v2.0 of the F021 FEE API as copied below but have not been able to successfuly show that memory at address oxF0200000 is being written to.
Can anyone help get my initialisation of the RM48 correct such that I can start saving the info to bank 7?
Thanks
Jamie
/* Include Files */
#include "sys_common.h"
#include "system.h"
/* USER CODE BEGIN (1) */
#include "f021.h"
#include "het.h"
/* USER CODE END */
/** @fn void main(void)
* @brief Application main function
* @note This function is empty by default.
*
* This function is called after startup.
* The user can use this function to implement the application.
*/
/* USER CODE BEGIN (2) */
/* USER CODE END */
void main(void)
{
/* USER CODE BEGIN (3) */
/*FEE ROUTINE */
Fapi_StatusType oReturnCheck = Fapi_Status_Success;
uint32 u32StartAddress = 0xF0200000U;
uint8 au8MainDataBuffer[16] = {0x78, 0x17, 0x19, 0x2E, 0x0A, 0xB9, 0x11, 0x70, 0x5F, 0xC1, 0x9C, 0xFD, 0x54, 0x51, 0xED, 0x86};
//uint32 u32Index;
/*
Add device specific initialization here, including, but not limited to:
pll initialization, setting up RWAIT/EWAIT value, etc.
Assumes, unless otherwise noted, device has 144bit wide Flash Banks.
*/
REGISTER(0xfff87288) = 0x00000005; /* enable writes to EWAIT register */
REGISTER(0xfff872B8) = 0x00040002; /* EWAIT=4 */
REGISTER(0xfff87288) = 0x00000002; /* disable writes to EWAIT register */
oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS,180); /* Example code is assuming operating frequency of 180 MHz */
if((oReturnCheck == Fapi_Status_Success) && (Fapi_checkFsmForReady() != Fapi_Status_FsmBusy))
{
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank7);
if(oReturnCheck == Fapi_Status_Success)
{
oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32StartAddress,au8MainDataBuffer,16,0,0,Fapi_AutoEccGeneration);
}
/* Wait for FSM to finish */
while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
/* Check the FSM Status to see if there were no errors */
if (Fapi_getFsmStatus() != 0)
{
/* Put Error handling code here */
}
}
hetInit();
while(1);
/* USER CODE END */
}