テスト用のあれこれ共用フォルダ
Revisão | 0c0798136412e31ebdb5a21e3697f512132057a5 (tree) |
---|---|
Hora | 2018-04-30 10:14:10 |
Autor | takemasa <suikan@user...> |
Commiter | takemasa |
Added SPI/I2C/UART1 to nucleo-f303kb
These IOs are added to test the waveform by logic analyzer. Pins are
defined by CubeMX.
@@ -5,10 +5,10 @@ SourcePath=/home/takemasa/shared_foo/stm32_development/nucleo-f303k8/Src | ||
5 | 5 | SourceFiles=FreeRTOSConfig.h;stm32f3xx_it.h;stm32f3xx_hal_conf.h;main.h;freertos.c;stm32f3xx_it.c;stm32f3xx_hal_msp.c;stm32f3xx_hal_timebase_TIM.c;main.c; |
6 | 6 | |
7 | 7 | [PreviousLibFiles] |
8 | -LibFiles=Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_uart.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_uart_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_cortex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c;Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f303x8.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f3xx.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/system_stm32f3xx.h;Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/system_stm32f3xx.c;Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h;Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h;Middlewares/Third_Party/FreeRTOS/Source/include/croutine.h;Middlewares/Third_Party/FreeRTOS/Source/include/semphr.h;Middlewares/Third_Party/FreeRTOS/Source/include/queue.h;Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h;Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h;Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOSConfig_template.h;Middlewares/Third_Party/FreeRTOS/Source/include/portable.h;Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h;Middlewares/Third_Party/FreeRTOS/Source/include/task.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_prototypes.h;Middlewares/Third_Party/FreeRTOS/Source/include/timers.h;Middlewares/Third_Party/FreeRTOS/Source/include/list.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h;Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;Middlewares/Third_Party/FreeRTOS/Source/timers.c;Middlewares/Third_Party/FreeRTOS/Source/tasks.c;Middlewares/Third_Party/FreeRTOS/Source/list.c;Middlewares/Third_Party/FreeRTOS/Source/queue.c;Middlewares/Third_Party/FreeRTOS/Source/croutine.c;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c;Drivers/CMSIS/Include/arm_const_structs.h;Drivers/CMSIS/Include/cmsis_armcc_V6.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_cmInstr.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cmSimd.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/arm_math.h;Drivers/CMSIS/Include/arm_common_tables.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_cmFunc.h;Drivers/CMSIS/Include/core_cm7.h; | |
8 | +LibFiles=Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_spi.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_spi_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_uart.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_uart_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_cortex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash_ex.h;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c;Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f303x8.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f3xx.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/system_stm32f3xx.h;Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/system_stm32f3xx.c;Middlewares/Third_Party/FreeRTOS/Source/include/portable.h;Middlewares/Third_Party/FreeRTOS/Source/include/semphr.h;Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOSConfig_template.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_prototypes.h;Middlewares/Third_Party/FreeRTOS/Source/include/list.h;Middlewares/Third_Party/FreeRTOS/Source/include/timers.h;Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h;Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h;Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h;Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h;Middlewares/Third_Party/FreeRTOS/Source/include/croutine.h;Middlewares/Third_Party/FreeRTOS/Source/include/queue.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h;Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h;Middlewares/Third_Party/FreeRTOS/Source/include/task.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h;Middlewares/Third_Party/FreeRTOS/Source/tasks.c;Middlewares/Third_Party/FreeRTOS/Source/timers.c;Middlewares/Third_Party/FreeRTOS/Source/queue.c;Middlewares/Third_Party/FreeRTOS/Source/croutine.c;Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;Middlewares/Third_Party/FreeRTOS/Source/list.c;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/arm_const_structs.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/core_cmInstr.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_cmFunc.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/cmsis_armcc_V6.h;Drivers/CMSIS/Include/arm_common_tables.h;Drivers/CMSIS/Include/arm_math.h;Drivers/CMSIS/Include/core_cmSimd.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_cm0.h; | |
9 | 9 | |
10 | 10 | [PreviousUsedSW4STM32Files] |
11 | -SourceFiles=../Src/main.c;../Src/freertos.c;../Src/stm32f3xx_it.c;../Src/stm32f3xx_hal_msp.c;../Src/stm32f3xx_hal_timebase_TIM.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c;../Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;../Middlewares/Third_Party/FreeRTOS/Source/timers.c;../Middlewares/Third_Party/FreeRTOS/Source/tasks.c;../Middlewares/Third_Party/FreeRTOS/Source/list.c;../Middlewares/Third_Party/FreeRTOS/Source/queue.c;../Middlewares/Third_Party/FreeRTOS/Source/croutine.c;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c;../Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/system_stm32f3xx.c;../Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/gcc/startup_stm32f303x8.s;../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c;../Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;../Middlewares/Third_Party/FreeRTOS/Source/timers.c;../Middlewares/Third_Party/FreeRTOS/Source/tasks.c;../Middlewares/Third_Party/FreeRTOS/Source/list.c;../Middlewares/Third_Party/FreeRTOS/Source/queue.c;../Middlewares/Third_Party/FreeRTOS/Source/croutine.c;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c; | |
11 | +SourceFiles=../Src/main.c;../Src/freertos.c;../Src/stm32f3xx_it.c;../Src/stm32f3xx_hal_msp.c;../Src/stm32f3xx_hal_timebase_TIM.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c;../Middlewares/Third_Party/FreeRTOS/Source/tasks.c;../Middlewares/Third_Party/FreeRTOS/Source/timers.c;../Middlewares/Third_Party/FreeRTOS/Source/queue.c;../Middlewares/Third_Party/FreeRTOS/Source/croutine.c;../Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;../Middlewares/Third_Party/FreeRTOS/Source/list.c;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c;../Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/system_stm32f3xx.c;../Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/gcc/startup_stm32f303x8.s;../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c;../Middlewares/Third_Party/FreeRTOS/Source/tasks.c;../Middlewares/Third_Party/FreeRTOS/Source/timers.c;../Middlewares/Third_Party/FreeRTOS/Source/queue.c;../Middlewares/Third_Party/FreeRTOS/Source/croutine.c;../Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;../Middlewares/Third_Party/FreeRTOS/Source/list.c;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c; | |
12 | 12 | HeaderPath=../Drivers/STM32F3xx_HAL_Driver/Inc;../Drivers/STM32F3xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F;../Drivers/CMSIS/Device/ST/STM32F3xx/Include;../Middlewares/Third_Party/FreeRTOS/Source/include;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS;../Drivers/CMSIS/Include; |
13 | 13 | CDefines=__weak="__attribute__((weak))";__packed="__attribute__((__packed__))"; |
14 | 14 |
@@ -102,7 +102,7 @@ | ||
102 | 102 | #define configTICK_RATE_HZ ((TickType_t)1000) |
103 | 103 | #define configMAX_PRIORITIES ( 7 ) |
104 | 104 | #define configMINIMAL_STACK_SIZE ((uint16_t)128) |
105 | -#define configTOTAL_HEAP_SIZE ((size_t)3072) | |
105 | +#define configTOTAL_HEAP_SIZE ((size_t)5000) | |
106 | 106 | #define configMAX_TASK_NAME_LEN ( 16 ) |
107 | 107 | #define configUSE_16_BIT_TICKS 0 |
108 | 108 | #define configUSE_MUTEXES 1 |
@@ -152,7 +152,7 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ | ||
152 | 152 | /* Normal assert() semantics without relying on the provision of an assert.h |
153 | 153 | header file. */ |
154 | 154 | /* USER CODE BEGIN 1 */ |
155 | -#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );} | |
155 | +#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );} | |
156 | 156 | /* USER CODE END 1 */ |
157 | 157 | |
158 | 158 | /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS |
@@ -58,6 +58,8 @@ | ||
58 | 58 | |
59 | 59 | #define VCP_TX_Pin GPIO_PIN_2 |
60 | 60 | #define VCP_TX_GPIO_Port GPIOA |
61 | +#define SPI_CS_Pin GPIO_PIN_4 | |
62 | +#define SPI_CS_GPIO_Port GPIOA | |
61 | 63 | #define SWDIO_Pin GPIO_PIN_13 |
62 | 64 | #define SWDIO_GPIO_Port GPIOA |
63 | 65 | #define SWCLK_Pin GPIO_PIN_14 |
@@ -14,7 +14,11 @@ | ||
14 | 14 | extern "C" { |
15 | 15 | #endif |
16 | 16 | |
17 | -void InitTestUart(UART_HandleTypeDef * uart_handle); | |
17 | +void InitTestUart( | |
18 | + UART_HandleTypeDef * term_uart_handle, | |
19 | + UART_HandleTypeDef * test_uart1_handle, | |
20 | + SPI_HandleTypeDef * test_spi1_handle, | |
21 | + I2C_HandleTypeDef * test_i2c1_handle); | |
18 | 22 | void DoTestUart(void); |
19 | 23 | // For the STM32 HAL assertion_failed(); |
20 | 24 | void CustomAssertFailed(uint8_t* file, uint32_t line); |
@@ -19,7 +19,7 @@ | ||
19 | 19 | |
20 | 20 | // E X A M P L E |
21 | 21 | // Un-comment the folliwing line will override the value definition inside platform_config.hpp |
22 | - #define PLATFORM_CONFIG_DEBUG_LINE_SIZE 128 | |
22 | +#define PLATFORM_CONFIG_DEBUG_LINE_SIZE 192 | |
23 | 23 | #define PLATFORM_CONFIG_DEBUG_BUFFER_SIZE 1024 |
24 | 24 | |
25 | 25 |
@@ -80,6 +80,10 @@ struct Platform | ||
80 | 80 | { |
81 | 81 | // Platform dependent Custom variables. |
82 | 82 | AbstractUart * uart_console; ///< UART wrapping class object |
83 | + AbstractUart * uart1; ///< UART wrapping class object | |
84 | + AbstractSpiMaster * spi1_master; ///< SPI wrapping class object | |
85 | + AbstractI2CMaster * i2c1_master; ///< I2S wrapping class object | |
86 | + | |
83 | 87 | AbstractLogger * logger; ///< logging class object for debugger |
84 | 88 | |
85 | 89 | }; |
@@ -72,7 +72,7 @@ | ||
72 | 72 | /*#define HAL_LPTIM_MODULE_ENABLED */ |
73 | 73 | /*#define HAL_RNG_MODULE_ENABLED */ |
74 | 74 | /*#define HAL_RTC_MODULE_ENABLED */ |
75 | -/*#define HAL_SPI_MODULE_ENABLED */ | |
75 | +#define HAL_SPI_MODULE_ENABLED | |
76 | 76 | #define HAL_TIM_MODULE_ENABLED |
77 | 77 | #define HAL_UART_MODULE_ENABLED |
78 | 78 | /*#define HAL_USART_MODULE_ENABLED */ |
@@ -48,9 +48,17 @@ | ||
48 | 48 | /* Exported functions ------------------------------------------------------- */ |
49 | 49 | |
50 | 50 | void SysTick_Handler(void); |
51 | +void DMA1_Channel2_IRQHandler(void); | |
52 | +void DMA1_Channel3_IRQHandler(void); | |
53 | +void DMA1_Channel4_IRQHandler(void); | |
54 | +void DMA1_Channel5_IRQHandler(void); | |
51 | 55 | void DMA1_Channel6_IRQHandler(void); |
52 | 56 | void DMA1_Channel7_IRQHandler(void); |
53 | 57 | void TIM1_TRG_COM_TIM17_IRQHandler(void); |
58 | +void I2C1_EV_IRQHandler(void); | |
59 | +void I2C1_ER_IRQHandler(void); | |
60 | +void SPI1_IRQHandler(void); | |
61 | +void USART1_IRQHandler(void); | |
54 | 62 | void USART2_IRQHandler(void); |
55 | 63 | |
56 | 64 | #ifdef __cplusplus |
@@ -33,9 +33,9 @@ | ||
33 | 33 | ENTRY(Reset_Handler) |
34 | 34 | |
35 | 35 | /* Highest address of the user mode stack */ |
36 | -_estack = 0x20003000; /* end of RAM */ | |
36 | +_estack = 0x10001000; /* end of RAM */ | |
37 | 37 | /* Generate a link error if heap and stack don't fit into RAM */ |
38 | -_Min_Heap_Size = 0x1800; /* required amount of heap */ | |
38 | +_Min_Heap_Size = 0x1000; /* required amount of heap */ | |
39 | 39 | _Min_Stack_Size = 0x400; /* required amount of stack */ |
40 | 40 | |
41 | 41 | /* Specify the memory areas */ |
@@ -57,7 +57,16 @@ | ||
57 | 57 | /* USER CODE END Includes */ |
58 | 58 | |
59 | 59 | /* Private variables ---------------------------------------------------------*/ |
60 | +I2C_HandleTypeDef hi2c1; | |
61 | + | |
62 | +SPI_HandleTypeDef hspi1; | |
63 | +DMA_HandleTypeDef hdma_spi1_rx; | |
64 | +DMA_HandleTypeDef hdma_spi1_tx; | |
65 | + | |
66 | +UART_HandleTypeDef huart1; | |
60 | 67 | UART_HandleTypeDef huart2; |
68 | +DMA_HandleTypeDef hdma_usart1_tx; | |
69 | +DMA_HandleTypeDef hdma_usart1_rx; | |
61 | 70 | DMA_HandleTypeDef hdma_usart2_tx; |
62 | 71 | DMA_HandleTypeDef hdma_usart2_rx; |
63 | 72 |
@@ -73,6 +82,9 @@ void SystemClock_Config(void); | ||
73 | 82 | static void MX_GPIO_Init(void); |
74 | 83 | static void MX_DMA_Init(void); |
75 | 84 | static void MX_USART2_UART_Init(void); |
85 | +static void MX_USART1_UART_Init(void); | |
86 | +static void MX_I2C1_Init(void); | |
87 | +static void MX_SPI1_Init(void); | |
76 | 88 | void StartDefaultTask(void const * argument); |
77 | 89 | |
78 | 90 | /* USER CODE BEGIN PFP */ |
@@ -111,6 +123,9 @@ int main(void) | ||
111 | 123 | MX_GPIO_Init(); |
112 | 124 | MX_DMA_Init(); |
113 | 125 | MX_USART2_UART_Init(); |
126 | + MX_USART1_UART_Init(); | |
127 | + MX_I2C1_Init(); | |
128 | + MX_SPI1_Init(); | |
114 | 129 | |
115 | 130 | /* USER CODE BEGIN 2 */ |
116 | 131 |
@@ -167,6 +182,7 @@ void SystemClock_Config(void) | ||
167 | 182 | |
168 | 183 | RCC_OscInitTypeDef RCC_OscInitStruct; |
169 | 184 | RCC_ClkInitTypeDef RCC_ClkInitStruct; |
185 | + RCC_PeriphCLKInitTypeDef PeriphClkInit; | |
170 | 186 | |
171 | 187 | /**Initializes the CPU, AHB and APB busses clocks |
172 | 188 | */ |
@@ -193,6 +209,14 @@ void SystemClock_Config(void) | ||
193 | 209 | _Error_Handler(__FILE__, __LINE__); |
194 | 210 | } |
195 | 211 | |
212 | + PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART1|RCC_PERIPHCLK_I2C1; | |
213 | + PeriphClkInit.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK1; | |
214 | + PeriphClkInit.I2c1ClockSelection = RCC_I2C1CLKSOURCE_HSI; | |
215 | + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) | |
216 | + { | |
217 | + _Error_Handler(__FILE__, __LINE__); | |
218 | + } | |
219 | + | |
196 | 220 | /**Configure the Systick interrupt time |
197 | 221 | */ |
198 | 222 | HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000); |
@@ -205,6 +229,87 @@ void SystemClock_Config(void) | ||
205 | 229 | HAL_NVIC_SetPriority(SysTick_IRQn, 15, 0); |
206 | 230 | } |
207 | 231 | |
232 | +/* I2C1 init function */ | |
233 | +static void MX_I2C1_Init(void) | |
234 | +{ | |
235 | + | |
236 | + hi2c1.Instance = I2C1; | |
237 | + hi2c1.Init.Timing = 0x2000090E; | |
238 | + hi2c1.Init.OwnAddress1 = 0; | |
239 | + hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; | |
240 | + hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; | |
241 | + hi2c1.Init.OwnAddress2 = 0; | |
242 | + hi2c1.Init.OwnAddress2Masks = I2C_OA2_NOMASK; | |
243 | + hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; | |
244 | + hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; | |
245 | + if (HAL_I2C_Init(&hi2c1) != HAL_OK) | |
246 | + { | |
247 | + _Error_Handler(__FILE__, __LINE__); | |
248 | + } | |
249 | + | |
250 | + /**Configure Analogue filter | |
251 | + */ | |
252 | + if (HAL_I2CEx_ConfigAnalogFilter(&hi2c1, I2C_ANALOGFILTER_ENABLE) != HAL_OK) | |
253 | + { | |
254 | + _Error_Handler(__FILE__, __LINE__); | |
255 | + } | |
256 | + | |
257 | + /**Configure Digital filter | |
258 | + */ | |
259 | + if (HAL_I2CEx_ConfigDigitalFilter(&hi2c1, 0) != HAL_OK) | |
260 | + { | |
261 | + _Error_Handler(__FILE__, __LINE__); | |
262 | + } | |
263 | + | |
264 | +} | |
265 | + | |
266 | +/* SPI1 init function */ | |
267 | +static void MX_SPI1_Init(void) | |
268 | +{ | |
269 | + | |
270 | + /* SPI1 parameter configuration*/ | |
271 | + hspi1.Instance = SPI1; | |
272 | + hspi1.Init.Mode = SPI_MODE_MASTER; | |
273 | + hspi1.Init.Direction = SPI_DIRECTION_2LINES; | |
274 | + hspi1.Init.DataSize = SPI_DATASIZE_4BIT; | |
275 | + hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; | |
276 | + hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; | |
277 | + hspi1.Init.NSS = SPI_NSS_SOFT; | |
278 | + hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2; | |
279 | + hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; | |
280 | + hspi1.Init.TIMode = SPI_TIMODE_DISABLE; | |
281 | + hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; | |
282 | + hspi1.Init.CRCPolynomial = 7; | |
283 | + hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE; | |
284 | + hspi1.Init.NSSPMode = SPI_NSS_PULSE_ENABLE; | |
285 | + if (HAL_SPI_Init(&hspi1) != HAL_OK) | |
286 | + { | |
287 | + _Error_Handler(__FILE__, __LINE__); | |
288 | + } | |
289 | + | |
290 | +} | |
291 | + | |
292 | +/* USART1 init function */ | |
293 | +static void MX_USART1_UART_Init(void) | |
294 | +{ | |
295 | + | |
296 | + huart1.Instance = USART1; | |
297 | + huart1.Init.BaudRate = 9600; | |
298 | + huart1.Init.WordLength = UART_WORDLENGTH_8B; | |
299 | + huart1.Init.StopBits = UART_STOPBITS_1; | |
300 | + huart1.Init.Parity = UART_PARITY_NONE; | |
301 | + huart1.Init.Mode = UART_MODE_TX_RX; | |
302 | + huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE; | |
303 | + huart1.Init.OverSampling = UART_OVERSAMPLING_16; | |
304 | + huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; | |
305 | + huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; | |
306 | + if (HAL_UART_Init(&huart1) != HAL_OK) | |
307 | + { | |
308 | + _Error_Handler(__FILE__, __LINE__); | |
309 | + } | |
310 | + | |
311 | +} | |
312 | + | |
208 | 313 | /* USART2 init function */ |
209 | 314 | static void MX_USART2_UART_Init(void) |
210 | 315 | { |
@@ -235,6 +340,18 @@ static void MX_DMA_Init(void) | ||
235 | 340 | __HAL_RCC_DMA1_CLK_ENABLE(); |
236 | 341 | |
237 | 342 | /* DMA interrupt init */ |
343 | + /* DMA1_Channel2_IRQn interrupt configuration */ | |
344 | + HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 5, 0); | |
345 | + HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn); | |
346 | + /* DMA1_Channel3_IRQn interrupt configuration */ | |
347 | + HAL_NVIC_SetPriority(DMA1_Channel3_IRQn, 5, 0); | |
348 | + HAL_NVIC_EnableIRQ(DMA1_Channel3_IRQn); | |
349 | + /* DMA1_Channel4_IRQn interrupt configuration */ | |
350 | + HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 5, 0); | |
351 | + HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn); | |
352 | + /* DMA1_Channel5_IRQn interrupt configuration */ | |
353 | + HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 5, 0); | |
354 | + HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn); | |
238 | 355 | /* DMA1_Channel6_IRQn interrupt configuration */ |
239 | 356 | HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 5, 0); |
240 | 357 | HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn); |
@@ -262,8 +379,18 @@ static void MX_GPIO_Init(void) | ||
262 | 379 | __HAL_RCC_GPIOB_CLK_ENABLE(); |
263 | 380 | |
264 | 381 | /*Configure GPIO pin Output Level */ |
382 | + HAL_GPIO_WritePin(SPI_CS_GPIO_Port, SPI_CS_Pin, GPIO_PIN_SET); | |
383 | + | |
384 | + /*Configure GPIO pin Output Level */ | |
265 | 385 | HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_SET); |
266 | 386 | |
387 | + /*Configure GPIO pin : SPI_CS_Pin */ | |
388 | + GPIO_InitStruct.Pin = SPI_CS_Pin; | |
389 | + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
390 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
391 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM; | |
392 | + HAL_GPIO_Init(SPI_CS_GPIO_Port, &GPIO_InitStruct); | |
393 | + | |
267 | 394 | /*Configure GPIO pin : LED_Pin */ |
268 | 395 | GPIO_InitStruct.Pin = LED_Pin; |
269 | 396 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; |
@@ -282,7 +409,7 @@ void StartDefaultTask(void const * argument) | ||
282 | 409 | { |
283 | 410 | |
284 | 411 | /* USER CODE BEGIN 5 */ |
285 | - InitTestUart(&huart2); | |
412 | + InitTestUart(&huart2, &huart1, &hspi1, &hi2c1); | |
286 | 413 | /* Infinite loop */ |
287 | 414 | for(;;) |
288 | 415 | { |
@@ -25,23 +25,39 @@ murasaki::Debugger * murasaki::debugger; | ||
25 | 25 | |
26 | 26 | // Initialize the platform variables. This have to be doen before |
27 | 27 | // using other murasaki function. |
28 | -void InitTestUart(UART_HandleTypeDef * uart_handle) | |
28 | +void InitTestUart( | |
29 | + UART_HandleTypeDef * term_uart_handle, | |
30 | + UART_HandleTypeDef * test_uart1_handle, | |
31 | + SPI_HandleTypeDef * test_spi1_handle, | |
32 | + I2C_HandleTypeDef * test_i2c1_handle) | |
29 | 33 | { |
30 | 34 | // UART device setting |
31 | - murasaki::platform.uart_console = new murasaki::Uart(uart_handle); | |
32 | - // UART is used for logging port. | |
33 | - murasaki::platform.logger = new murasaki::UartLogger(murasaki::platform.uart_console); | |
34 | - | |
35 | - | |
36 | - // Setting debugger | |
37 | - murasaki::debugger = new murasaki::Debugger(murasaki::platform.logger); | |
38 | -// murasaki::debugger->AutoRePrint(); // type any key to show history. | |
35 | + murasaki::platform.uart_console = new murasaki::Uart(term_uart_handle); | |
36 | + // UART is used for logging port. | |
37 | + murasaki::platform.logger = new murasaki::UartLogger( | |
38 | + murasaki::platform.uart_console); | |
39 | + // Setting debugger | |
40 | + murasaki::debugger = new murasaki::Debugger(murasaki::platform.logger); | |
41 | + | |
42 | + | |
43 | +#if 1 | |
44 | + murasaki::platform.uart1 = new murasaki::Uart(test_uart1_handle); | |
45 | +#endif | |
46 | + | |
47 | +#if 1 | |
48 | + murasaki::platform.i2c1_master = new murasaki::I2cMaster(test_i2c1_handle); | |
49 | + murasaki::platform.spi1_master = new murasaki::SpiMaster(test_spi1_handle); | |
50 | +#endif | |
51 | +#if 1 | |
52 | + murasaki::debugger->AutoRePrint(); // type any key to show history. | |
53 | +#endif | |
39 | 54 | |
40 | 55 | } |
41 | 56 | |
42 | 57 | // String output test. |
43 | 58 | void DoTestUart(void) |
44 | 59 | { |
60 | + static unsigned int count = 0; | |
45 | 61 | |
46 | 62 | typedef void (* func_ptr)(); |
47 | 63 |
@@ -50,19 +66,12 @@ void DoTestUart(void) | ||
50 | 66 | // MURASAKI_ASSERT(counter % 2 == 0, "Odd counter"); |
51 | 67 | // by murasaki debugging output. You can use this in both task and interrupt context. |
52 | 68 | // non blocking |
53 | - murasaki::debugger->Printf("Count down 9 \r\n"); | |
54 | - murasaki::debugger->Printf("Count down 8 \r\n"); | |
55 | - murasaki::debugger->Printf("Count down 7 \r\n"); | |
56 | - murasaki::debugger->Printf("Count down 6 \r\n"); | |
57 | - murasaki::debugger->Printf("Count down 5 \r\n"); | |
58 | - murasaki::debugger->Printf("Count down 4 \r\n"); | |
59 | - murasaki::debugger->Printf("Count down 3 \r\n"); | |
60 | - murasaki::debugger->Printf("Count down 2 \r\n"); | |
61 | - murasaki::debugger->Printf("Count down 1 \r\n"); | |
62 | - murasaki::debugger->Printf("Count down 0 \r\n"); | |
63 | - | |
64 | - func(); | |
65 | 69 | |
70 | + murasaki::debugger->Printf("Count %4d \r\n", count); | |
71 | +#if 0 | |
72 | + func(); | |
73 | +#endif | |
74 | + count++; | |
66 | 75 | } |
67 | 76 | |
68 | 77 | // Hook for the assert_failure() in main.c |
@@ -81,6 +90,9 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef * huart) | ||
81 | 90 | // If hit, return. If not hit,check next. |
82 | 91 | if (murasaki::platform.uart_console->TransmitCompleteCallback(huart)) |
83 | 92 | return; |
93 | + if (murasaki::platform.uart1->TransmitCompleteCallback(huart)) | |
94 | + return; | |
95 | + | |
84 | 96 | |
85 | 97 | } |
86 | 98 |
@@ -92,6 +104,8 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef * huart) | ||
92 | 104 | // If hit, return. If not hit,check next. |
93 | 105 | if (murasaki::platform.uart_console->ReceiveCompleteCallback(huart)) |
94 | 106 | return; |
107 | + if (murasaki::platform.uart1->ReceiveCompleteCallback(huart)) | |
108 | + return; | |
95 | 109 | |
96 | 110 | } |
97 | 111 |
@@ -49,6 +49,14 @@ | ||
49 | 49 | /* Includes ------------------------------------------------------------------*/ |
50 | 50 | #include "stm32f3xx_hal.h" |
51 | 51 | |
52 | +extern DMA_HandleTypeDef hdma_spi1_rx; | |
53 | + | |
54 | +extern DMA_HandleTypeDef hdma_spi1_tx; | |
55 | + | |
56 | +extern DMA_HandleTypeDef hdma_usart1_tx; | |
57 | + | |
58 | +extern DMA_HandleTypeDef hdma_usart1_rx; | |
59 | + | |
52 | 60 | extern DMA_HandleTypeDef hdma_usart2_tx; |
53 | 61 | |
54 | 62 | extern DMA_HandleTypeDef hdma_usart2_rx; |
@@ -91,11 +99,230 @@ void HAL_MspInit(void) | ||
91 | 99 | /* USER CODE END MspInit 1 */ |
92 | 100 | } |
93 | 101 | |
102 | +void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c) | |
103 | +{ | |
104 | + | |
105 | + GPIO_InitTypeDef GPIO_InitStruct; | |
106 | + if(hi2c->Instance==I2C1) | |
107 | + { | |
108 | + /* USER CODE BEGIN I2C1_MspInit 0 */ | |
109 | + | |
110 | + /* USER CODE END I2C1_MspInit 0 */ | |
111 | + | |
112 | + /**I2C1 GPIO Configuration | |
113 | + PB6 ------> I2C1_SCL | |
114 | + PB7 ------> I2C1_SDA | |
115 | + */ | |
116 | + GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7; | |
117 | + GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; | |
118 | + GPIO_InitStruct.Pull = GPIO_PULLUP; | |
119 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; | |
120 | + GPIO_InitStruct.Alternate = GPIO_AF4_I2C1; | |
121 | + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); | |
122 | + | |
123 | + /* Peripheral clock enable */ | |
124 | + __HAL_RCC_I2C1_CLK_ENABLE(); | |
125 | + /* I2C1 interrupt Init */ | |
126 | + HAL_NVIC_SetPriority(I2C1_EV_IRQn, 5, 0); | |
127 | + HAL_NVIC_EnableIRQ(I2C1_EV_IRQn); | |
128 | + HAL_NVIC_SetPriority(I2C1_ER_IRQn, 5, 0); | |
129 | + HAL_NVIC_EnableIRQ(I2C1_ER_IRQn); | |
130 | + /* USER CODE BEGIN I2C1_MspInit 1 */ | |
131 | + | |
132 | + /* USER CODE END I2C1_MspInit 1 */ | |
133 | + } | |
134 | + | |
135 | +} | |
136 | + | |
137 | +void HAL_I2C_MspDeInit(I2C_HandleTypeDef* hi2c) | |
138 | +{ | |
139 | + | |
140 | + if(hi2c->Instance==I2C1) | |
141 | + { | |
142 | + /* USER CODE BEGIN I2C1_MspDeInit 0 */ | |
143 | + | |
144 | + /* USER CODE END I2C1_MspDeInit 0 */ | |
145 | + /* Peripheral clock disable */ | |
146 | + __HAL_RCC_I2C1_CLK_DISABLE(); | |
147 | + | |
148 | + /**I2C1 GPIO Configuration | |
149 | + PB6 ------> I2C1_SCL | |
150 | + PB7 ------> I2C1_SDA | |
151 | + */ | |
152 | + HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7); | |
153 | + | |
154 | + /* I2C1 interrupt DeInit */ | |
155 | + HAL_NVIC_DisableIRQ(I2C1_EV_IRQn); | |
156 | + HAL_NVIC_DisableIRQ(I2C1_ER_IRQn); | |
157 | + /* USER CODE BEGIN I2C1_MspDeInit 1 */ | |
158 | + | |
159 | + /* USER CODE END I2C1_MspDeInit 1 */ | |
160 | + } | |
161 | + | |
162 | +} | |
163 | + | |
164 | +void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi) | |
165 | +{ | |
166 | + | |
167 | + GPIO_InitTypeDef GPIO_InitStruct; | |
168 | + if(hspi->Instance==SPI1) | |
169 | + { | |
170 | + /* USER CODE BEGIN SPI1_MspInit 0 */ | |
171 | + | |
172 | + /* USER CODE END SPI1_MspInit 0 */ | |
173 | + /* Peripheral clock enable */ | |
174 | + __HAL_RCC_SPI1_CLK_ENABLE(); | |
175 | + | |
176 | + /**SPI1 GPIO Configuration | |
177 | + PA5 ------> SPI1_SCK | |
178 | + PA6 ------> SPI1_MISO | |
179 | + PA7 ------> SPI1_MOSI | |
180 | + */ | |
181 | + GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7; | |
182 | + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | |
183 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
184 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; | |
185 | + GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; | |
186 | + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); | |
187 | + | |
188 | + /* SPI1 DMA Init */ | |
189 | + /* SPI1_RX Init */ | |
190 | + hdma_spi1_rx.Instance = DMA1_Channel2; | |
191 | + hdma_spi1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; | |
192 | + hdma_spi1_rx.Init.PeriphInc = DMA_PINC_DISABLE; | |
193 | + hdma_spi1_rx.Init.MemInc = DMA_MINC_ENABLE; | |
194 | + hdma_spi1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; | |
195 | + hdma_spi1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; | |
196 | + hdma_spi1_rx.Init.Mode = DMA_NORMAL; | |
197 | + hdma_spi1_rx.Init.Priority = DMA_PRIORITY_LOW; | |
198 | + if (HAL_DMA_Init(&hdma_spi1_rx) != HAL_OK) | |
199 | + { | |
200 | + _Error_Handler(__FILE__, __LINE__); | |
201 | + } | |
202 | + | |
203 | + __HAL_LINKDMA(hspi,hdmarx,hdma_spi1_rx); | |
204 | + | |
205 | + /* SPI1_TX Init */ | |
206 | + hdma_spi1_tx.Instance = DMA1_Channel3; | |
207 | + hdma_spi1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; | |
208 | + hdma_spi1_tx.Init.PeriphInc = DMA_PINC_DISABLE; | |
209 | + hdma_spi1_tx.Init.MemInc = DMA_MINC_ENABLE; | |
210 | + hdma_spi1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; | |
211 | + hdma_spi1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; | |
212 | + hdma_spi1_tx.Init.Mode = DMA_NORMAL; | |
213 | + hdma_spi1_tx.Init.Priority = DMA_PRIORITY_LOW; | |
214 | + if (HAL_DMA_Init(&hdma_spi1_tx) != HAL_OK) | |
215 | + { | |
216 | + _Error_Handler(__FILE__, __LINE__); | |
217 | + } | |
218 | + | |
219 | + __HAL_LINKDMA(hspi,hdmatx,hdma_spi1_tx); | |
220 | + | |
221 | + /* SPI1 interrupt Init */ | |
222 | + HAL_NVIC_SetPriority(SPI1_IRQn, 5, 0); | |
223 | + HAL_NVIC_EnableIRQ(SPI1_IRQn); | |
224 | + /* USER CODE BEGIN SPI1_MspInit 1 */ | |
225 | + | |
226 | + /* USER CODE END SPI1_MspInit 1 */ | |
227 | + } | |
228 | + | |
229 | +} | |
230 | + | |
231 | +void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi) | |
232 | +{ | |
233 | + | |
234 | + if(hspi->Instance==SPI1) | |
235 | + { | |
236 | + /* USER CODE BEGIN SPI1_MspDeInit 0 */ | |
237 | + | |
238 | + /* USER CODE END SPI1_MspDeInit 0 */ | |
239 | + /* Peripheral clock disable */ | |
240 | + __HAL_RCC_SPI1_CLK_DISABLE(); | |
241 | + | |
242 | + /**SPI1 GPIO Configuration | |
243 | + PA5 ------> SPI1_SCK | |
244 | + PA6 ------> SPI1_MISO | |
245 | + PA7 ------> SPI1_MOSI | |
246 | + */ | |
247 | + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7); | |
248 | + | |
249 | + /* SPI1 DMA DeInit */ | |
250 | + HAL_DMA_DeInit(hspi->hdmarx); | |
251 | + HAL_DMA_DeInit(hspi->hdmatx); | |
252 | + | |
253 | + /* SPI1 interrupt DeInit */ | |
254 | + HAL_NVIC_DisableIRQ(SPI1_IRQn); | |
255 | + /* USER CODE BEGIN SPI1_MspDeInit 1 */ | |
256 | + | |
257 | + /* USER CODE END SPI1_MspDeInit 1 */ | |
258 | + } | |
259 | + | |
260 | +} | |
261 | + | |
94 | 262 | void HAL_UART_MspInit(UART_HandleTypeDef* huart) |
95 | 263 | { |
96 | 264 | |
97 | 265 | GPIO_InitTypeDef GPIO_InitStruct; |
98 | - if(huart->Instance==USART2) | |
266 | + if(huart->Instance==USART1) | |
267 | + { | |
268 | + /* USER CODE BEGIN USART1_MspInit 0 */ | |
269 | + | |
270 | + /* USER CODE END USART1_MspInit 0 */ | |
271 | + /* Peripheral clock enable */ | |
272 | + __HAL_RCC_USART1_CLK_ENABLE(); | |
273 | + | |
274 | + /**USART1 GPIO Configuration | |
275 | + PA9 ------> USART1_TX | |
276 | + PA10 ------> USART1_RX | |
277 | + */ | |
278 | + GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10; | |
279 | + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | |
280 | + GPIO_InitStruct.Pull = GPIO_PULLUP; | |
281 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; | |
282 | + GPIO_InitStruct.Alternate = GPIO_AF7_USART1; | |
283 | + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); | |
284 | + | |
285 | + /* USART1 DMA Init */ | |
286 | + /* USART1_TX Init */ | |
287 | + hdma_usart1_tx.Instance = DMA1_Channel4; | |
288 | + hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; | |
289 | + hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE; | |
290 | + hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE; | |
291 | + hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; | |
292 | + hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; | |
293 | + hdma_usart1_tx.Init.Mode = DMA_NORMAL; | |
294 | + hdma_usart1_tx.Init.Priority = DMA_PRIORITY_LOW; | |
295 | + if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK) | |
296 | + { | |
297 | + _Error_Handler(__FILE__, __LINE__); | |
298 | + } | |
299 | + | |
300 | + __HAL_LINKDMA(huart,hdmatx,hdma_usart1_tx); | |
301 | + | |
302 | + /* USART1_RX Init */ | |
303 | + hdma_usart1_rx.Instance = DMA1_Channel5; | |
304 | + hdma_usart1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; | |
305 | + hdma_usart1_rx.Init.PeriphInc = DMA_PINC_DISABLE; | |
306 | + hdma_usart1_rx.Init.MemInc = DMA_MINC_ENABLE; | |
307 | + hdma_usart1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; | |
308 | + hdma_usart1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; | |
309 | + hdma_usart1_rx.Init.Mode = DMA_NORMAL; | |
310 | + hdma_usart1_rx.Init.Priority = DMA_PRIORITY_LOW; | |
311 | + if (HAL_DMA_Init(&hdma_usart1_rx) != HAL_OK) | |
312 | + { | |
313 | + _Error_Handler(__FILE__, __LINE__); | |
314 | + } | |
315 | + | |
316 | + __HAL_LINKDMA(huart,hdmarx,hdma_usart1_rx); | |
317 | + | |
318 | + /* USART1 interrupt Init */ | |
319 | + HAL_NVIC_SetPriority(USART1_IRQn, 5, 0); | |
320 | + HAL_NVIC_EnableIRQ(USART1_IRQn); | |
321 | + /* USER CODE BEGIN USART1_MspInit 1 */ | |
322 | + | |
323 | + /* USER CODE END USART1_MspInit 1 */ | |
324 | + } | |
325 | + else if(huart->Instance==USART2) | |
99 | 326 | { |
100 | 327 | /* USER CODE BEGIN USART2_MspInit 0 */ |
101 | 328 |
@@ -160,7 +387,31 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart) | ||
160 | 387 | void HAL_UART_MspDeInit(UART_HandleTypeDef* huart) |
161 | 388 | { |
162 | 389 | |
163 | - if(huart->Instance==USART2) | |
390 | + if(huart->Instance==USART1) | |
391 | + { | |
392 | + /* USER CODE BEGIN USART1_MspDeInit 0 */ | |
393 | + | |
394 | + /* USER CODE END USART1_MspDeInit 0 */ | |
395 | + /* Peripheral clock disable */ | |
396 | + __HAL_RCC_USART1_CLK_DISABLE(); | |
397 | + | |
398 | + /**USART1 GPIO Configuration | |
399 | + PA9 ------> USART1_TX | |
400 | + PA10 ------> USART1_RX | |
401 | + */ | |
402 | + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10); | |
403 | + | |
404 | + /* USART1 DMA DeInit */ | |
405 | + HAL_DMA_DeInit(huart->hdmatx); | |
406 | + HAL_DMA_DeInit(huart->hdmarx); | |
407 | + | |
408 | + /* USART1 interrupt DeInit */ | |
409 | + HAL_NVIC_DisableIRQ(USART1_IRQn); | |
410 | + /* USER CODE BEGIN USART1_MspDeInit 1 */ | |
411 | + | |
412 | + /* USER CODE END USART1_MspDeInit 1 */ | |
413 | + } | |
414 | + else if(huart->Instance==USART2) | |
164 | 415 | { |
165 | 416 | /* USER CODE BEGIN USART2_MspDeInit 0 */ |
166 | 417 |
@@ -41,8 +41,15 @@ | ||
41 | 41 | /* USER CODE END 0 */ |
42 | 42 | |
43 | 43 | /* External variables --------------------------------------------------------*/ |
44 | +extern I2C_HandleTypeDef hi2c1; | |
45 | +extern DMA_HandleTypeDef hdma_spi1_rx; | |
46 | +extern DMA_HandleTypeDef hdma_spi1_tx; | |
47 | +extern SPI_HandleTypeDef hspi1; | |
48 | +extern DMA_HandleTypeDef hdma_usart1_tx; | |
49 | +extern DMA_HandleTypeDef hdma_usart1_rx; | |
44 | 50 | extern DMA_HandleTypeDef hdma_usart2_tx; |
45 | 51 | extern DMA_HandleTypeDef hdma_usart2_rx; |
52 | +extern UART_HandleTypeDef huart1; | |
46 | 53 | extern UART_HandleTypeDef huart2; |
47 | 54 | |
48 | 55 | extern TIM_HandleTypeDef htim17; |
@@ -73,6 +80,62 @@ void SysTick_Handler(void) | ||
73 | 80 | /******************************************************************************/ |
74 | 81 | |
75 | 82 | /** |
83 | +* @brief This function handles DMA1 channel2 global interrupt. | |
84 | +*/ | |
85 | +void DMA1_Channel2_IRQHandler(void) | |
86 | +{ | |
87 | + /* USER CODE BEGIN DMA1_Channel2_IRQn 0 */ | |
88 | + | |
89 | + /* USER CODE END DMA1_Channel2_IRQn 0 */ | |
90 | + HAL_DMA_IRQHandler(&hdma_spi1_rx); | |
91 | + /* USER CODE BEGIN DMA1_Channel2_IRQn 1 */ | |
92 | + | |
93 | + /* USER CODE END DMA1_Channel2_IRQn 1 */ | |
94 | +} | |
95 | + | |
96 | +/** | |
97 | +* @brief This function handles DMA1 channel3 global interrupt. | |
98 | +*/ | |
99 | +void DMA1_Channel3_IRQHandler(void) | |
100 | +{ | |
101 | + /* USER CODE BEGIN DMA1_Channel3_IRQn 0 */ | |
102 | + | |
103 | + /* USER CODE END DMA1_Channel3_IRQn 0 */ | |
104 | + HAL_DMA_IRQHandler(&hdma_spi1_tx); | |
105 | + /* USER CODE BEGIN DMA1_Channel3_IRQn 1 */ | |
106 | + | |
107 | + /* USER CODE END DMA1_Channel3_IRQn 1 */ | |
108 | +} | |
109 | + | |
110 | +/** | |
111 | +* @brief This function handles DMA1 channel4 global interrupt. | |
112 | +*/ | |
113 | +void DMA1_Channel4_IRQHandler(void) | |
114 | +{ | |
115 | + /* USER CODE BEGIN DMA1_Channel4_IRQn 0 */ | |
116 | + | |
117 | + /* USER CODE END DMA1_Channel4_IRQn 0 */ | |
118 | + HAL_DMA_IRQHandler(&hdma_usart1_tx); | |
119 | + /* USER CODE BEGIN DMA1_Channel4_IRQn 1 */ | |
120 | + | |
121 | + /* USER CODE END DMA1_Channel4_IRQn 1 */ | |
122 | +} | |
123 | + | |
124 | +/** | |
125 | +* @brief This function handles DMA1 channel5 global interrupt. | |
126 | +*/ | |
127 | +void DMA1_Channel5_IRQHandler(void) | |
128 | +{ | |
129 | + /* USER CODE BEGIN DMA1_Channel5_IRQn 0 */ | |
130 | + | |
131 | + /* USER CODE END DMA1_Channel5_IRQn 0 */ | |
132 | + HAL_DMA_IRQHandler(&hdma_usart1_rx); | |
133 | + /* USER CODE BEGIN DMA1_Channel5_IRQn 1 */ | |
134 | + | |
135 | + /* USER CODE END DMA1_Channel5_IRQn 1 */ | |
136 | +} | |
137 | + | |
138 | +/** | |
76 | 139 | * @brief This function handles DMA1 channel6 global interrupt. |
77 | 140 | */ |
78 | 141 | void DMA1_Channel6_IRQHandler(void) |
@@ -115,6 +178,62 @@ void TIM1_TRG_COM_TIM17_IRQHandler(void) | ||
115 | 178 | } |
116 | 179 | |
117 | 180 | /** |
181 | +* @brief This function handles I2C1 event global interrupt / I2C1 wake-up interrupt through EXT line 23. | |
182 | +*/ | |
183 | +void I2C1_EV_IRQHandler(void) | |
184 | +{ | |
185 | + /* USER CODE BEGIN I2C1_EV_IRQn 0 */ | |
186 | + | |
187 | + /* USER CODE END I2C1_EV_IRQn 0 */ | |
188 | + HAL_I2C_EV_IRQHandler(&hi2c1); | |
189 | + /* USER CODE BEGIN I2C1_EV_IRQn 1 */ | |
190 | + | |
191 | + /* USER CODE END I2C1_EV_IRQn 1 */ | |
192 | +} | |
193 | + | |
194 | +/** | |
195 | +* @brief This function handles I2C1 error interrupt. | |
196 | +*/ | |
197 | +void I2C1_ER_IRQHandler(void) | |
198 | +{ | |
199 | + /* USER CODE BEGIN I2C1_ER_IRQn 0 */ | |
200 | + | |
201 | + /* USER CODE END I2C1_ER_IRQn 0 */ | |
202 | + HAL_I2C_ER_IRQHandler(&hi2c1); | |
203 | + /* USER CODE BEGIN I2C1_ER_IRQn 1 */ | |
204 | + | |
205 | + /* USER CODE END I2C1_ER_IRQn 1 */ | |
206 | +} | |
207 | + | |
208 | +/** | |
209 | +* @brief This function handles SPI1 global interrupt. | |
210 | +*/ | |
211 | +void SPI1_IRQHandler(void) | |
212 | +{ | |
213 | + /* USER CODE BEGIN SPI1_IRQn 0 */ | |
214 | + | |
215 | + /* USER CODE END SPI1_IRQn 0 */ | |
216 | + HAL_SPI_IRQHandler(&hspi1); | |
217 | + /* USER CODE BEGIN SPI1_IRQn 1 */ | |
218 | + | |
219 | + /* USER CODE END SPI1_IRQn 1 */ | |
220 | +} | |
221 | + | |
222 | +/** | |
223 | +* @brief This function handles USART1 global interrupt / USART1 wake-up interrupt through EXT line 25. | |
224 | +*/ | |
225 | +void USART1_IRQHandler(void) | |
226 | +{ | |
227 | + /* USER CODE BEGIN USART1_IRQn 0 */ | |
228 | + | |
229 | + /* USER CODE END USART1_IRQn 0 */ | |
230 | + HAL_UART_IRQHandler(&huart1); | |
231 | + /* USER CODE BEGIN USART1_IRQn 1 */ | |
232 | + | |
233 | + /* USER CODE END USART1_IRQn 1 */ | |
234 | +} | |
235 | + | |
236 | +/** | |
118 | 237 | * @brief This function handles USART2 global interrupt / USART2 wake-up interrupt through EXT line 26. |
119 | 238 | */ |
120 | 239 | void USART2_IRQHandler(void) |
@@ -1,7 +1,47 @@ | ||
1 | 1 | #MicroXplorer Configuration settings - do not modify |
2 | 2 | Dma.Request0=USART2_TX |
3 | 3 | Dma.Request1=USART2_RX |
4 | -Dma.RequestsNb=2 | |
4 | +Dma.Request2=SPI1_RX | |
5 | +Dma.Request3=SPI1_TX | |
6 | +Dma.Request4=USART1_TX | |
7 | +Dma.Request5=USART1_RX | |
8 | +Dma.RequestsNb=6 | |
9 | +Dma.SPI1_RX.2.Direction=DMA_PERIPH_TO_MEMORY | |
10 | +Dma.SPI1_RX.2.Instance=DMA1_Channel2 | |
11 | +Dma.SPI1_RX.2.MemDataAlignment=DMA_MDATAALIGN_BYTE | |
12 | +Dma.SPI1_RX.2.MemInc=DMA_MINC_ENABLE | |
13 | +Dma.SPI1_RX.2.Mode=DMA_NORMAL | |
14 | +Dma.SPI1_RX.2.PeriphDataAlignment=DMA_PDATAALIGN_BYTE | |
15 | +Dma.SPI1_RX.2.PeriphInc=DMA_PINC_DISABLE | |
16 | +Dma.SPI1_RX.2.Priority=DMA_PRIORITY_LOW | |
17 | +Dma.SPI1_RX.2.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority | |
18 | +Dma.SPI1_TX.3.Direction=DMA_MEMORY_TO_PERIPH | |
19 | +Dma.SPI1_TX.3.Instance=DMA1_Channel3 | |
20 | +Dma.SPI1_TX.3.MemDataAlignment=DMA_MDATAALIGN_BYTE | |
21 | +Dma.SPI1_TX.3.MemInc=DMA_MINC_ENABLE | |
22 | +Dma.SPI1_TX.3.Mode=DMA_NORMAL | |
23 | +Dma.SPI1_TX.3.PeriphDataAlignment=DMA_PDATAALIGN_BYTE | |
24 | +Dma.SPI1_TX.3.PeriphInc=DMA_PINC_DISABLE | |
25 | +Dma.SPI1_TX.3.Priority=DMA_PRIORITY_LOW | |
26 | +Dma.SPI1_TX.3.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority | |
27 | +Dma.USART1_RX.5.Direction=DMA_PERIPH_TO_MEMORY | |
28 | +Dma.USART1_RX.5.Instance=DMA1_Channel5 | |
29 | +Dma.USART1_RX.5.MemDataAlignment=DMA_MDATAALIGN_BYTE | |
30 | +Dma.USART1_RX.5.MemInc=DMA_MINC_ENABLE | |
31 | +Dma.USART1_RX.5.Mode=DMA_NORMAL | |
32 | +Dma.USART1_RX.5.PeriphDataAlignment=DMA_PDATAALIGN_BYTE | |
33 | +Dma.USART1_RX.5.PeriphInc=DMA_PINC_DISABLE | |
34 | +Dma.USART1_RX.5.Priority=DMA_PRIORITY_LOW | |
35 | +Dma.USART1_RX.5.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority | |
36 | +Dma.USART1_TX.4.Direction=DMA_MEMORY_TO_PERIPH | |
37 | +Dma.USART1_TX.4.Instance=DMA1_Channel4 | |
38 | +Dma.USART1_TX.4.MemDataAlignment=DMA_MDATAALIGN_BYTE | |
39 | +Dma.USART1_TX.4.MemInc=DMA_MINC_ENABLE | |
40 | +Dma.USART1_TX.4.Mode=DMA_NORMAL | |
41 | +Dma.USART1_TX.4.PeriphDataAlignment=DMA_PDATAALIGN_BYTE | |
42 | +Dma.USART1_TX.4.PeriphInc=DMA_PINC_DISABLE | |
43 | +Dma.USART1_TX.4.Priority=DMA_PRIORITY_LOW | |
44 | +Dma.USART1_TX.4.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority | |
5 | 45 | Dma.USART2_RX.1.Direction=DMA_PERIPH_TO_MEMORY |
6 | 46 | Dma.USART2_RX.1.Instance=DMA1_Channel6 |
7 | 47 | Dma.USART2_RX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE |
@@ -21,49 +61,71 @@ Dma.USART2_TX.0.PeriphInc=DMA_PINC_DISABLE | ||
21 | 61 | Dma.USART2_TX.0.Priority=DMA_PRIORITY_LOW |
22 | 62 | Dma.USART2_TX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority |
23 | 63 | FREERTOS.FootprintOK=true |
24 | -FREERTOS.IPParameters=Tasks01,FootprintOK | |
64 | +FREERTOS.IPParameters=Tasks01,FootprintOK,configTOTAL_HEAP_SIZE | |
25 | 65 | FREERTOS.Tasks01=defaultTask,0,128,StartDefaultTask,Default,NULL |
66 | +FREERTOS.configTOTAL_HEAP_SIZE=5000 | |
26 | 67 | File.Version=6 |
27 | 68 | KeepUserPlacement=true |
28 | 69 | Mcu.Family=STM32F3 |
29 | 70 | Mcu.IP0=DMA |
30 | 71 | Mcu.IP1=FREERTOS |
31 | -Mcu.IP2=NVIC | |
32 | -Mcu.IP3=RCC | |
33 | -Mcu.IP4=SYS | |
34 | -Mcu.IP5=USART2 | |
35 | -Mcu.IPNb=6 | |
72 | +Mcu.IP2=I2C1 | |
73 | +Mcu.IP3=NVIC | |
74 | +Mcu.IP4=RCC | |
75 | +Mcu.IP5=SPI1 | |
76 | +Mcu.IP6=SYS | |
77 | +Mcu.IP7=USART1 | |
78 | +Mcu.IP8=USART2 | |
79 | +Mcu.IPNb=9 | |
36 | 80 | Mcu.Name=STM32F303K(6-8)Tx |
37 | 81 | Mcu.Package=LQFP32 |
38 | 82 | Mcu.Pin0=PF0 / OSC_IN |
39 | 83 | Mcu.Pin1=PA2 |
40 | -Mcu.Pin2=PA13 | |
41 | -Mcu.Pin3=PA14 | |
42 | -Mcu.Pin4=PA15 | |
43 | -Mcu.Pin5=PB3 | |
44 | -Mcu.Pin6=VP_FREERTOS_VS_ENABLE | |
45 | -Mcu.Pin7=VP_SYS_VS_tim17 | |
46 | -Mcu.PinsNb=8 | |
84 | +Mcu.Pin10=PA15 | |
85 | +Mcu.Pin11=PB3 | |
86 | +Mcu.Pin12=PB6 | |
87 | +Mcu.Pin13=PB7 | |
88 | +Mcu.Pin14=VP_FREERTOS_VS_ENABLE | |
89 | +Mcu.Pin15=VP_SYS_VS_tim17 | |
90 | +Mcu.Pin2=PA4 | |
91 | +Mcu.Pin3=PA5 | |
92 | +Mcu.Pin4=PA6 | |
93 | +Mcu.Pin5=PA7 | |
94 | +Mcu.Pin6=PA9 | |
95 | +Mcu.Pin7=PA10 | |
96 | +Mcu.Pin8=PA13 | |
97 | +Mcu.Pin9=PA14 | |
98 | +Mcu.PinsNb=16 | |
47 | 99 | Mcu.UserConstants= |
48 | 100 | Mcu.UserName=STM32F303K8Tx |
49 | 101 | MxCube.Version=4.22.1 |
50 | 102 | MxDb.Version=DB.4.0.221 |
51 | 103 | NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:false\:false\:false |
104 | +NVIC.DMA1_Channel2_IRQn=true\:5\:0\:false\:false\:true\:true\:false | |
105 | +NVIC.DMA1_Channel3_IRQn=true\:5\:0\:false\:false\:true\:true\:false | |
106 | +NVIC.DMA1_Channel4_IRQn=true\:5\:0\:false\:false\:true\:true\:false | |
107 | +NVIC.DMA1_Channel5_IRQn=true\:5\:0\:false\:false\:true\:true\:false | |
52 | 108 | NVIC.DMA1_Channel6_IRQn=true\:5\:0\:false\:false\:true\:true\:false |
53 | 109 | NVIC.DMA1_Channel7_IRQn=true\:5\:0\:false\:false\:true\:true\:false |
54 | 110 | NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:false\:false\:false |
55 | 111 | NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:false\:false\:false |
112 | +NVIC.I2C1_ER_IRQn=true\:5\:0\:false\:false\:true\:true\:true | |
113 | +NVIC.I2C1_EV_IRQn=true\:5\:0\:false\:false\:true\:true\:true | |
56 | 114 | NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:false\:false\:false |
57 | 115 | NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:false\:false\:false |
58 | 116 | NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false |
59 | 117 | NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 |
118 | +NVIC.SPI1_IRQn=true\:5\:0\:false\:false\:true\:true\:true | |
60 | 119 | NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false |
61 | 120 | NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:true\:true |
62 | 121 | NVIC.TIM1_TRG_COM_TIM17_IRQn=true\:0\:0\:false\:false\:true\:false\:false |
63 | 122 | NVIC.TimeBase=TIM1_TRG_COM_TIM17_IRQn |
64 | 123 | NVIC.TimeBaseIP=TIM17 |
124 | +NVIC.USART1_IRQn=true\:5\:0\:false\:false\:true\:true\:true | |
65 | 125 | NVIC.USART2_IRQn=true\:5\:0\:false\:false\:true\:true\:true |
66 | 126 | NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:false\:false\:false |
127 | +PA10.Mode=Asynchronous | |
128 | +PA10.Signal=USART1_RX | |
67 | 129 | PA13.GPIOParameters=GPIO_Label |
68 | 130 | PA13.GPIO_Label=SWDIO |
69 | 131 | PA13.Locked=true |
@@ -84,11 +146,29 @@ PA2.GPIO_Label=VCP_TX | ||
84 | 146 | PA2.Locked=true |
85 | 147 | PA2.Mode=Asynchronous |
86 | 148 | PA2.Signal=USART2_TX |
149 | +PA4.GPIOParameters=GPIO_Speed,PinState,GPIO_Label | |
150 | +PA4.GPIO_Label=SPI_CS | |
151 | +PA4.GPIO_Speed=GPIO_SPEED_FREQ_MEDIUM | |
152 | +PA4.Locked=true | |
153 | +PA4.PinState=GPIO_PIN_SET | |
154 | +PA4.Signal=GPIO_Output | |
155 | +PA5.Mode=Full_Duplex_Master | |
156 | +PA5.Signal=SPI1_SCK | |
157 | +PA6.Mode=Full_Duplex_Master | |
158 | +PA6.Signal=SPI1_MISO | |
159 | +PA7.Mode=Full_Duplex_Master | |
160 | +PA7.Signal=SPI1_MOSI | |
161 | +PA9.Mode=Asynchronous | |
162 | +PA9.Signal=USART1_TX | |
87 | 163 | PB3.GPIOParameters=PinState,GPIO_Label |
88 | 164 | PB3.GPIO_Label=LED |
89 | 165 | PB3.Locked=true |
90 | 166 | PB3.PinState=GPIO_PIN_SET |
91 | 167 | PB3.Signal=GPIO_Output |
168 | +PB6.Mode=I2C | |
169 | +PB6.Signal=I2C1_SCL | |
170 | +PB7.Mode=I2C | |
171 | +PB7.Signal=I2C1_SDA | |
92 | 172 | PCC.Checker=false |
93 | 173 | PCC.Line=STM32F303 |
94 | 174 | PCC.MCU=STM32F303K(6-8)Tx |
@@ -112,7 +192,7 @@ ProjectManager.DeviceId=STM32F303K8Tx | ||
112 | 192 | ProjectManager.FirmwarePackage=STM32Cube FW_F3 V1.9.0 |
113 | 193 | ProjectManager.FreePins=false |
114 | 194 | ProjectManager.HalAssertFull=true |
115 | -ProjectManager.HeapSize=0x1800 | |
195 | +ProjectManager.HeapSize=0x1000 | |
116 | 196 | ProjectManager.KeepUserCode=true |
117 | 197 | ProjectManager.LastFirmware=true |
118 | 198 | ProjectManager.LibraryCopy=1 |
@@ -124,7 +204,7 @@ ProjectManager.StackSize=0x400 | ||
124 | 204 | ProjectManager.TargetToolchain=SW4STM32 |
125 | 205 | ProjectManager.ToolChainLocation= |
126 | 206 | ProjectManager.UnderRoot=true |
127 | -ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL,2-MX_DMA_Init-DMA-false-HAL,3-SystemClock_Config-RCC-false-HAL,4-MX_USART2_UART_Init-USART2-false-HAL | |
207 | +ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL,2-MX_DMA_Init-DMA-false-HAL,3-SystemClock_Config-RCC-false-HAL,4-MX_USART2_UART_Init-USART2-false-HAL,5-MX_USART1_UART_Init-USART1-false-HAL,6-MX_I2C1_Init-I2C1-false-HAL,7-MX_SPI1_Init-SPI1-false-HAL | |
128 | 208 | RCC.AHBFreq_Value=8000000 |
129 | 209 | RCC.APB1Freq_Value=8000000 |
130 | 210 | RCC.APB2Freq_Value=8000000 |
@@ -149,6 +229,15 @@ RCC.TimSysFreq_Value=8000000 | ||
149 | 229 | RCC.USART1Freq_Value=8000000 |
150 | 230 | RCC.USART2Freq_Value=8000000 |
151 | 231 | RCC.VCOOutput2Freq_Value=4000000 |
232 | +SPI1.CalculateBaudRate=4.0 MBits/s | |
233 | +SPI1.Direction=SPI_DIRECTION_2LINES | |
234 | +SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate | |
235 | +SPI1.Mode=SPI_MODE_MASTER | |
236 | +SPI1.VirtualType=VM_MASTER | |
237 | +USART1.BaudRate=9600 | |
238 | +USART1.IPParameters=VirtualMode-Asynchronous,BaudRate,WordLength | |
239 | +USART1.VirtualMode-Asynchronous=VM_ASYNC | |
240 | +USART1.WordLength=WORDLENGTH_8B | |
152 | 241 | USART2.BaudRate=115200 |
153 | 242 | USART2.IPParameters=VirtualMode-Asynchronous,BaudRate,WordLength |
154 | 243 | USART2.VirtualMode-Asynchronous=VM_ASYNC |