2015-10-26 05:05 AM
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 = 2So 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 concurrentlythanks #sram2 #sram12015-10-26 05:39 AM
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.2015-10-26 10:12 PM
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 again2015-10-27 03:49 PM
I'm not sure I want to get pulled into an audio-over-usart development. I doubt your issues are DMA related.
[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¤tviews=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