Hello. I'm using LAUNCHXL-F28379D and I have built a 256Mb SDRAM board connected to J9. I encountered a strange issue when I tried two methods to read/write data to EMIF1.
First, I use absolute addressing and it works well. The code looks like this:
#include "F28x_Project.h"
#include "SCI_Transmission.h"
extern void LaunchXL_F28379D_CPU1_Init(void);
float *emif_data = (float *)0x80000000;
void main(void)
{
InitSysCtrl();
LaunchXL_F28379D_CPU1_Init();
while(1)
{
*(emif_data+147) = 0.3;
}
Now, if I define an array and assign it to the EMIF1 section. For some indexes, it works well. But for other large indexes, the PC pointer lost control. It stucked from 0x3fee00 to 0x3fee04. The code is shown as follow:
#include "F28x_Project.h"
#include "SCI_Transmission.h"
extern void LaunchXL_F28379D_CPU1_Init(void);
#define SIZE 150
float emif_data[SIZE];
#pragma DATA_SECTION(emif_data, "DataLogFile");
void main(void)
{
InitSysCtrl();
LaunchXL_F28379D_CPU1_Init();
while(1)
{
emif_data[147] = 0.3;
}
I also attached my .cmd file.
PAGE 1:
EMIF1_CS0n : origin = 0x80000000, length = 0x10000000
DataLogFile : > EMIF1_CS0n , PAGE = 1
I highlighted the different parts with red color. Also, "147" is not an arbitrary value. When I change it to 146, the PC pointer doesn't lose control. But no matter what index it is, the value is not transferred into emif_data[147] correctly. So, am I doing it correctly for the second method (array)? Thanks!
Best regards.
Yang