Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张亚玄
/
STM32Test
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
499ce9a5
authored
2019-10-30 22:18:25 +0800
by
张亚玄
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add exti
1 parent
62723c52
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
105 additions
and
40 deletions
.mxproject
Core/Inc/Hardware/key.h
Core/Inc/Hardware/led.h
Core/Inc/main.h
Core/Inc/stm32f0xx_it.h
Core/Inc/usart.h
Core/Src/Hardware/key.c
Core/Src/Hardware/led.c
Core/Src/freertos.c
Core/Src/gpio.c
Core/Src/stm32f0xx_it.c
Core/Src/usart.c
STM32Test Debug.launch
STM32Test.ioc
.mxproject
View file @
499ce9a
...
...
@@ -21,6 +21,8 @@ SourceFiles#5=F:/IoT/STM32/workspace/STM32Test/Core/Src/stm32f0xx_it.c
SourceFiles#6=F:/IoT/STM32/workspace/STM32Test/Core/Src/stm32f0xx_hal_msp.c
HeaderFiles#6=F:/IoT/STM32/workspace/STM32Test/Core/Inc/main.h
SourceFiles#7=F:/IoT/STM32/workspace/STM32Test/Core/Src/main.c
HeaderFiles=;
SourceFiles=;
[PreviousLibFiles]
LibFiles=Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_def.h;Drivers/STM32F0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_cortex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_exti.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_uart.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_uart_ex.h;Middlewares/Third_Party/FreeRTOS/Source/include/croutine.h;Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h;Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h;Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h;Middlewares/Third_Party/FreeRTOS/Source/include/list.h;Middlewares/Third_Party/FreeRTOS/Source/include/message_buffer.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_prototypes.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h;Middlewares/Third_Party/FreeRTOS/Source/include/portable.h;Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h;Middlewares/Third_Party/FreeRTOS/Source/include/queue.h;Middlewares/Third_Party/FreeRTOS/Source/include/semphr.h;Middlewares/Third_Party/FreeRTOS/Source/include/stack_macros.h;Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h;Middlewares/Third_Party/FreeRTOS/Source/include/stream_buffer.h;Middlewares/Third_Party/FreeRTOS/Source/include/task.h;Middlewares/Third_Party/FreeRTOS/Source/include/timers.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM0/portmacro.h;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_gpio.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_dma.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cortex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_exti.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_uart.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_uart_ex.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/queue.c;Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c;Middlewares/Third_Party/FreeRTOS/Source/tasks.c;Middlewares/Third_Party/FreeRTOS/Source/timers.c;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c;Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM0/port.c;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_def.h;Drivers/STM32F0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_cortex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_exti.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_uart.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_uart_ex.h;Middlewares/Third_Party/FreeRTOS/Source/include/croutine.h;Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h;Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h;Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h;Middlewares/Third_Party/FreeRTOS/Source/include/list.h;Middlewares/Third_Party/FreeRTOS/Source/include/message_buffer.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_prototypes.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h;Middlewares/Third_Party/FreeRTOS/Source/include/portable.h;Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h;Middlewares/Third_Party/FreeRTOS/Source/include/queue.h;Middlewares/Third_Party/FreeRTOS/Source/include/semphr.h;Middlewares/Third_Party/FreeRTOS/Source/include/stack_macros.h;Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h;Middlewares/Third_Party/FreeRTOS/Source/include/stream_buffer.h;Middlewares/Third_Party/FreeRTOS/Source/include/task.h;Middlewares/Third_Party/FreeRTOS/Source/include/timers.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h;Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM0/portmacro.h;Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f030x8.h;Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f0xx.h;Drivers/CMSIS/Device/ST/STM32F0xx/Include/system_stm32f0xx.h;Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.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;
...
...
Core/Inc/Hardware/key.h
View file @
499ce9a
...
...
@@ -13,7 +13,15 @@
#include "stm32f0xx_hal_gpio.h"
/* key scan defines --------------------------------------------------------*/
#define KEY_read() HAL_GPIO_ReadPin(KEY_GPIO_Port, KEY_Pin)
#define KEY1_read() HAL_GPIO_ReadPin(KEY1_GPIO_Port, KEY1_Pin)
#define KEY2_read() HAL_GPIO_ReadPin(KEY2_GPIO_Port, KEY2_Pin)
#define KEY1_UP 1
#define KEY1_DOWN !KEY1_UP
#define KEY2_UP 0
#define KEY2_DOWN !KEY2_UP
/* Exported functions --------------------------------------------------------*/
extern
uint8_t
KEY_Scan
(
uint8_t
mode
);
...
...
Core/Inc/Hardware/led.h
View file @
499ce9a
...
...
@@ -32,6 +32,8 @@ typedef enum
#define LED2_Reset() HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET)
#define LED2_Set() HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET)
extern
LED_State
ledState
;
/* Exported functions --------------------------------------------------------*/
extern
void
LED_StateControl
(
LED_State
ledMode
);
...
...
Core/Inc/main.h
View file @
499ce9a
...
...
@@ -32,11 +32,7 @@ extern "C" {
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <stdio.h>
#include "led.h"
#include "beep.h"
#include "key.h"
#include "usart.h"
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
...
...
@@ -72,8 +68,11 @@ void Error_Handler(void);
#define LED2_GPIO_Port GPIOB
#define LED1_Pin GPIO_PIN_7
#define LED1_GPIO_Port GPIOB
#define KEY_Pin GPIO_PIN_9
#define KEY_GPIO_Port GPIOB
#define KEY1_Pin GPIO_PIN_8
#define KEY1_GPIO_Port GPIOB
#define KEY1_EXTI_IRQn EXTI4_15_IRQn
#define KEY2_Pin GPIO_PIN_9
#define KEY2_GPIO_Port GPIOB
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
...
...
Core/Inc/stm32f0xx_it.h
View file @
499ce9a
...
...
@@ -49,6 +49,7 @@
/* Exported functions prototypes ---------------------------------------------*/
void
NMI_Handler
(
void
);
void
HardFault_Handler
(
void
);
void
EXTI4_15_IRQHandler
(
void
);
void
TIM1_BRK_UP_TRG_COM_IRQHandler
(
void
);
void
USART2_IRQHandler
(
void
);
/* USER CODE BEGIN EFP */
...
...
Core/Inc/usart.h
View file @
499ce9a
...
...
@@ -27,21 +27,20 @@
#include "main.h"
/* USER CODE BEGIN Includes */
#define USART_REC_LEN 200 // æœ?大接收å—节数
extern
uint8_t
USART_RX_BUF
[
USART_REC_LEN
];
// 接收缓冲,最大USART_REC_LEN个å—节,末å—节为æ¢è¡Œ
extern
uint16_t
USART_RX_STA
;
// 接收状æ??
#define RXBUFFERSIZE 1 // 缓å˜å¤§å°
extern
uint8_t
aRxBuffer
[
RXBUFFERSIZE
];
// HAL库USART接收Buffer
#include <stdio.h>
/* USER CODE END Includes */
extern
UART_HandleTypeDef
huart1
;
extern
UART_HandleTypeDef
huart2
;
/* USER CODE BEGIN Private defines */
#define USART_REC_LEN 200
extern
uint8_t
USART_RX_BUF
[
USART_REC_LEN
];
// 接收缓冲,最大USART_REC_LEN个字节,末字节为换行
extern
uint16_t
USART_RX_STA
;
#define RXBUFFERSIZE 1 // 缓存大小
extern
uint8_t
aRxBuffer
[
RXBUFFERSIZE
];
// HAL库USART接收Buffer
/* USER CODE END Private defines */
void
MX_USART1_UART_Init
(
void
);
...
...
Core/Src/Hardware/key.c
View file @
499ce9a
...
...
@@ -7,6 +7,7 @@
/* Includes ------------------------------------------------------------------*/
#include "key.h"
#include "led.h"
#include "cmsis_os.h"
/**
...
...
@@ -20,19 +21,34 @@ uint8_t KEY_Scan(uint8_t mode)
{
key_up
=
1
;
}
if
(
key_up
&&
KEY
_read
()
==
1
)
if
(
key_up
&&
KEY
2_read
()
==
KEY2_DOWN
)
{
osDelay
(
10
);
key_up
=
0
;
if
(
KEY
_read
()
==
1
)
if
(
KEY
2_read
()
==
KEY2_DOWN
)
{
return
1
;
}
}
else
if
(
KEY
_read
()
==
0
)
else
if
(
KEY
2_read
()
==
KEY2_UP
)
{
key_up
=
1
;
}
return
0
;
}
void
HAL_GPIO_EXTI_Callback
(
uint16_t
GPIO_Pin
)
{
switch
(
GPIO_Pin
)
{
case
GPIO_PIN_8
:
osDelay
(
30
);
if
(
KEY1_read
()
==
KEY1_DOWN
)
{
ledState
++
;
}
break
;
default:
break
;
}
}
...
...
Core/Src/Hardware/led.c
View file @
499ce9a
...
...
@@ -8,6 +8,8 @@
/* Includes ------------------------------------------------------------------*/
#include <Hardware/led.h>
LED_State
ledState
=
LED00
;
/**
* control led by different modes.
* @param ledMode led control modes
...
...
Core/Src/freertos.c
View file @
499ce9a
...
...
@@ -26,6 +26,11 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <stdio.h>
#include "led.h"
#include "beep.h"
#include "key.h"
#include "usart.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
...
...
@@ -151,13 +156,12 @@ void StartLEDTask(void *argument)
{
/* USER CODE BEGIN StartLEDTask */
static
LED_State
ledState
=
LED00
;
/* Infinite loop */
for
(;;)
{
ledState
=
ledState
%
LED_TOTAL_STATE_NUM
;
LED_StateControl
(
ledState
);
ledState
=
(
ledState
+
1
)
%
LED_TOTAL_STATE_NUM
;
osDelay
(
500
);
osDelay
(
1
);
}
/* USER CODE END StartLEDTask */
}
...
...
@@ -178,7 +182,7 @@ void StartKeyScanTask(void *argument)
if
(
KEY_Scan
(
0
))
{
BEEP_call
();
}
osDelay
(
1
0
);
osDelay
(
1
);
}
/* USER CODE END StartKeyScanTask */
}
...
...
Core/Src/gpio.c
View file @
499ce9a
...
...
@@ -69,10 +69,20 @@ void MX_GPIO_Init(void)
HAL_GPIO_Init
(
GPIOB
,
&
GPIO_InitStruct
);
/*Configure GPIO pin : PtPin */
GPIO_InitStruct
.
Pin
=
KEY_Pin
;
GPIO_InitStruct
.
Pin
=
KEY1_Pin
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_IT_FALLING
;
GPIO_InitStruct
.
Pull
=
GPIO_PULLUP
;
HAL_GPIO_Init
(
KEY1_GPIO_Port
,
&
GPIO_InitStruct
);
/*Configure GPIO pin : PtPin */
GPIO_InitStruct
.
Pin
=
KEY2_Pin
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_INPUT
;
GPIO_InitStruct
.
Pull
=
GPIO_PULLDOWN
;
HAL_GPIO_Init
(
KEY_GPIO_Port
,
&
GPIO_InitStruct
);
HAL_GPIO_Init
(
KEY2_GPIO_Port
,
&
GPIO_InitStruct
);
/* EXTI interrupt init*/
HAL_NVIC_SetPriority
(
EXTI4_15_IRQn
,
3
,
0
);
HAL_NVIC_EnableIRQ
(
EXTI4_15_IRQn
);
}
...
...
Core/Src/stm32f0xx_it.c
View file @
499ce9a
...
...
@@ -25,6 +25,7 @@
#include "task.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "usart.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
...
...
@@ -104,6 +105,20 @@ void HardFault_Handler(void)
/******************************************************************************/
/**
* @brief This function handles EXTI line 4 to 15 interrupts.
*/
void
EXTI4_15_IRQHandler
(
void
)
{
/* USER CODE BEGIN EXTI4_15_IRQn 0 */
/* USER CODE END EXTI4_15_IRQn 0 */
HAL_GPIO_EXTI_IRQHandler
(
GPIO_PIN_8
);
/* USER CODE BEGIN EXTI4_15_IRQn 1 */
/* USER CODE END EXTI4_15_IRQn 1 */
}
/**
* @brief This function handles TIM1 break, update, trigger and commutation interrupts.
*/
void
TIM1_BRK_UP_TRG_COM_IRQHandler
(
void
)
...
...
Core/Src/usart.c
View file @
499ce9a
...
...
@@ -197,7 +197,7 @@ void _sys_exit(int x)
*/
int
fputc
(
int
ch
,
FILE
*
f
)
{
while
((
USART1
->
ISR
&
0X40
)
==
0
);
// 循环发??
while
((
USART1
->
ISR
&
0X40
)
==
0
);
// 循环发
�
??
USART1
->
RDR
=
(
uint8_t
)
ch
;
return
ch
;
}
...
...
@@ -209,16 +209,16 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
if
(
huart
->
Instance
==
USART2
)
// 串口1
{
if
((
USART_RX_STA
&
0x8000
)
==
0
)
// 接收未完??
if
((
USART_RX_STA
&
0x8000
)
==
0
)
// 接收未完??
??
{
if
(
USART_RX_STA
&
0x4000
)
// 接收到了0x0D
{
if
(
aRxBuffer
[
0
]
!=
0x0a
)
USART_RX_STA
=
0
;
// 接收错误,重新接??
USART_RX_STA
=
0
;
// 接收错误,重新接??
??
else
USART_RX_STA
|=
0x8000
;
// 接收完成
}
else
// 还没接收??0x0D
else
// 还没接收??
??
0x0D
{
if
(
aRxBuffer
[
0
]
==
0x0d
)
{
...
...
@@ -230,7 +230,7 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
USART_RX_STA
++
;
if
(
USART_RX_STA
>
(
USART_REC_LEN
-
1
))
{
USART_RX_STA
=
0
;
// 接收错误,重新开始接??
USART_RX_STA
=
0
;
// 接收错误,重新开始接??
??
}
}
}
...
...
STM32Test Debug.launch
View file @
499ce9a
...
...
@@ -11,7 +11,7 @@
<booleanAttribute
key=
"com.st.stm32cube.ide.mcu.debug.jlink.scan_chain_auto"
value=
"true"
/>
<intAttribute
key=
"com.st.stm32cube.ide.mcu.debug.jlink.scan_chain_irpre"
value=
"0"
/>
<intAttribute
key=
"com.st.stm32cube.ide.mcu.debug.jlink.scan_chain_pos"
value=
"0"
/>
<stringAttribute
key=
"com.st.stm32cube.ide.mcu.debug.jlink.selected_rtos"
value=
"
RTOSPlugin_Free
RTOS"
/>
<stringAttribute
key=
"com.st.stm32cube.ide.mcu.debug.jlink.selected_rtos"
value=
"
No
RTOS"
/>
<stringAttribute
key=
"com.st.stm32cube.ide.mcu.debug.launch.access_port_id"
value=
"0"
/>
<booleanAttribute
key=
"com.st.stm32cube.ide.mcu.debug.launch.enable_live_expr"
value=
"true"
/>
<booleanAttribute
key=
"com.st.stm32cube.ide.mcu.debug.launch.enable_swv"
value=
"false"
/>
...
...
@@ -70,9 +70,6 @@
<listAttribute
key=
"org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"
>
<listEntry
value=
"4"
/>
</listAttribute>
<listAttribute
key=
"org.eclipse.debug.ui.favoriteGroups"
>
<listEntry
value=
"org.eclipse.debug.ui.launchGroup.debug"
/>
</listAttribute>
<stringAttribute
key=
"org.eclipse.dsf.launch.MEMORY_BLOCKS"
value=
"<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="reserved-for-future-use"/> "
/>
<stringAttribute
key=
"process_factory_id"
value=
"org.eclipse.cdt.dsf.gdb.GdbProcessFactory"
/>
</launchConfiguration>
...
...
STM32Test.ioc
View file @
499ce9a
...
...
@@ -21,9 +21,10 @@ Mcu.Pin1=PC15-OSC32_OUT
Mcu.Pin10=PA14
Mcu.Pin11=PB6
Mcu.Pin12=PB7
Mcu.Pin13=PB9
Mcu.Pin14=VP_FREERTOS_VS_CMSIS_V2
Mcu.Pin15=VP_SYS_VS_tim1
Mcu.Pin13=PB8
Mcu.Pin14=PB9
Mcu.Pin15=VP_FREERTOS_VS_CMSIS_V2
Mcu.Pin16=VP_SYS_VS_tim1
Mcu.Pin2=PF0-OSC_IN
Mcu.Pin3=PF1-OSC_OUT
Mcu.Pin4=PA2
...
...
@@ -32,12 +33,13 @@ Mcu.Pin6=PA9
Mcu.Pin7=PA10
Mcu.Pin8=PA12
Mcu.Pin9=PA13
Mcu.PinsNb=1
6
Mcu.PinsNb=1
7
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F030C8Tx
MxCube.Version=5.4.0
MxDb.Version=DB.5.0.40
NVIC.EXTI4_15_IRQn=true\:3\:0\:false\:false\:true\:true\:true\:true
NVIC.ForceEnableDMAVector=true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
...
...
@@ -85,8 +87,14 @@ PB7.GPIO_Speed=GPIO_SPEED_FREQ_HIGH
PB7.Locked=true
PB7.PinState=GPIO_PIN_RESET
PB7.Signal=GPIO_Output
PB8.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI
PB8.GPIO_Label=KEY1
PB8.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING
PB8.GPIO_PuPd=GPIO_PULLUP
PB8.Locked=true
PB8.Signal=GPXTI8
PB9.GPIOParameters=GPIO_PuPd,GPIO_Label
PB9.GPIO_Label=KEY
PB9.GPIO_Label=KEY
2
PB9.GPIO_PuPd=GPIO_PULLDOWN
PB9.Locked=true
PB9.Signal=GPIO_Input
...
...
@@ -133,7 +141,7 @@ ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=STM32CubeIDE
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=true
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,
2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_USART1_UART_Init-USART1
-false-HAL-true
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,
1-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_USART2_UART_Init-USART2
-false-HAL-true
RCC.AHBFreq_Value=48000000
RCC.APB1Freq_Value=48000000
RCC.APB1TimFreq_Value=48000000
...
...
@@ -149,6 +157,8 @@ RCC.SYSCLKFreq_VALUE=48000000
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
RCC.TimSysFreq_Value=48000000
RCC.USART1Freq_Value=48000000
SH.GPXTI8.0=GPIO_EXTI8
SH.GPXTI8.ConfNb=1
USART1.BaudRate=115200
USART1.IPParameters=VirtualMode-Asynchronous,BaudRate
USART1.VirtualMode-Asynchronous=VM_ASYNC
...
...
Please
register
or
sign in
to post a comment