cancel
Showing results for 
Search instead for 
Did you mean: 

Put one Buffer to SRAM1 and One Buffer to SRAM2

razi
Associate
Posted on October 26, 2015 at 13:05

Hi

The aim of my project is recording stereo audio and send audio data by uart in real time.

My device is STM32F405.

I am using SPI2 as I2S Interface in Master Half Duplex in Receiving Mode.

Sample rate = 8k and Data Width = 16. Channel = 2

So rate of input data is 32 KBps.

I have configured usart1 with 921600 baudrate, So I can about 90 KBps using usart1.

I am using DMA1 for I2s, and DMA2 for usart.

I have two buffer with same size. When I2S DMA is filling one Buffer, USART dma is transmiting another Buffer.

Audio Input is from an audio generator that generate sinoside wave. 

after I plot the data that I receive from uart I find that some sample is missed.

the problem is that two dma are working with same SRAM.

So when uart dma try to read memory, another memory hasn't access to it.

STM32F405 has two SRAM.

How can I put one buffer two SRAM1 and other buffer two SRAM2,

I think this approach can solve my problem,because two dma can work concurrently

thanks

#sram2 #sram1
3 REPLIES 3
Posted on October 26, 2015 at 13:39

Code an allocator that can pull from a specific region, or use your linker script, or scatter file, to create two RAM regions and then use a #pragma/directive to place a static assignment in one region or the other.

Review your compiler/toolchain documentation.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
razi
Associate
Posted on October 27, 2015 at 06:12

Hi

Thanks for your reply. I am using keil MDK-ARM.

I have not found any document about how can I edit scatter file.

Is there any example?

And another Question.

Is there another approach for record audio and send them by uart withot loosing any sample?

thanks again
Posted on October 27, 2015 at 23:49

I'm not sure I want to get pulled into an audio-over-usart development. I doubt your issues are DMA related.

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Make%20use%20of%20the%2064k%20CCM&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=6653

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Usage%20of%20CCM%20Data%20RAM%20in%20KEIL&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx?Paged%3DTRUE%26p_StickyPost%3D%26p_DiscussionLastUpdated%3D20140926%252010%253a32%253a21%26p_ID%3D43964%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41&currentviews=32]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Usage%20of%20CCM%20Data%20RAM%20in%20KEIL&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx?Paged%3DTRUE%26p_StickyPost%3D%26p_DiscussionLastUpdated%3D20140926%252010%253a32%253a21%26p_ID%3D43964%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41¤tviews=32

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