cancel
Showing results for 
Search instead for 
Did you mean: 

SDRAM Extended Mode Register Write

gvigelet
Associate II

I am using an STM32F769NI with a MT48H16M32LFB5-6 SDRAM chip, everything works fine. we are looking to set the drive strength to 1/4, 1/2 and full to evaluate the effect on EMC testing. From what I read in the programming manual, it states to perform a dummy read access while BA1=1 and BA=0 in order to select the extended mode register instead of the load mode register and then program the needed value. When I perform the dummy read I receive a hard fault. If anyone can help explain what needs to be done to program the extended mode registers it would be greatly appreciated.

0690X000008id91QAA.png

Our configuration is

0690X000008id96QAA.png

 /* SDRAM device configuration */

 sdramHandle.Instance = FMC_SDRAM_DEVICE;

   

 /* Timing configuration for 90Mhz as SDRAM clock frequency (System clock is up to 180Mhz) */

 Timing.LoadToActiveDelay  = 2;

 Timing.ExitSelfRefreshDelay = 8;

 Timing.SelfRefreshTime   = 3;

 Timing.RowCycleDelay    = 5;

 Timing.WriteRecoveryTime  = 2;

 Timing.RPDelay       = 2;

 Timing.RCDDelay       = 2;

  

 sdramHandle.Init.SDBank       = FMC_SDRAM_BANK1;

 sdramHandle.Init.ColumnBitsNumber  = FMC_SDRAM_COLUMN_BITS_NUM_9;

 sdramHandle.Init.RowBitsNumber   = FMC_SDRAM_ROW_BITS_NUM_11;

 sdramHandle.Init.MemoryDataWidth  = FMC_SDRAM_MEM_BUS_WIDTH_32;

 sdramHandle.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;

 sdramHandle.Init.CASLatency     = FMC_SDRAM_CAS_LATENCY_3;

 sdramHandle.Init.WriteProtection  = FMC_SDRAM_WRITE_PROTECTION_DISABLE;

 sdramHandle.Init.SDClockPeriod   = FMC_SDRAM_CLOCK_PERIOD_3;

 sdramHandle.Init.ReadBurst     = FMC_SDRAM_RBURST_ENABLE;

 sdramHandle.Init.ReadPipeDelay   = FMC_SDRAM_RPIPE_DELAY_0;

I have tried to read the address and then write the register shown below with no success

BSP_SDRAM_ReadData(0xC1800000, &data, 1);

printf("Val: 0x%08X\r\n", data);

tmpmrd = 0x0040;

Command.CommandMode      = FMC_SDRAM_CMD_LOAD_MODE;

 Command.CommandTarget     = FMC_SDRAM_CMD_TARGET_BANK1;

 Command.AutoRefreshNumber   = 1;

 Command.ModeRegisterDefinition = tmpmrd;

 HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);

Thank You,

George Vigelette

1 ACCEPTED SOLUTION

Accepted Solutions

Hard Faults because you're beyond the scope of memory

0xC0C00000 would set BA0/BA1=High

0xC0800000 woud set BA0=Low, BA1=High

0690X000008idAOQAY.jpg

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

3 REPLIES 3

Hard Faults because you're beyond the scope of memory

0xC0C00000 would set BA0/BA1=High

0xC0800000 woud set BA0=Low, BA1=High

0690X000008idAOQAY.jpg

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
gvigelet
Associate II

Thank you Clive I will give it a go.

gvigelet
Associate II

Worked like a champ thank you !!!