From d2adff88d6a515662076df86fbd159a7ff6c64d4 Mon Sep 17 00:00:00 2001 From: Attila BODY Date: Sun, 15 Nov 2020 00:01:00 +0100 Subject: [PATCH 1/5] Embedded package update --- .cproject | 2 + .mxproject | 14 +- .project | 1 + .../Device/ST/STM32F4xx/Include/stm32f407xx.h | 28 +--- .../Device/ST/STM32F4xx/Include/stm32f4xx.h | 32 ++--- .../Inc/Legacy/stm32_hal_legacy.h | 22 +-- .../Inc/stm32f4xx_hal_exti.h | 4 +- .../Inc/stm32f4xx_ll_gpio.h | 5 +- .../STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c | 4 +- .../Src/stm32f4xx_hal_rcc.c | 2 +- F407_test.ioc | 15 +- Inc/gpio.h | 4 +- Inc/main.h | 1 - Inc/stm32_assert.h | 2 +- Inc/stm32f4xx_hal_conf.h | 131 ++++++++++++------ Inc/stm32f4xx_it.h | 2 +- Src/dma.c | 4 +- Src/fsmc.c | 24 ++-- Src/gpio.c | 6 +- Src/main.c | 13 +- Src/spi.c | 6 +- Src/stm32f4xx_it.c | 8 +- Src/usart.c | 8 +- 23 files changed, 169 insertions(+), 169 deletions(-) diff --git a/.cproject b/.cproject index 862f96a..c2a27bb 100644 --- a/.cproject +++ b/.cproject @@ -10,6 +10,7 @@ + @@ -122,6 +123,7 @@ + diff --git a/.mxproject b/.mxproject index 43de001..1d147c4 100644 --- a/.mxproject +++ b/.mxproject @@ -1,14 +1,14 @@ -[PreviousGenFiles] -HeaderPath=/home/abody/Private/work/private/F407_test/Inc -HeaderFiles=stm32f4xx_it.h;stm32f4xx_hal_conf.h;main.h;stm32_assert.h;gpio.h;fsmc.h;usart.h;dma.h;crc.h;spi.h; -SourcePath=/home/abody/Private/work/private/F407_test/Src -SourceFiles=stm32f4xx_it.c;stm32f4xx_hal_msp.c;main.c;gpio.c;fsmc.c;usart.c;dma.c;crc.c;spi.c; - [PreviousLibFiles] LibFiles=Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_system.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_crc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_bus.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_utils.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dmamux.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_fsmc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sram.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usart.h;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_crc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_system.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_crc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_bus.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_utils.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dmamux.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_fsmc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sram.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usart.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/tz_context.h; [PreviousUsedCubeIDEFiles] SourceFiles=Src/main.c;Src/gpio.c;Src/crc.c;Src/dma.c;Src/fsmc.c;Src/spi.c;Src/usart.c;Src/stm32f4xx_it.c;Src/stm32f4xx_hal_msp.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_crc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c;Src/system_stm32f4xx.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_crc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c;Src/system_stm32f4xx.c;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;; HeaderPath=Drivers/STM32F4xx_HAL_Driver/Inc;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;Drivers/CMSIS/Device/ST/STM32F4xx/Include;Drivers/CMSIS/Include;Inc; -CDefines=USE_FULL_LL_DRIVER;USE_HAL_DRIVER;STM32F407xx;USE_HAL_DRIVER;USE_HAL_DRIVER; +CDefines=USE_FULL_LL_DRIVER;USE_HAL_DRIVER;STM32F407xx;USE_FULL_LL_DRIVER;USE_HAL_DRIVER;USE_HAL_DRIVER; + +[PreviousGenFiles] +HeaderPath=/mnt/userdata/compi/work/private/stm32/F407_test/Inc +HeaderFiles=gpio.h;crc.h;dma.h;fsmc.h;spi.h;usart.h;stm32f4xx_it.h;stm32_assert.h;stm32f4xx_hal_conf.h;main.h; +SourcePath=/mnt/userdata/compi/work/private/stm32/F407_test/Src +SourceFiles=gpio.c;crc.c;dma.c;fsmc.c;spi.c;usart.c;stm32f4xx_it.c;stm32f4xx_hal_msp.c;main.c; diff --git a/.project b/.project index 3026211..643bbba 100644 --- a/.project +++ b/.project @@ -27,5 +27,6 @@ org.eclipse.cdt.managedbuilder.core.managedBuildNature org.eclipse.cdt.managedbuilder.core.ScannerConfigNature org.eclipse.cdt.core.ccnature + com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature diff --git a/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h b/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h index 62813a2..08e4f53 100644 --- a/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h +++ b/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h @@ -12,29 +12,13 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2017 STMicroelectronics

+ *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

* - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ diff --git a/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h b/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h index d61f013..a7377d4 100644 --- a/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h +++ b/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h @@ -16,29 +16,13 @@ ****************************************************************************** * @attention * - *

© COPYRIGHT(c) 2017 STMicroelectronics

+ *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

* - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ @@ -122,11 +106,11 @@ #endif /* USE_HAL_DRIVER */ /** - * @brief CMSIS version number V2.6.4 + * @brief CMSIS version number V2.6.5 */ #define __STM32F4xx_CMSIS_VERSION_MAIN (0x02U) /*!< [31:24] main version */ #define __STM32F4xx_CMSIS_VERSION_SUB1 (0x06U) /*!< [23:16] sub1 version */ -#define __STM32F4xx_CMSIS_VERSION_SUB2 (0x04U) /*!< [15:8] sub2 version */ +#define __STM32F4xx_CMSIS_VERSION_SUB2 (0x05U) /*!< [15:8] sub2 version */ #define __STM32F4xx_CMSIS_VERSION_RC (0x00U) /*!< [7:0] release candidate */ #define __STM32F4xx_CMSIS_VERSION ((__STM32F4xx_CMSIS_VERSION_MAIN << 24)\ |(__STM32F4xx_CMSIS_VERSION_SUB1 << 16)\ diff --git a/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h b/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h index 9bc45bb..2d265fb 100644 --- a/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h +++ b/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h @@ -241,7 +241,7 @@ #define DAC_CHIPCONNECT_ENABLE DAC_CHIPCONNECT_INTERNAL #endif -#if defined(STM32L1) || defined(STM32L4) || defined(STM32G0) || defined(STM32H7) || defined(STM32F4) +#if defined(STM32L1) || defined(STM32L4) || defined(STM32G0) || defined(STM32L5) || defined(STM32H7) || defined(STM32F4) #define HAL_DAC_MSP_INIT_CB_ID HAL_DAC_MSPINIT_CB_ID #define HAL_DAC_MSP_DEINIT_CB_ID HAL_DAC_MSPDEINIT_CB_ID #endif @@ -955,7 +955,7 @@ #define OPAMP_PGACONNECT_VM0 OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0 #define OPAMP_PGACONNECT_VM1 OPAMP_PGA_CONNECT_INVERTINGINPUT_IO1 -#if defined(STM32L1) || defined(STM32L4) || defined(STM32H7) +#if defined(STM32L1) || defined(STM32L4) || defined(STM32L5) || defined(STM32H7) #define HAL_OPAMP_MSP_INIT_CB_ID HAL_OPAMP_MSPINIT_CB_ID #define HAL_OPAMP_MSP_DEINIT_CB_ID HAL_OPAMP_MSPDEINIT_CB_ID #endif @@ -1531,18 +1531,18 @@ #define HAL_I2CFastModePlusConfig(SYSCFG_I2CFastModePlus, cmd) (((cmd)==ENABLE)? HAL_I2CEx_EnableFastModePlus(SYSCFG_I2CFastModePlus): HAL_I2CEx_DisableFastModePlus(SYSCFG_I2CFastModePlus)) -#if defined(STM32H7) || defined(STM32WB) || defined(STM32G0) || defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) || defined(STM32G4) +#if defined(STM32H7) || defined(STM32WB) || defined(STM32G0) || defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) || defined(STM32L5) || defined(STM32G4) #define HAL_I2C_Master_Sequential_Transmit_IT HAL_I2C_Master_Seq_Transmit_IT #define HAL_I2C_Master_Sequential_Receive_IT HAL_I2C_Master_Seq_Receive_IT #define HAL_I2C_Slave_Sequential_Transmit_IT HAL_I2C_Slave_Seq_Transmit_IT #define HAL_I2C_Slave_Sequential_Receive_IT HAL_I2C_Slave_Seq_Receive_IT -#endif /* STM32H7 || STM32WB || STM32G0 || STM32F0 || STM32F1 || STM32F2 || STM32F3 || STM32F4 || STM32F7 || STM32L0 || STM32L4 || STM32G4 */ -#if defined(STM32H7) || defined(STM32WB) || defined(STM32G0) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) || defined(STM32G4) +#endif /* STM32H7 || STM32WB || STM32G0 || STM32F0 || STM32F1 || STM32F2 || STM32F3 || STM32F4 || STM32F7 || STM32L0 || STM32L4 || STM32L5 || STM32G4 */ +#if defined(STM32H7) || defined(STM32WB) || defined(STM32G0) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) || defined(STM32L5) || defined(STM32G4) #define HAL_I2C_Master_Sequential_Transmit_DMA HAL_I2C_Master_Seq_Transmit_DMA #define HAL_I2C_Master_Sequential_Receive_DMA HAL_I2C_Master_Seq_Receive_DMA #define HAL_I2C_Slave_Sequential_Transmit_DMA HAL_I2C_Slave_Seq_Transmit_DMA #define HAL_I2C_Slave_Sequential_Receive_DMA HAL_I2C_Slave_Seq_Receive_DMA -#endif /* STM32H7 || STM32WB || STM32G0 || STM32F4 || STM32F7 || STM32L0 || STM32L4 || STM32G4 */ +#endif /* STM32H7 || STM32WB || STM32G0 || STM32F4 || STM32F7 || STM32L0 || STM32L4 || STM32L5 || STM32G4 */ #if defined(STM32F4) #define HAL_FMPI2C_Master_Sequential_Transmit_IT HAL_FMPI2C_Master_Seq_Transmit_IT @@ -3245,7 +3245,7 @@ #if defined(STM32L4) #define RCC_RTCCLKSOURCE_NO_CLK RCC_RTCCLKSOURCE_NONE -#elif defined(STM32WB) || defined(STM32G0) || defined(STM32G4) +#elif defined(STM32WB) || defined(STM32G0) || defined(STM32G4) || defined(STM32L5) #else #define RCC_RTCCLKSOURCE_NONE RCC_RTCCLKSOURCE_NO_CLK #endif @@ -3373,7 +3373,7 @@ /** @defgroup HAL_RTC_Aliased_Macros HAL RTC Aliased Macros maintained for legacy purpose * @{ */ -#if defined (STM32G0) || defined (STM32L412xx) || defined (STM32L422xx) || defined (STM32G4) +#if defined (STM32G0) || defined (STM32L5) || defined (STM32L412xx) || defined (STM32L422xx) || defined (STM32L4P5xx) || defined (STM32L4Q5xx) || defined (STM32G4) #else #define __HAL_RTC_CLEAR_FLAG __HAL_RTC_EXTI_CLEAR_FLAG #endif @@ -3496,7 +3496,7 @@ #define HAL_SD_CardStateTypedef HAL_SD_CardStateTypeDef #endif -#if defined(STM32H7) +#if defined(STM32H7) || defined(STM32L5) #define HAL_MMCEx_Read_DMADoubleBuffer0CpltCallback HAL_MMCEx_Read_DMADoubleBuf0CpltCallback #define HAL_MMCEx_Read_DMADoubleBuffer1CpltCallback HAL_MMCEx_Read_DMADoubleBuf1CpltCallback #define HAL_MMCEx_Write_DMADoubleBuffer0CpltCallback HAL_MMCEx_Write_DMADoubleBuf0CpltCallback @@ -3751,9 +3751,9 @@ /** @defgroup HAL_QSPI_Aliased_Macros HAL QSPI Aliased Macros maintained for legacy purpose * @{ */ -#if defined (STM32L4) +#if defined (STM32L4) || defined (STM32F4) || defined (STM32F7) #define HAL_QPSI_TIMEOUT_DEFAULT_VALUE HAL_QSPI_TIMEOUT_DEFAULT_VALUE -#endif +#endif /* STM32L4 || STM32F4 || STM32F7 */ /** * @} */ diff --git a/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h b/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h index c1e02a4..73bb134 100644 --- a/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h +++ b/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h @@ -253,9 +253,7 @@ typedef struct #define IS_EXTI_TRIGGER(__LINE__) (((__LINE__) & ~EXTI_TRIGGER_MASK) == 0x00u) -#define IS_EXTI_PENDING_EDGE(__LINE__) (((__LINE__) == EXTI_TRIGGER_FALLING) || \ - ((__LINE__) == EXTI_TRIGGER_RISING) || \ - ((__LINE__) == EXTI_TRIGGER_RISING_FALLING)) +#define IS_EXTI_PENDING_EDGE(__LINE__) ((__LINE__) == EXTI_TRIGGER_RISING_FALLING) #define IS_EXTI_CONFIG_LINE(__LINE__) (((__LINE__) & EXTI_CONFIG) != 0x00u) diff --git a/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h b/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h index 51b0170..f5135d7 100644 --- a/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h +++ b/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h @@ -340,11 +340,10 @@ __STATIC_INLINE uint32_t LL_GPIO_GetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin) * @arg @ref LL_GPIO_OUTPUT_OPENDRAIN * @retval None */ -__STATIC_INLINE void LL_GPIO_SetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t OutputType) +__STATIC_INLINE void LL_GPIO_SetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t PinMask, uint32_t OutputType) { - MODIFY_REG(GPIOx->OTYPER, (GPIO_OTYPER_OT_0 << POSITION_VAL(Pin)), (OutputType << POSITION_VAL(Pin))); + MODIFY_REG(GPIOx->OTYPER, PinMask, (PinMask * OutputType)); } - /** * @brief Return gpio output type for several pins on dedicated port. diff --git a/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c b/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c index e73822f..b9a4546 100644 --- a/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c +++ b/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c @@ -50,11 +50,11 @@ * @{ */ /** - * @brief STM32F4xx HAL Driver version number V1.7.7 + * @brief STM32F4xx HAL Driver version number V1.7.10 */ #define __STM32F4xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */ #define __STM32F4xx_HAL_VERSION_SUB1 (0x07U) /*!< [23:16] sub1 version */ -#define __STM32F4xx_HAL_VERSION_SUB2 (0x07U) /*!< [15:8] sub2 version */ +#define __STM32F4xx_HAL_VERSION_SUB2 (0x0AU) /*!< [15:8] sub2 version */ #define __STM32F4xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */ #define __STM32F4xx_HAL_VERSION ((__STM32F4xx_HAL_VERSION_MAIN << 24U)\ |(__STM32F4xx_HAL_VERSION_SUB1 << 16U)\ diff --git a/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c b/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c index 004f686..f63dea4 100644 --- a/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c +++ b/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c @@ -539,7 +539,7 @@ __weak HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruc else { /* Do not return HAL_ERROR if request repeats the current configuration */ - pll_config = RCC->CFGR; + pll_config = RCC->PLLCFGR; if((READ_BIT(pll_config, RCC_PLLCFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) || (READ_BIT(pll_config, RCC_PLLCFGR_PLLM) != RCC_OscInitStruct->PLL.PLLM) || (READ_BIT(pll_config, RCC_PLLCFGR_PLLN) != RCC_OscInitStruct->PLL.PLLN) || diff --git a/F407_test.ioc b/F407_test.ioc index d0f18b5..f7cf832 100644 --- a/F407_test.ioc +++ b/F407_test.ioc @@ -98,8 +98,8 @@ Mcu.PinsNb=40 Mcu.ThirdPartyNb=0 Mcu.UserConstants= Mcu.UserName=STM32F407VETx -MxCube.Version=5.5.0 -MxDb.Version=DB.5.0.50 +MxCube.Version=6.0.0 +MxDb.Version=DB.6.0.0 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false NVIC.DMA2_Stream2_IRQn=true\:0\:0\:false\:false\:true\:false\:true NVIC.DMA2_Stream4_IRQn=true\:0\:0\:false\:false\:true\:true\:true @@ -155,14 +155,6 @@ PC5.GPIOParameters=GPIO_Label PC5.GPIO_Label=PENIRQ PC5.Locked=true PC5.Signal=GPIO_Input -PCC.Checker=false -PCC.Line=STM32F407/417 -PCC.MCU=STM32F407V(E-G)Tx -PCC.PartNumber=STM32F407VETx -PCC.Seq0=0 -PCC.Series=STM32F4 -PCC.Temperature=25 -PCC.Vdd=3.3 PD0.Mode=16b-d1 PD0.Signal=FSMC_D2 PD1.Mode=16b-d1 @@ -225,7 +217,7 @@ ProjectManager.CustomerFirmwarePackage= ProjectManager.DefaultFWLocation=true ProjectManager.DeletePrevious=true ProjectManager.DeviceId=STM32F407VETx -ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.24.2 +ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.25.2 ProjectManager.FreePins=false ProjectManager.HalAssertFull=false ProjectManager.HeapSize=0x200 @@ -238,6 +230,7 @@ ProjectManager.PreviousToolchain= ProjectManager.ProjectBuild=false ProjectManager.ProjectFileName=F407_test.ioc ProjectManager.ProjectName=F407_test +ProjectManager.RegisterCallBack= ProjectManager.StackSize=0x400 ProjectManager.TargetToolchain=STM32CubeIDE ProjectManager.ToolChainLocation= diff --git a/Inc/gpio.h b/Inc/gpio.h index 6a60e56..54995f3 100644 --- a/Inc/gpio.h +++ b/Inc/gpio.h @@ -1,8 +1,8 @@ /** ****************************************************************************** * File Name : gpio.h - * Description : This file contains all the functions prototypes for - * the gpio + * Description : This file contains all the functions prototypes for + * the gpio ****************************************************************************** * @attention * diff --git a/Inc/main.h b/Inc/main.h index 7cba1a0..443bf3f 100644 --- a/Inc/main.h +++ b/Inc/main.h @@ -35,7 +35,6 @@ extern "C" { #include "stm32f4xx_ll_spi.h" #include "stm32f4xx_ll_usart.h" #include "stm32f4xx_ll_rcc.h" -#include "stm32f4xx.h" #include "stm32f4xx_ll_system.h" #include "stm32f4xx_ll_gpio.h" #include "stm32f4xx_ll_exti.h" diff --git a/Inc/stm32_assert.h b/Inc/stm32_assert.h index 8cc8064..ca09699 100644 --- a/Inc/stm32_assert.h +++ b/Inc/stm32_assert.h @@ -5,7 +5,7 @@ ****************************************************************************** * @attention * - *

© Copyright (c) 2018 STMicroelectronics. + *

© Copyright (c) 2018 STMicroelectronics. * All rights reserved.

* * This software component is licensed by ST under BSD 3-Clause license, diff --git a/Inc/stm32f4xx_hal_conf.h b/Inc/stm32f4xx_hal_conf.h index 39247a8..d019e0e 100644 --- a/Inc/stm32f4xx_hal_conf.h +++ b/Inc/stm32f4xx_hal_conf.h @@ -2,7 +2,7 @@ ****************************************************************************** * @file stm32f4xx_hal_conf_template.h * @author MCD Application Team - * @brief HAL configuration template file. + * @brief HAL configuration template file. * This file should be copied to the application folder and renamed * to stm32f4xx_hal_conf.h. ****************************************************************************** @@ -17,7 +17,7 @@ * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** - */ + */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_HAL_CONF_H @@ -32,14 +32,15 @@ /* ########################## Module Selection ############################## */ /** - * @brief This is the list of modules to be used in the HAL driver + * @brief This is the list of modules to be used in the HAL driver */ -#define HAL_MODULE_ENABLED +#define HAL_MODULE_ENABLED /* #define HAL_ADC_MODULE_ENABLED */ /* #define HAL_CRYP_MODULE_ENABLED */ /* #define HAL_CAN_MODULE_ENABLED */ /* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ /* #define HAL_CRYP_MODULE_ENABLED */ /* #define HAL_DAC_MODULE_ENABLED */ /* #define HAL_DCMI_MODULE_ENABLED */ @@ -90,9 +91,9 @@ /** * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). + * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ @@ -103,7 +104,7 @@ /** * @brief Internal High Speed oscillator (HSI) value. * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). + * (when HSI is used as system clock source, directly or through the PLL). */ #if !defined (HSI_VALUE) #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ @@ -112,7 +113,7 @@ /** * @brief Internal Low Speed oscillator (LSI) value. */ -#if !defined (LSI_VALUE) +#if !defined (LSI_VALUE) #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz The real value may vary depending on the variations @@ -130,8 +131,8 @@ /** * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. */ #if !defined (EXTERNAL_CLOCK_VALUE) #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ @@ -144,16 +145,55 @@ /** * @brief This is the HAL system configuration section */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U #define PREFETCH_ENABLE 1U #define INSTRUCTION_CACHE_ENABLE 1U #define DATA_CACHE_ENABLE 1U +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + /* ########################## Assert Selection ############################## */ /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the + * @brief Uncomment the line below to expanse the "assert_param" macro in the * HAL drivers code */ /* #define USE_FULL_ASSERT 1U */ @@ -170,7 +210,7 @@ #define MAC_ADDR4 0U #define MAC_ADDR5 0U -/* Definition of the Ethernet driver buffers size and count */ +/* Definition of the Ethernet driver buffers size and count */ #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ #define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ @@ -178,9 +218,9 @@ /* Section 2: PHY configuration section */ -/* DP83848_PHY_ADDRESS Address*/ +/* DP83848_PHY_ADDRESS Address*/ #define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ #define PHY_RESET_DELAY ((uint32_t)0x000000FFU) /* PHY Configuration delay */ #define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) @@ -192,7 +232,7 @@ #define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ #define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - + #define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ #define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ #define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ @@ -207,7 +247,7 @@ #define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ #define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ #define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - + /* Section 4: Extended PHY Registers */ #define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ @@ -225,25 +265,25 @@ /* Includes ------------------------------------------------------------------*/ /** - * @brief Include module's header file + * @brief Include module's header file */ #ifdef HAL_RCC_MODULE_ENABLED #include "stm32f4xx_hal_rcc.h" #endif /* HAL_RCC_MODULE_ENABLED */ -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - #ifdef HAL_GPIO_MODULE_ENABLED #include "stm32f4xx_hal_gpio.h" #endif /* HAL_GPIO_MODULE_ENABLED */ +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + #ifdef HAL_DMA_MODULE_ENABLED #include "stm32f4xx_hal_dma.h" #endif /* HAL_DMA_MODULE_ENABLED */ - + #ifdef HAL_CORTEX_MODULE_ENABLED #include "stm32f4xx_hal_cortex.h" #endif /* HAL_CORTEX_MODULE_ENABLED */ @@ -256,18 +296,18 @@ #include "stm32f4xx_hal_can.h" #endif /* HAL_CAN_MODULE_ENABLED */ +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f4xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + #ifdef HAL_CRC_MODULE_ENABLED #include "stm32f4xx_hal_crc.h" #endif /* HAL_CRC_MODULE_ENABLED */ #ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" + #include "stm32f4xx_hal_cryp.h" #endif /* HAL_CRYP_MODULE_ENABLED */ -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32f4xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - #ifdef HAL_DMA2D_MODULE_ENABLED #include "stm32f4xx_hal_dma2d.h" #endif /* HAL_DMA2D_MODULE_ENABLED */ @@ -287,7 +327,7 @@ #ifdef HAL_FLASH_MODULE_ENABLED #include "stm32f4xx_hal_flash.h" #endif /* HAL_FLASH_MODULE_ENABLED */ - + #ifdef HAL_SRAM_MODULE_ENABLED #include "stm32f4xx_hal_sram.h" #endif /* HAL_SRAM_MODULE_ENABLED */ @@ -302,11 +342,11 @@ #ifdef HAL_PCCARD_MODULE_ENABLED #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - +#endif /* HAL_PCCARD_MODULE_ENABLED */ + #ifdef HAL_SDRAM_MODULE_ENABLED #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ +#endif /* HAL_SDRAM_MODULE_ENABLED */ #ifdef HAL_HASH_MODULE_ENABLED #include "stm32f4xx_hal_hash.h" @@ -316,6 +356,10 @@ #include "stm32f4xx_hal_i2c.h" #endif /* HAL_I2C_MODULE_ENABLED */ +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + #ifdef HAL_I2S_MODULE_ENABLED #include "stm32f4xx_hal_i2s.h" #endif /* HAL_I2S_MODULE_ENABLED */ @@ -348,10 +392,6 @@ #include "stm32f4xx_hal_sd.h" #endif /* HAL_SD_MODULE_ENABLED */ -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - #ifdef HAL_SPI_MODULE_ENABLED #include "stm32f4xx_hal_spi.h" #endif /* HAL_SPI_MODULE_ENABLED */ @@ -387,7 +427,7 @@ #ifdef HAL_HCD_MODULE_ENABLED #include "stm32f4xx_hal_hcd.h" #endif /* HAL_HCD_MODULE_ENABLED */ - + #ifdef HAL_DSI_MODULE_ENABLED #include "stm32f4xx_hal_dsi.h" #endif /* HAL_DSI_MODULE_ENABLED */ @@ -415,14 +455,18 @@ #ifdef HAL_LPTIM_MODULE_ENABLED #include "stm32f4xx_hal_lptim.h" #endif /* HAL_LPTIM_MODULE_ENABLED */ - + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function + * @param expr If expr is false, it calls assert_failed function * which reports the name of the source file and the source - * line number of the call that failed. + * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ @@ -431,13 +475,12 @@ void assert_failed(uint8_t* file, uint32_t line); #else #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ +#endif /* USE_FULL_ASSERT */ #ifdef __cplusplus } #endif #endif /* __STM32F4xx_HAL_CONF_H */ - /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/Inc/stm32f4xx_it.h b/Inc/stm32f4xx_it.h index f4df838..7b72f56 100644 --- a/Inc/stm32f4xx_it.h +++ b/Inc/stm32f4xx_it.h @@ -24,7 +24,7 @@ #ifdef __cplusplus extern "C" { -#endif +#endif /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ diff --git a/Src/dma.c b/Src/dma.c index c135753..730990d 100644 --- a/Src/dma.c +++ b/Src/dma.c @@ -32,10 +32,10 @@ /* USER CODE END 1 */ -/** +/** * Enable DMA controller clock */ -void MX_DMA_Init(void) +void MX_DMA_Init(void) { /* Init with LL driver */ diff --git a/Src/fsmc.c b/Src/fsmc.c index ed627a8..4550ae3 100644 --- a/Src/fsmc.c +++ b/Src/fsmc.c @@ -81,8 +81,8 @@ static void HAL_FSMC_MspInit(void){ /* Peripheral clock enable */ __HAL_RCC_FSMC_CLK_ENABLE(); - - /** FSMC GPIO Configuration + + /** FSMC GPIO Configuration PE7 ------> FSMC_D4 PE8 ------> FSMC_D5 PE9 ------> FSMC_D6 @@ -105,8 +105,8 @@ static void HAL_FSMC_MspInit(void){ PD7 ------> FSMC_NE1 */ /* GPIO_InitStruct */ - GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10 - |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14 + GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10 + |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14 |GPIO_PIN_15; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; @@ -116,8 +116,8 @@ static void HAL_FSMC_MspInit(void){ HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); /* GPIO_InitStruct */ - GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_13 - |GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1 + GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_13 + |GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1 |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_7; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; @@ -153,8 +153,8 @@ static void HAL_FSMC_MspDeInit(void){ FSMC_DeInitialized = 1; /* Peripheral clock enable */ __HAL_RCC_FSMC_CLK_DISABLE(); - - /** FSMC GPIO Configuration + + /** FSMC GPIO Configuration PE7 ------> FSMC_D4 PE8 ------> FSMC_D5 PE9 ------> FSMC_D6 @@ -177,12 +177,12 @@ static void HAL_FSMC_MspDeInit(void){ PD7 ------> FSMC_NE1 */ - HAL_GPIO_DeInit(GPIOE, GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10 - |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14 + HAL_GPIO_DeInit(GPIOE, GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10 + |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14 |GPIO_PIN_15); - HAL_GPIO_DeInit(GPIOD, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_13 - |GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1 + HAL_GPIO_DeInit(GPIOD, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_13 + |GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1 |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_7); /* USER CODE BEGIN FSMC_MspDeInit 1 */ diff --git a/Src/gpio.c b/Src/gpio.c index 51db2dd..2a9f139 100644 --- a/Src/gpio.c +++ b/Src/gpio.c @@ -30,9 +30,9 @@ /* USER CODE END 1 */ -/** Configure pins as - * Analog - * Input +/** Configure pins as + * Analog + * Input * Output * EVENT_OUT * EXTI diff --git a/Src/main.c b/Src/main.c index 1af644f..ad94dbd 100644 --- a/Src/main.c +++ b/Src/main.c @@ -17,7 +17,6 @@ ****************************************************************************** */ /* USER CODE END Header */ - /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "crc.h" @@ -74,7 +73,6 @@ int main(void) /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ - /* MCU Configuration--------------------------------------------------------*/ @@ -102,8 +100,6 @@ int main(void) /* USER CODE BEGIN 2 */ MainLoop(); /* USER CODE END 2 */ - - /* Infinite loop */ /* USER CODE BEGIN WHILE */ @@ -125,11 +121,12 @@ void SystemClock_Config(void) RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - /** Configure the main internal regulator output voltage + /** Configure the main internal regulator output voltage */ __HAL_RCC_PWR_CLK_ENABLE(); __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - /** Initializes the CPU, AHB and APB busses clocks + /** Initializes the RCC Oscillators according to the specified parameters + * in the RCC_OscInitTypeDef structure. */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; @@ -143,7 +140,7 @@ void SystemClock_Config(void) { Error_Handler(); } - /** Initializes the CPU, AHB and APB busses clocks + /** Initializes the CPU, AHB and APB buses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; @@ -183,7 +180,7 @@ void Error_Handler(void) * @retval None */ void assert_failed(uint8_t *file, uint32_t line) -{ +{ /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ diff --git a/Src/spi.c b/Src/spi.c index 22f5ca9..293b9b5 100644 --- a/Src/spi.c +++ b/Src/spi.c @@ -33,12 +33,12 @@ void MX_SPI2_Init(void) /* Peripheral clock enable */ LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_SPI2); - + LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOB); - /**SPI2 GPIO Configuration + /**SPI2 GPIO Configuration PB13 ------> SPI2_SCK PB14 ------> SPI2_MISO - PB15 ------> SPI2_MOSI + PB15 ------> SPI2_MOSI */ GPIO_InitStruct.Pin = LL_GPIO_PIN_13|LL_GPIO_PIN_14|LL_GPIO_PIN_15; GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; diff --git a/Src/stm32f4xx_it.c b/Src/stm32f4xx_it.c index 68d5f0b..69db5a0 100644 --- a/Src/stm32f4xx_it.c +++ b/Src/stm32f4xx_it.c @@ -64,7 +64,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -220,7 +220,7 @@ void DMA2_Stream2_IRQHandler(void) /* USER CODE BEGIN DMA2_Stream2_IRQn 0 */ HandleConsoleRxDmaIrq(); /* USER CODE END DMA2_Stream2_IRQn 0 */ - + /* USER CODE BEGIN DMA2_Stream2_IRQn 1 */ /* USER CODE END DMA2_Stream2_IRQn 1 */ @@ -234,7 +234,7 @@ void DMA2_Stream4_IRQHandler(void) /* USER CODE BEGIN DMA2_Stream4_IRQn 0 */ HandleLcdDmaIrq(); /* USER CODE END DMA2_Stream4_IRQn 0 */ - + /* USER CODE BEGIN DMA2_Stream4_IRQn 1 */ /* USER CODE END DMA2_Stream4_IRQn 1 */ @@ -248,7 +248,7 @@ void DMA2_Stream7_IRQHandler(void) /* USER CODE BEGIN DMA2_Stream7_IRQn 0 */ HandleConsoleTxDmaIrq(); /* USER CODE END DMA2_Stream7_IRQn 0 */ - + /* USER CODE BEGIN DMA2_Stream7_IRQn 1 */ /* USER CODE END DMA2_Stream7_IRQn 1 */ diff --git a/Src/usart.c b/Src/usart.c index e400185..c498a96 100644 --- a/Src/usart.c +++ b/Src/usart.c @@ -34,11 +34,11 @@ void MX_USART1_UART_Init(void) /* Peripheral clock enable */ LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_USART1); - + LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOA); - /**USART1 GPIO Configuration + /**USART1 GPIO Configuration PA9 ------> USART1_TX - PA10 ------> USART1_RX + PA10 ------> USART1_RX */ GPIO_InitStruct.Pin = LL_GPIO_PIN_9|LL_GPIO_PIN_10; GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; @@ -49,7 +49,7 @@ void MX_USART1_UART_Init(void) LL_GPIO_Init(GPIOA, &GPIO_InitStruct); /* USART1 DMA Init */ - + /* USART1_RX Init */ LL_DMA_SetChannelSelection(DMA2, LL_DMA_STREAM_2, LL_DMA_CHANNEL_4); From 7ffe69927faf8de493e70f059898f5598d3b15e5 Mon Sep 17 00:00:00 2001 From: Attila BODY Date: Sun, 15 Nov 2020 21:23:48 +0100 Subject: [PATCH 2/5] Renamed two members in Application class for better understandability --- App/application.cpp | 10 +++++----- App/application.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/App/application.cpp b/App/application.cpp index 281e528..643016c 100644 --- a/App/application.cpp +++ b/App/application.cpp @@ -71,13 +71,13 @@ void Application::Loop() } for(;;) { - if(m_received && m_transmitted) { - m_transmitted = false; + if(m_lineReceived && m_transmissionCompleted) { + m_transmissionCompleted = false; const char *line = const_cast(m_rcvdBuffer->buffer); m_console.SendLine(line, m_rcvdBuffer->len); lcd.Print(line); lcd.Print("\r\n", 2); - m_received = false; + m_lineReceived = false; m_rcvdBuffer->busy = false; } @@ -101,12 +101,12 @@ void Application::Loop() void Application::LineReceived(void *userParam, SerialConsole<257>::Buffer *buffer) { - m_received = true; + m_lineReceived = true; m_rcvdBuffer = buffer; } void Application::TransmissionComplete(void *userParam, SerialConsole<257>::Buffer *buffer) { - m_transmitted = true; + m_transmissionCompleted = true; } diff --git a/App/application.h b/App/application.h index b9893a3..7ffd219 100644 --- a/App/application.h +++ b/App/application.h @@ -38,10 +38,10 @@ private: virtual void TransmissionComplete(void *userParam, SerialConsole<257>::Buffer *buffer); SerialConsole<257> m_console; - volatile bool m_received = false; + volatile bool m_lineReceived = false; volatile SerialConsole<257>::Buffer *m_rcvdBuffer; - volatile bool m_transmitted = true; + volatile bool m_transmissionCompleted = true; }; #endif // __cplusplus From 3a20a7d84671cbecba9deb416200a6196b8407fd Mon Sep 17 00:00:00 2001 From: Attila BODY Date: Mon, 16 Nov 2020 00:17:19 +0100 Subject: [PATCH 3/5] moving application communications buffer to the application class --- App/application.cpp | 16 +++++++--------- App/application.h | 1 + 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/App/application.cpp b/App/application.cpp index 643016c..2ab42a8 100644 --- a/App/application.cpp +++ b/App/application.cpp @@ -57,8 +57,6 @@ Application::Application() void Application::Loop() { - char buffer[128]; - Ili9341Fsmc &lcd(Ili9341Fsmc::Init(nullptr, nullptr, DMA2, LL_DMA_STREAM_4, false)); lcd.SetScrollMode(true); @@ -88,13 +86,13 @@ void Application::Loop() uint16_t x = ReadTouch(SPI2, true); uint16_t y = ReadTouch(SPI2, false); - unsigned len = strcpy_ex(buffer, "X: "); - len += uitodec(buffer+len, x); - len += strcpy_ex(buffer + len, ", Y: "); - len += uitodec(buffer + len, y); - len += strcpy_ex(buffer + len, "\r\n"); - lcd.Print(buffer, len); - m_console.SendLine(buffer, len); + unsigned len = strcpy_ex(m_appBuffer, "X: "); + len += uitodec(m_appBuffer+len, x); + len += strcpy_ex(m_appBuffer + len, ", Y: "); + len += uitodec(m_appBuffer + len, y); + len += strcpy_ex(m_appBuffer + len, "\r\n"); + lcd.Print(m_appBuffer, len); + m_console.SendLine(m_appBuffer, len); } } } diff --git a/App/application.h b/App/application.h index 7ffd219..4b7a497 100644 --- a/App/application.h +++ b/App/application.h @@ -40,6 +40,7 @@ private: SerialConsole<257> m_console; volatile bool m_lineReceived = false; volatile SerialConsole<257>::Buffer *m_rcvdBuffer; + char m_appBuffer[128]; volatile bool m_transmissionCompleted = true; }; From fb5670a950523a532c73ef06827979c37f357547 Mon Sep 17 00:00:00 2001 From: Attila BODY Date: Mon, 16 Nov 2020 13:24:15 +0100 Subject: [PATCH 4/5] moved f4ll_cpp imto its own namespace moved strutil to the application --- App/application.cpp | 4 ++-- App/application.h | 12 ++++++------ App/globals.cpp | 2 +- App/globals.h | 2 +- App/interrupt_handlers.cpp | 2 +- {components/f4ll_cpp => App}/strutil.c | 2 +- {components/f4ll_cpp => App}/strutil.h | 8 ++++---- components/f4ll_cpp/crcscheduler.cpp | 4 ++++ components/f4ll_cpp/crcscheduler.h | 4 ++++ components/f4ll_cpp/dmahelper.cpp | 4 ++++ components/f4ll_cpp/dmahelper.h | 15 ++++----------- components/f4ll_cpp/ili9341.cpp | 4 ++++ components/f4ll_cpp/ili9341.h | 4 ++++ components/f4ll_cpp/memcpydma.cpp | 4 ++++ components/f4ll_cpp/memcpydma.h | 3 +++ components/f4ll_cpp/packetuart.cpp | 4 ++++ components/f4ll_cpp/packetuart.h | 4 ++++ components/f4ll_cpp/serialconsole.h | 4 ++++ components/f4ll_cpp/singleton.h | 4 ++++ components/f4ll_cpp/uartbase.cpp | 3 +++ components/f4ll_cpp/uartbase.h | 4 ++++ 21 files changed, 70 insertions(+), 27 deletions(-) rename {components/f4ll_cpp => App}/strutil.c (98%) rename {components/f4ll_cpp => App}/strutil.h (86%) diff --git a/App/application.cpp b/App/application.cpp index 2ab42a8..c5f712d 100644 --- a/App/application.cpp +++ b/App/application.cpp @@ -6,16 +6,16 @@ */ #include -#include #include #include #include "main.h" #include "globals.h" +#include "strutil.h" #define BORDER 60 #define BARWIDTH 2 - +using namespace f4ll_cpp; void MainLoop() { diff --git a/App/application.h b/App/application.h index 4b7a497..38a5222 100644 --- a/App/application.h +++ b/App/application.h @@ -23,23 +23,23 @@ void MainLoop(); #include "globals.h" struct GlobalsInitializer { - GlobalsInitializer(SerialConsole<257> *console) { + GlobalsInitializer(f4ll_cpp::SerialConsole<257> *console) { g_console = console; } }; -class Application : public GlobalsInitializer, public SerialConsole<257>::ISerialConsoleCallback { +class Application : public GlobalsInitializer, public f4ll_cpp::SerialConsole<257>::ISerialConsoleCallback { public: Application(); void Loop(); private: - virtual void LineReceived(void *userParam, SerialConsole<257>::Buffer *buffer); - virtual void TransmissionComplete(void *userParam, SerialConsole<257>::Buffer *buffer); + virtual void LineReceived(void *userParam, f4ll_cpp::SerialConsole<257>::Buffer *buffer); + virtual void TransmissionComplete(void *userParam, f4ll_cpp::SerialConsole<257>::Buffer *buffer); - SerialConsole<257> m_console; + f4ll_cpp::SerialConsole<257> m_console; volatile bool m_lineReceived = false; - volatile SerialConsole<257>::Buffer *m_rcvdBuffer; + volatile f4ll_cpp::SerialConsole<257>::Buffer *m_rcvdBuffer; char m_appBuffer[128]; volatile bool m_transmissionCompleted = true; diff --git a/App/globals.cpp b/App/globals.cpp index 4e7a819..e8c3c06 100644 --- a/App/globals.cpp +++ b/App/globals.cpp @@ -7,4 +7,4 @@ #include "globals.h" -SerialConsole<257> *g_console = nullptr; +f4ll_cpp::SerialConsole<257> *g_console = nullptr; diff --git a/App/globals.h b/App/globals.h index 135925a..b9e6f07 100644 --- a/App/globals.h +++ b/App/globals.h @@ -11,7 +11,7 @@ #if defined(__cplusplus) -extern SerialConsole<257> *g_console; +extern f4ll_cpp::SerialConsole<257> *g_console; #endif // __cplusplus diff --git a/App/interrupt_handlers.cpp b/App/interrupt_handlers.cpp index 3b659e2..bf3623c 100644 --- a/App/interrupt_handlers.cpp +++ b/App/interrupt_handlers.cpp @@ -12,7 +12,7 @@ void HandleLcdDmaIrq() { // DMA2 Stream4 - Ili9341Fsmc::HandleDmaIrq(&Ili9341Fsmc::Instance()); + f4ll_cpp::Ili9341Fsmc::HandleDmaIrq(&f4ll_cpp::Ili9341Fsmc::Instance()); } void HandleConsoleRxDmaIrq() diff --git a/components/f4ll_cpp/strutil.c b/App/strutil.c similarity index 98% rename from components/f4ll_cpp/strutil.c rename to App/strutil.c index 8ac84d3..12c5812 100644 --- a/components/f4ll_cpp/strutil.c +++ b/App/strutil.c @@ -1,5 +1,5 @@ #include -#include +#include "strutil.h" ////////////////////////////////////////////////////////////////////////////// size_t strcpy_ex(char *dst, char const *src) diff --git a/components/f4ll_cpp/strutil.h b/App/strutil.h similarity index 86% rename from components/f4ll_cpp/strutil.h rename to App/strutil.h index 49ddc39..f3771a4 100644 --- a/components/f4ll_cpp/strutil.h +++ b/App/strutil.h @@ -4,9 +4,8 @@ * Created on: Feb 11, 2017 * Author: compi */ - -#ifndef _STM32PLUS_STRUTIL_H_ -#define _STM32PLUS_STRUTIL_H_ +#ifndef _STRUTIL_H_ +#define _STRUTIL_H_ #include #include @@ -28,4 +27,5 @@ char tochr(const uint8_t in, const uint8_t upper); } #endif -#endif /* _STM32PLUS_STRUTIL_H_ */ + +#endif // _STRUTIL_H_ diff --git a/components/f4ll_cpp/crcscheduler.cpp b/components/f4ll_cpp/crcscheduler.cpp index 0ec6bb3..1f46a6c 100644 --- a/components/f4ll_cpp/crcscheduler.cpp +++ b/components/f4ll_cpp/crcscheduler.cpp @@ -27,6 +27,9 @@ # define DIAG_INTERRUPT_OUT() #endif +namespace f4ll_cpp +{ + void Crc_StartNextTask(struct crcstatus_t *status); @@ -188,3 +191,4 @@ void CrcScheduler::_HandleDmaIrq() DIAG_INTERRUPT_OUT(); } +} // f4ll_cpp diff --git a/components/f4ll_cpp/crcscheduler.h b/components/f4ll_cpp/crcscheduler.h index 91ba259..ffa27ae 100644 --- a/components/f4ll_cpp/crcscheduler.h +++ b/components/f4ll_cpp/crcscheduler.h @@ -17,6 +17,9 @@ #include #include +namespace f4ll_cpp +{ + class CrcScheduler { public: struct ICrcCallback { @@ -64,5 +67,6 @@ private: crcslot_t *m_firstSlot; }; +} // f4ll_cpp #endif /* CRC_HANDLER_H_ */ diff --git a/components/f4ll_cpp/dmahelper.cpp b/components/f4ll_cpp/dmahelper.cpp index 47d051a..f4b080e 100644 --- a/components/f4ll_cpp/dmahelper.cpp +++ b/components/f4ll_cpp/dmahelper.cpp @@ -9,6 +9,9 @@ #define MOCKABLE(x) x #endif +namespace f4ll_cpp +{ + DmaHelper::DmaHelper(DMA_TypeDef *dma, uint32_t stream) { m_dma = dma; @@ -80,3 +83,4 @@ uint32_t DmaHelper::_GetTcMask(uint32_t stream) return tcMasks[stream]; } +} // f4ll_cpp diff --git a/components/f4ll_cpp/dmahelper.h b/components/f4ll_cpp/dmahelper.h index be4cf60..90b8f5e 100644 --- a/components/f4ll_cpp/dmahelper.h +++ b/components/f4ll_cpp/dmahelper.h @@ -14,6 +14,9 @@ #define DECLARE_MOCK(x) #endif +namespace f4ll_cpp +{ + class DmaHelper { public: DmaHelper(DMA_TypeDef *dma, uint32_t stream); @@ -49,16 +52,6 @@ private: uint32_t m_tcMask; }; - -#ifdef UNITTEST -DECLARE_MOCK(Dma_GetIsReg); -DECLARE_MOCK(Dma_GetIfcReg); -DECLARE_MOCK(Dma_GetDmeMask); -DECLARE_MOCK(Dma_GetTeMask); -DECLARE_MOCK(Dma_GetHtMask); -DECLARE_MOCK(Dma_GetTcMask); -DECLARE_MOCK(Dma_GetFeMask); -DECLARE_MOCK(Dma_Init); -#endif +} // f4ll_cpp #endif /* DMA_HELPER_H_ */ diff --git a/components/f4ll_cpp/ili9341.cpp b/components/f4ll_cpp/ili9341.cpp index 9b6b271..a4bbba4 100644 --- a/components/f4ll_cpp/ili9341.cpp +++ b/components/f4ll_cpp/ili9341.cpp @@ -16,6 +16,8 @@ #define RGB2U16(R,G,B) ((R & 0xf8) << 8 | (G & 0xfc) << 3 | (B & 0xf8) >> 3) #define MSBSPLIT(x) ((uint8_t)(x >> 8)), ((uint8_t)x) +namespace f4ll_cpp { + Ili9341Fsmc::Ili9341Fsmc(volatile uint16_t *reg, volatile uint16_t *ram, DMA_TypeDef *dma, uint32_t dmaStream, bool horizontal) @@ -395,3 +397,5 @@ const uint8_t Ili9341Fsmc::m_font[CHRCOUNT][CHRWIDTH] = { {0x02,0x01,0x02,0x01,0x00,0x00}, // ~ {0x00,0x00,0x00,0x00,0x00,0x00} }; + +} // f4ll_cpp diff --git a/components/f4ll_cpp/ili9341.h b/components/f4ll_cpp/ili9341.h index a9e0763..02ce413 100644 --- a/components/f4ll_cpp/ili9341.h +++ b/components/f4ll_cpp/ili9341.h @@ -5,6 +5,8 @@ #include #include +namespace f4ll_cpp { + class Ili9341Fsmc : public Singleton, private DmaHelper { public: @@ -186,4 +188,6 @@ public: }; }; +} // f4ll_cpp + #endif diff --git a/components/f4ll_cpp/memcpydma.cpp b/components/f4ll_cpp/memcpydma.cpp index aba8a4b..c34c11e 100644 --- a/components/f4ll_cpp/memcpydma.cpp +++ b/components/f4ll_cpp/memcpydma.cpp @@ -7,6 +7,8 @@ #include #include +namespace f4ll_cpp { + MemcpyDma::MemcpyDma(DMA_TypeDef *dma, uint32_t stream) : DmaHelper(dma, stream), m_busy(false) @@ -33,3 +35,5 @@ void MemcpyDma::HandleDmaIrq(void) m_busy = false; } } + +} // f4ll_cpp diff --git a/components/f4ll_cpp/memcpydma.h b/components/f4ll_cpp/memcpydma.h index 9f6e33c..aa93b8c 100644 --- a/components/f4ll_cpp/memcpydma.h +++ b/components/f4ll_cpp/memcpydma.h @@ -14,6 +14,8 @@ #include +namespace f4ll_cpp { + class MemcpyDma : public DmaHelper, public Singleton { public: @@ -26,5 +28,6 @@ private: volatile bool m_busy; }; +} // namespace f4ll_cpp #endif /* MEMCPY_DMA_H_ */ diff --git a/components/f4ll_cpp/packetuart.cpp b/components/f4ll_cpp/packetuart.cpp index 545e700..5f68891 100644 --- a/components/f4ll_cpp/packetuart.cpp +++ b/components/f4ll_cpp/packetuart.cpp @@ -30,6 +30,9 @@ #define STARTMARKER 0x95 +namespace f4ll_cpp +{ + static inline uint32_t RoundUpTo4(uint32_t inp) { return (inp + 3) & 0xfffc; @@ -280,3 +283,4 @@ void PacketUart::HandleUsartIrq() DIAG_INTERRUPT_OUT(); } +} // f4ll_cpp diff --git a/components/f4ll_cpp/packetuart.h b/components/f4ll_cpp/packetuart.h index cc6135b..b694a88 100644 --- a/components/f4ll_cpp/packetuart.h +++ b/components/f4ll_cpp/packetuart.h @@ -13,6 +13,8 @@ #define USART_STATS_DISABLED +namespace f4ll_cpp { + class PacketUart : public UartBase, public CrcScheduler::ICrcCallback { public: @@ -100,4 +102,6 @@ private: Buffer rxBuffers[2]; }; +} // f4ll_cpp + #endif /* UART_HANDLER_H_ */ diff --git a/components/f4ll_cpp/serialconsole.h b/components/f4ll_cpp/serialconsole.h index d6bf32d..16e91a2 100644 --- a/components/f4ll_cpp/serialconsole.h +++ b/components/f4ll_cpp/serialconsole.h @@ -14,6 +14,8 @@ #include +namespace f4ll_cpp { + template class SerialConsole : protected UartBase { public: @@ -166,4 +168,6 @@ template void SerialConsole::SendLine(char const } } +} // f4ll_cpp + #endif /* CONSOLEHANDLER_H_ */ diff --git a/components/f4ll_cpp/singleton.h b/components/f4ll_cpp/singleton.h index 7ca6e5c..75a52f8 100644 --- a/components/f4ll_cpp/singleton.h +++ b/components/f4ll_cpp/singleton.h @@ -10,6 +10,8 @@ #include +namespace f4ll_cpp { + template class Singleton { public: static T &Instance() { return *m_instance; } @@ -32,4 +34,6 @@ protected: template T* Singleton::m_instance = nullptr; +} // f4ll_cpp + #endif /* SINGLETON_H_ */ diff --git a/components/f4ll_cpp/uartbase.cpp b/components/f4ll_cpp/uartbase.cpp index 5e4e791..1c48d18 100644 --- a/components/f4ll_cpp/uartbase.cpp +++ b/components/f4ll_cpp/uartbase.cpp @@ -7,6 +7,8 @@ #include +namespace f4ll_cpp { + UartBase::UartBase(USART_TypeDef *uart, DMA_TypeDef *dma, uint32_t stream_rx, uint32_t stream_tx) : m_uart(uart) , m_rxDma(dma, stream_rx) @@ -44,3 +46,4 @@ void UartBase::SetupTransmit(void *buffer, uint16_t length) LL_DMA_EnableStream(m_txDma.GetDma(), m_txDma.GetStream()); } +} // f4ll_cpp diff --git a/components/f4ll_cpp/uartbase.h b/components/f4ll_cpp/uartbase.h index fceefa6..557916a 100644 --- a/components/f4ll_cpp/uartbase.h +++ b/components/f4ll_cpp/uartbase.h @@ -10,6 +10,8 @@ #include #include +namespace f4ll_cpp { + class UartBase { public: @@ -24,4 +26,6 @@ protected: DmaHelper m_txDma; }; +} // f4ll_cpp + #endif /* F4LL_CPP_UARTBASE_H_ */ From 3d0f0aaaadb3e6bb1169c7b64509eb32dfcbd08c Mon Sep 17 00:00:00 2001 From: Attila BODY Date: Mon, 16 Nov 2020 12:48:22 +0100 Subject: [PATCH 5/5] FreeRTOS introduced --- .cproject | 18 +- .mxproject | 10 +- F407_test.ioc | 64 +- Inc/FreeRTOSConfig.h | 158 + Inc/crc.h | 8 +- Inc/dma.h | 8 +- Inc/fsmc.h | 8 +- Inc/gpio.h | 8 +- Inc/spi.h | 8 +- Inc/stm32f4xx_hal_conf.h | 2 +- Inc/stm32f4xx_it.h | 4 +- Inc/usart.h | 8 +- .../FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h | 846 +++ .../FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c | 1924 ++++++ .../FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.h | 734 +++ .../Third_Party/FreeRTOS/Source/croutine.c | 353 ++ .../FreeRTOS/Source/event_groups.c | 753 +++ .../FreeRTOS/Source/include/FreeRTOS.h | 1278 ++++ .../FreeRTOS/Source/include/StackMacros.h | 133 + .../FreeRTOS/Source/include/croutine.h | 720 +++ .../Source/include/deprecated_definitions.h | 279 + .../FreeRTOS/Source/include/event_groups.h | 757 +++ .../FreeRTOS/Source/include/list.h | 412 ++ .../FreeRTOS/Source/include/message_buffer.h | 799 +++ .../FreeRTOS/Source/include/mpu_prototypes.h | 157 + .../FreeRTOS/Source/include/mpu_wrappers.h | 186 + .../FreeRTOS/Source/include/portable.h | 181 + .../FreeRTOS/Source/include/projdefs.h | 124 + .../FreeRTOS/Source/include/queue.h | 1655 ++++++ .../FreeRTOS/Source/include/semphr.h | 1140 ++++ .../FreeRTOS/Source/include/stack_macros.h | 129 + .../FreeRTOS/Source/include/stream_buffer.h | 855 +++ .../FreeRTOS/Source/include/task.h | 2421 ++++++++ .../FreeRTOS/Source/include/timers.h | 1295 ++++ .../Third_Party/FreeRTOS/Source/list.c | 198 + .../Source/portable/GCC/ARM_CM4F/port.c | 775 +++ .../Source/portable/GCC/ARM_CM4F/portmacro.h | 243 + .../FreeRTOS/Source/portable/MemMang/heap_4.c | 436 ++ .../Third_Party/FreeRTOS/Source/queue.c | 2941 ++++++++++ .../FreeRTOS/Source/stream_buffer.c | 1263 ++++ .../Third_Party/FreeRTOS/Source/tasks.c | 5214 +++++++++++++++++ .../Third_Party/FreeRTOS/Source/timers.c | 1102 ++++ Src/crc.c | 8 +- Src/dma.c | 8 +- Src/freertos.c | 129 + Src/fsmc.c | 8 +- Src/gpio.c | 8 +- Src/main.c | 32 +- Src/spi.c | 8 +- Src/stm32f4xx_hal_timebase_tim.c | 112 + Src/stm32f4xx_it.c | 55 +- Src/usart.c | 8 +- 52 files changed, 29857 insertions(+), 126 deletions(-) create mode 100644 Inc/FreeRTOSConfig.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/croutine.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/event_groups.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/croutine.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/list.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/message_buffer.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/mpu_prototypes.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/portable.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/queue.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/semphr.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/stack_macros.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/stream_buffer.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/task.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/timers.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/list.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/queue.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/tasks.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/timers.c create mode 100644 Src/freertos.c create mode 100644 Src/stm32f4xx_hal_timebase_tim.c diff --git a/.cproject b/.cproject index c2a27bb..89fa698 100644 --- a/.cproject +++ b/.cproject @@ -25,7 +25,7 @@ @@ -68,6 +71,9 @@ + + +