Hi
I am trying to implement shared RAM in the below USB project with Flash configuration .
When I step through the code , the program dies when this code is given .
while( !(MemCfgRegs.GSxMSEL.bit.MSEL_GS0))
{
EALLOW;
MemCfgRegs.GSxMSEL.bit.MSEL_GS0 = 1;
EDIS;
}
Can you tell me why this is happening and how to correct it in the below code please.
int main(void)
{
int iStatus;
char *array[80];
#ifdef _FLASH
// Copy time critical code and Flash setup code to RAM
// This includes the following functions: InitFlash();
// The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart
// symbols are created by the linker. Refer to the device .cmd file.
memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
#endif
//
// Set the clocking to run from the PLL at 50MHz
//
SysCtlClockSet(SYSCTL_OSCSRC_XTAL | SYSCTL_PLL_ENABLE | SYSCTL_IMULT(20) | SYSCTL_SYSDIV(2));
SysCtlAuxClockSet(SYSCTL_OSCSRC_XTAL | SYSCTL_PLL_ENABLE | SYSCTL_IMULT(12) | SYSCTL_SYSDIV(4));
#ifdef _FLASH
// Call Flash Initialization to setup flash waitstates
// This function must reside in RAM
InitFlash();
#endif
//
// Initially wait for device connection.
//
g_eState = STATE_NO_DEVICE;
g_eUIState = STATE_NO_DEVICE;
//
// Initialize PIE and vector table
InitPieCtrl();
InitPieVectTable();
USBGPIOEnable();
USBIntRegister(USB0_BASE, f28x_USB0HostIntHandler);
//
// Configure UART0 for debug output.
//
ConfigureUART();
UARTprintf("\n\nUSB Mass Storage Host program\n");
UARTprintf("Type \'help\' for help.\n\n");
//
// Enable Interrupts
//
IntMasterEnable();
//
// Initialize the USB stack mode and pass in a mode callback.
//
// USBStackModeSet(0, eUSBModeHost, ModeCallback);
USBStackModeSet(0, eUSBModeForceHost, ModeCallback);
//
// Register the host class drivers.
//
USBHCDRegisterDrivers(0, g_ppHostClassDrivers, NUM_CLASS_DRIVERS);
//
// Open an instance of the mass storage class driver.
//
g_psMSCInstance = USBHMSCDriveOpen(0, (tUSBHMSCCallback)MSCCallback);
//
// Initialize the power configuration. This sets the power enable signal
// to be active high and does not enable the power fault.
//
USBHCDPowerConfigInit(0, USBHCD_VBUS_AUTO_HIGH | USBHCD_VBUS_FILTER);
//
// Initialize the USB controller for OTG operation with a 2ms polling
// rate.
//
USBHCDInit(0,g_pHCDPool, HCD_MEMORY_SIZE);
//
// Initialize the file system.
//
f_mount(0, &g_sFatFs);
/* This function reads in the binary file and writes the app code to flash */
// Give Memory Access to GS0 SARAM to CPU02
while( !(MemCfgRegs.GSxMSEL.bit.MSEL_GS0))
{
EALLOW;
MemCfgRegs.GSxMSEL.bit.MSEL_GS0 = 1;
EDIS;
}
call_flashAPI();
//
// Enter an infinite loop for reading and processing commands from the
// user.
//
while(1)
{
ReadLine();
if((g_eState == STATE_DEVICE_READY)&&(consoleReset == 0))
{
ReadCpu1File = 1;
g_cCmdBuf[0] = '\0';
array[0] = "cat";
array[1] = "one.b00";
Cmd_cat(2, array);
file2readFlag = 1;
Reset_Variables();
ReadCpu2File = 1;
array[1] = "two.b00";
Cmd_cat(2, array);
}
else if((g_eState == STATE_NO_DEVICE) && (usbDisconnected == 1))
{
consoleReset = 0;
asm(" LB 0x00088000"); // Put this data in after flash functions are added
}
}
}