cancel
Showing results for 
Search instead for 
Did you mean: 

FMC-SRAM Configuration for STM32F40G-EVAL

oolongteaisflammable
Associate II

Hello there,

 

I am working on a project using an STM3240G-EVAL board which as the STM32407IGH6 MCU on it. In this project, I want to use USB-OTG-FS to connect an external USB microphone to the board and then store any information sent into the microphone into the 16 Mbit SRAM that is on the board. However, I am struggling on figuring out what pins I need to enable to get this functionality working. I am also open to hearing other ideas on how to go about this project. For example, do you suggest using DMA and ADC instead to get the microphone data. At the end of the project I need to be able to use the SRAM, an external microphone and an external speaker to playback audio as well. 


Any help would be really appreciated as I am on a little bit of a time crunch and unsure what pins to enable. I am using STMcubeIDE with STMcubeProgrammer and STMcubeMX on MAC OS to run this project. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

In CubeMx, do your selection based on the board and not on the MCU. Follow the steps in this figure:

SofLit_0-1712217553471.png

Then in "3"  double click on the board image. A Popup message will show up telling you if you need to initialize the peripherals used on the board to their default values. Click "Yes":

SofLit_1-1712217787474.png

Normally all the peripherals used on the board are initialized including the FMC and the GPIOs related to the external SRAM.

You need to to do some read/write tests to the external RAM before going ahead with your application. You can use this example for this. Note: in the example, FMC is initialized, you need to retrieve the read/write operation of the SRAM.

Tell if it does answer you question.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
SofLit
ST Employee

Hello,

As your'e using an ST board (STM3240G-EVAL) I'm wondering why you're struggling to configure the SRAM available on the board while a BSP of the board is available here.

The SRAM driver: stm324xg_eval_sram.c/stm324xg_eval_sram.h

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

There should also be schematics readily available under the "CAD Resources" tab of the Board's product page.

Its quite an old board, SPL (pre HAL) era. There was frequently bare-metal code in system_stm32f4xx.c / SystemInit() allowing for the bring-up of the external SRAM

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

Are you sure there is no HAL? because I have a stm32f4xx_hal_conf.h file and also an entire STM32F4xx_HAL_DRIVER subfolder under drivers that was generated from STMcubeMX. Sorry I am a little new to using this board and have not worked with any ST controllers in a few years. 

As I stated previously HAL is available for this board but maybe he meant the board is an old one and was available even before HAL era. If you want to use CubeMx for this board you can simply inspire from the FMC-SRAM parameters provided in the bsp driver.

Does it answer your question?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

I think that makes sense. So essentially I can just use the already existing SRAM initialization c files that are in the BSP? Or would I still have to go enable the pins on cubeMX. Because I am struggling setting the modes for some of the pins that are required for the SRAM according to the schematic given in the eval boards user manual. But it seems like you are saying that I can just look at these c files and see what parameters are being passed into them and then set the pins based off of those parameters? Sorry for the confusion. Really do appreciate all of your help

In CubeMx, do your selection based on the board and not on the MCU. Follow the steps in this figure:

SofLit_0-1712217553471.png

Then in "3"  double click on the board image. A Popup message will show up telling you if you need to initialize the peripherals used on the board to their default values. Click "Yes":

SofLit_1-1712217787474.png

Normally all the peripherals used on the board are initialized including the FMC and the GPIOs related to the external SRAM.

You need to to do some read/write tests to the external RAM before going ahead with your application. You can use this example for this. Note: in the example, FMC is initialized, you need to retrieve the read/write operation of the SRAM.

Tell if it does answer you question.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.