cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 External SRAM problem

developerR
Associate

Hi

I am working with a STM32L496G_Discovery board and Cube IDE

I am having problems with the external ram. I have called BSP_SRAM_Init();

and defined an array in that ram space

float testInput[TEST_LENGTH_SAMPLES] __attribute__((section("._myvars")));

In my linker file I have

MEM_BASE (xrw)    : ORIGIN = 0x60000000, LENGTH = 1024K

and

._myvars(NOLOAD) : {*(._myvars)} >MEM_BASE

But I can only get NaNs in that ram space.

I did something similar with a ST32L476 EVAL board and that worked successfully

Thank you

developerR

3 REPLIES 3

NOLOAD is the NOINIT / No Initialize directive, nothing is going to get into ELF file describing the actual content.

Content would need to be directed into FLASH, you'd need to bounds the static data with symbols in the linker script, and add code in startup.s to unpack it into the the External SRAM after you've brought up the pins/interface.

Keil would do more of this automatically, but you're using GNU tools and these are a lot rougher around the edges.

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

To me, this sounds more like the FMC is not initialized properly.

Can you "see" the memory in debugger? Are FMC regsiters set appropriately?

The 'L496 Disco has a rather involved power supply scheme. Is VDD jumpered to 3.3V? Is PH0=LCD_PWR_ON set?

JW

developerR
Associate

thanks folks for your input

this was my issue

#define SRAM_DEVICE_ADDR ((uint32_t)0x60000000) eval

#define SRAM_DEVICE_ADDR ((uint32_t)0x64000000) disco