Fixed DMA config issues for CRC && MemCpy

This commit is contained in:
Attila Body 2019-11-21 11:25:25 +01:00
parent 5e44fa81ac
commit bca15a3298
7 changed files with 54 additions and 29 deletions

View file

@ -44,10 +44,10 @@
<listOptionValue builtIn="false" value="../Inc"/> <listOptionValue builtIn="false" value="../Inc"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/> <listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc"/> <listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc"/>
<listOptionValue builtIn="false" value="../application"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F4xx/Include"/> <listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F4xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy"/> <listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy"/>
<listOptionValue builtIn="false" value="../components"/> <listOptionValue builtIn="false" value="../components"/>
<listOptionValue builtIn="false" value="../application"/>
</option> </option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1283430388" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/> <inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1283430388" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
</tool> </tool>
@ -76,11 +76,11 @@
</toolChain> </toolChain>
</folderInfo> </folderInfo>
<sourceEntries> <sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Src"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Startup"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Startup"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="application"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="application"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Src"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="components"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="components"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
</sourceEntries> </sourceEntries>
</configuration> </configuration>
</storageModule> </storageModule>
@ -131,6 +131,7 @@
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F4xx/Include"/> <listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F4xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy"/> <listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy"/>
<listOptionValue builtIn="false" value="../components"/> <listOptionValue builtIn="false" value="../components"/>
<listOptionValue builtIn="false" value="../application"/>
</option> </option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1177608374" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/> <inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1177608374" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
</tool> </tool>
@ -159,11 +160,11 @@
</toolChain> </toolChain>
</folderInfo> </folderInfo>
<sourceEntries> <sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Src"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Startup"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Startup"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="application"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="application"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Src"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="components"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="components"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
</sourceEntries> </sourceEntries>
</configuration> </configuration>
</storageModule> </storageModule>

View file

@ -1,7 +1,7 @@
[PreviousGenFiles] [PreviousGenFiles]
HeaderPath=/mnt/userdata/compi/work/private/stm32/f407ve_packetusart_c/Inc HeaderPath=/home/abody/Private/work/private/f407ve_hs_uart/projects/f407ve_packetusart_c/Inc
HeaderFiles=gpio.h;crc.h;dma.h;sys.h;usart.h;stm32f4xx_it.h;stm32_assert.h;stm32f4xx_hal_conf.h;main.h; HeaderFiles=gpio.h;crc.h;dma.h;sys.h;usart.h;stm32f4xx_it.h;stm32_assert.h;stm32f4xx_hal_conf.h;main.h;
SourcePath=/mnt/userdata/compi/work/private/stm32/f407ve_packetusart_c/Src SourcePath=/home/abody/Private/work/private/f407ve_hs_uart/projects/f407ve_packetusart_c/Src
SourceFiles=gpio.c;crc.c;dma.c;sys.c;usart.c;stm32f4xx_it.c;stm32f4xx_hal_msp.c;main.c; SourceFiles=gpio.c;crc.c;dma.c;sys.c;usart.c;stm32f4xx_it.c;stm32f4xx_hal_msp.c;main.c;
[PreviousLibFiles] [PreviousLibFiles]

View file

@ -61,16 +61,25 @@ void MX_DMA_Init(void)
LL_DMA_SetPeriphIncMode(DMA2, LL_DMA_STREAM_4, LL_DMA_PERIPH_INCREMENT); LL_DMA_SetPeriphIncMode(DMA2, LL_DMA_STREAM_4, LL_DMA_PERIPH_INCREMENT);
/* Set memory increment mode */ /* Set memory increment mode */
LL_DMA_SetMemoryIncMode(DMA2, LL_DMA_STREAM_4, LL_DMA_MEMORY_INCREMENT); LL_DMA_SetMemoryIncMode(DMA2, LL_DMA_STREAM_4, LL_DMA_MEMORY_NOINCREMENT);
/* Set peripheral data width */ /* Set peripheral data width */
LL_DMA_SetPeriphSize(DMA2, LL_DMA_STREAM_4, LL_DMA_PDATAALIGN_BYTE); LL_DMA_SetPeriphSize(DMA2, LL_DMA_STREAM_4, LL_DMA_PDATAALIGN_WORD);
/* Set memory data width */ /* Set memory data width */
LL_DMA_SetMemorySize(DMA2, LL_DMA_STREAM_4, LL_DMA_MDATAALIGN_BYTE); LL_DMA_SetMemorySize(DMA2, LL_DMA_STREAM_4, LL_DMA_MDATAALIGN_WORD);
/* Disable FIFO mode */ /* Enable FIFO mode */
LL_DMA_DisableFifoMode(DMA2, LL_DMA_STREAM_4); LL_DMA_EnableFifoMode(DMA2, LL_DMA_STREAM_4);
/* Set FIFO threshold */
LL_DMA_SetFIFOThreshold(DMA2, LL_DMA_STREAM_4, LL_DMA_FIFOTHRESHOLD_FULL);
/* Set memory burst size */
LL_DMA_SetMemoryBurstxfer(DMA2, LL_DMA_STREAM_4, LL_DMA_MBURST_SINGLE);
/* Set peripheral burst size */
LL_DMA_SetPeriphBurstxfer(DMA2, LL_DMA_STREAM_4, LL_DMA_PBURST_SINGLE);
/* Configure DMA request MEMTOMEM_DMA2_Stream3 */ /* Configure DMA request MEMTOMEM_DMA2_Stream3 */
@ -93,13 +102,22 @@ void MX_DMA_Init(void)
LL_DMA_SetMemoryIncMode(DMA2, LL_DMA_STREAM_3, LL_DMA_MEMORY_INCREMENT); LL_DMA_SetMemoryIncMode(DMA2, LL_DMA_STREAM_3, LL_DMA_MEMORY_INCREMENT);
/* Set peripheral data width */ /* Set peripheral data width */
LL_DMA_SetPeriphSize(DMA2, LL_DMA_STREAM_3, LL_DMA_PDATAALIGN_BYTE); LL_DMA_SetPeriphSize(DMA2, LL_DMA_STREAM_3, LL_DMA_PDATAALIGN_WORD);
/* Set memory data width */ /* Set memory data width */
LL_DMA_SetMemorySize(DMA2, LL_DMA_STREAM_3, LL_DMA_MDATAALIGN_BYTE); LL_DMA_SetMemorySize(DMA2, LL_DMA_STREAM_3, LL_DMA_MDATAALIGN_WORD);
/* Disable FIFO mode */ /* Enable FIFO mode */
LL_DMA_DisableFifoMode(DMA2, LL_DMA_STREAM_3); LL_DMA_EnableFifoMode(DMA2, LL_DMA_STREAM_3);
/* Set FIFO threshold */
LL_DMA_SetFIFOThreshold(DMA2, LL_DMA_STREAM_3, LL_DMA_FIFOTHRESHOLD_FULL);
/* Set memory burst size */
LL_DMA_SetMemoryBurstxfer(DMA2, LL_DMA_STREAM_3, LL_DMA_MBURST_SINGLE);
/* Set peripheral burst size */
LL_DMA_SetPeriphBurstxfer(DMA2, LL_DMA_STREAM_3, LL_DMA_PBURST_SINGLE);
/* DMA interrupt init */ /* DMA interrupt init */
/* DMA1_Stream1_IRQn interrupt configuration */ /* DMA1_Stream1_IRQn interrupt configuration */

View file

@ -27,6 +27,7 @@
/* Private includes ----------------------------------------------------------*/ /* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */ /* USER CODE BEGIN Includes */
#include "application.h"
/* USER CODE END Includes */ /* USER CODE END Includes */
@ -98,7 +99,7 @@ int main(void)
MX_USART6_UART_Init(); MX_USART6_UART_Init();
MX_CRC_Init(); MX_CRC_Init();
/* USER CODE BEGIN 2 */ /* USER CODE BEGIN 2 */
MainLoop();
/* USER CODE END 2 */ /* USER CODE END 2 */
/* Infinite loop */ /* Infinite loop */

View file

@ -9,7 +9,6 @@
#define CONFIG_H_ #define CONFIG_H_
#define USARTCOUNT 4 #define USARTCOUNT 4
#define CRCTASKCOUNT (USARTCOUNT * 2)
#define USART1_OFFSET 0 #define USART1_OFFSET 0
#define USART2_OFFSET 1 #define USART2_OFFSET 1
#define USART3_OFFSET 2 #define USART3_OFFSET 2

View file

@ -1,24 +1,30 @@
#MicroXplorer Configuration settings - do not modify #MicroXplorer Configuration settings - do not modify
Dma.MEMTOMEM.10.Direction=DMA_MEMORY_TO_MEMORY Dma.MEMTOMEM.10.Direction=DMA_MEMORY_TO_MEMORY
Dma.MEMTOMEM.10.FIFOMode=DMA_FIFOMODE_DISABLE Dma.MEMTOMEM.10.FIFOMode=DMA_FIFOMODE_ENABLE
Dma.MEMTOMEM.10.FIFOThreshold=DMA_FIFO_THRESHOLD_FULL
Dma.MEMTOMEM.10.Instance=DMA2_Stream4 Dma.MEMTOMEM.10.Instance=DMA2_Stream4
Dma.MEMTOMEM.10.MemDataAlignment=DMA_MDATAALIGN_BYTE Dma.MEMTOMEM.10.MemBurst=DMA_MBURST_SINGLE
Dma.MEMTOMEM.10.MemInc=DMA_MINC_ENABLE Dma.MEMTOMEM.10.MemDataAlignment=DMA_MDATAALIGN_WORD
Dma.MEMTOMEM.10.MemInc=DMA_MINC_DISABLE
Dma.MEMTOMEM.10.Mode=DMA_NORMAL Dma.MEMTOMEM.10.Mode=DMA_NORMAL
Dma.MEMTOMEM.10.PeriphDataAlignment=DMA_PDATAALIGN_BYTE Dma.MEMTOMEM.10.PeriphBurst=DMA_PBURST_SINGLE
Dma.MEMTOMEM.10.PeriphDataAlignment=DMA_PDATAALIGN_WORD
Dma.MEMTOMEM.10.PeriphInc=DMA_PINC_ENABLE Dma.MEMTOMEM.10.PeriphInc=DMA_PINC_ENABLE
Dma.MEMTOMEM.10.Priority=DMA_PRIORITY_LOW Dma.MEMTOMEM.10.Priority=DMA_PRIORITY_LOW
Dma.MEMTOMEM.10.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode Dma.MEMTOMEM.10.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode,FIFOThreshold,MemBurst,PeriphBurst
Dma.MEMTOMEM.11.Direction=DMA_MEMORY_TO_MEMORY Dma.MEMTOMEM.11.Direction=DMA_MEMORY_TO_MEMORY
Dma.MEMTOMEM.11.FIFOMode=DMA_FIFOMODE_DISABLE Dma.MEMTOMEM.11.FIFOMode=DMA_FIFOMODE_ENABLE
Dma.MEMTOMEM.11.FIFOThreshold=DMA_FIFO_THRESHOLD_FULL
Dma.MEMTOMEM.11.Instance=DMA2_Stream3 Dma.MEMTOMEM.11.Instance=DMA2_Stream3
Dma.MEMTOMEM.11.MemDataAlignment=DMA_MDATAALIGN_BYTE Dma.MEMTOMEM.11.MemBurst=DMA_MBURST_SINGLE
Dma.MEMTOMEM.11.MemDataAlignment=DMA_MDATAALIGN_WORD
Dma.MEMTOMEM.11.MemInc=DMA_MINC_ENABLE Dma.MEMTOMEM.11.MemInc=DMA_MINC_ENABLE
Dma.MEMTOMEM.11.Mode=DMA_NORMAL Dma.MEMTOMEM.11.Mode=DMA_NORMAL
Dma.MEMTOMEM.11.PeriphDataAlignment=DMA_PDATAALIGN_BYTE Dma.MEMTOMEM.11.PeriphBurst=DMA_PBURST_SINGLE
Dma.MEMTOMEM.11.PeriphDataAlignment=DMA_PDATAALIGN_WORD
Dma.MEMTOMEM.11.PeriphInc=DMA_PINC_ENABLE Dma.MEMTOMEM.11.PeriphInc=DMA_PINC_ENABLE
Dma.MEMTOMEM.11.Priority=DMA_PRIORITY_LOW Dma.MEMTOMEM.11.Priority=DMA_PRIORITY_LOW
Dma.MEMTOMEM.11.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode Dma.MEMTOMEM.11.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode,FIFOThreshold,MemBurst,PeriphBurst
Dma.Request0=USART6_RX Dma.Request0=USART6_RX
Dma.Request1=USART6_TX Dma.Request1=USART6_TX
Dma.Request10=MEMTOMEM Dma.Request10=MEMTOMEM