2024-04-03 03:18 PM - last edited on 2024-04-04 12:56 AM by SofLit
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.
Solved! Go to Solution.
2024-04-04 01:10 AM
In CubeMx, do your selection based on the board and not on the MCU. Follow the steps in this figure:
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":
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.
2024-04-03 03:25 PM - edited 2024-04-03 03:37 PM
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
2024-04-03 04:58 PM
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
2024-04-03 05:26 PM - edited 2024-04-03 05:27 PM
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.
2024-04-03 09:35 PM
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?
2024-04-03 10:07 PM
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
2024-04-04 01:10 AM
In CubeMx, do your selection based on the board and not on the MCU. Follow the steps in this figure:
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":
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.