Ble Transmit Success

This commit is contained in:
2025-06-25 21:34:21 +08:00
parent 18c43dbb18
commit 331d7dedb7
19 changed files with 10307 additions and 6666 deletions

View File

@@ -33,7 +33,11 @@
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
#define BLE_RX_THREAD_STACK_SIZE 1024
#define BLE_RX_THREAD_PRIORITY 10
#define BLE_TX_THREAD_STACK_SIZE 1024
#define BLE_TX_THREAD_PRIORITY 10
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
@@ -49,7 +53,16 @@ TX_EVENT_FLAGS_GROUP system_events;
MotorCommand current_motor_cmd = {0,0};
_GPSData gps_data;
TX_THREAD ble_rx_thread;
UCHAR ble_rx_stack[BLE_RX_THREAD_STACK_SIZE];
TX_THREAD ble_tx_thread;
UCHAR ble_tx_stack[BLE_TX_THREAD_STACK_SIZE];
#define BLE_TX_QUEUE_DEPTH 4
UCHAR ble_tx_queue_buffer[BLE_TX_QUEUE_DEPTH * sizeof(BLE_Message)];
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
@@ -69,14 +82,40 @@ _GPSData gps_data;
*/
UINT App_ThreadX_Init(VOID *memory_ptr)
{
UINT ret = TX_SUCCESS;
// UINT ret = TX_SUCCESS;
/* USER CODE BEGIN App_ThreadX_MEM_POOL */
UINT status;
//初始化BLE接收任务
// 初始化 BLE 接收任务
status = tx_thread_create(&ble_rx_thread, "BLE RX Thread",
ble_rx_task_entry, 0,
ble_rx_stack, BLE_RX_THREAD_STACK_SIZE,
BLE_RX_THREAD_PRIORITY, BLE_RX_THREAD_PRIORITY,
TX_NO_TIME_SLICE, TX_AUTO_START);
if (status != TX_SUCCESS) {
return status;
}
// 创建 BLE TX 线程
status = tx_thread_create(&ble_tx_thread, "BLE TX Thread",
ble_tx_task_entry, 0,
ble_tx_stack, BLE_TX_THREAD_STACK_SIZE,
BLE_TX_THREAD_PRIORITY, BLE_TX_THREAD_PRIORITY,
TX_NO_TIME_SLICE, TX_AUTO_START);
if (status != TX_SUCCESS) return status;
// ✅ 创建 BLE TX 消息队列
status = tx_queue_create(&ble_tx_queue, "BLE TX Queue",
sizeof(BLE_Message)/sizeof(ULONG),
ble_tx_queue_buffer,
sizeof(ble_tx_queue_buffer));
if (status != TX_SUCCESS) return status;
/* USER CODE END App_ThreadX_MEM_POOL */
/* USER CODE BEGIN App_ThreadX_Init */
/* USER CODE END App_ThreadX_Init */
return ret;
return TX_SUCCESS;
}
/**

View File

@@ -100,11 +100,15 @@ int main(void)
MX_UART4_Init();
MX_TIM1_Init();
MX_TIM8_Init();
// MX_ThreadX_Init();
/* USER CODE BEGIN 2 */
HCBle_InitDMAReception();
HAL_Delay(200);
/* USER CODE END 2 */
MX_ThreadX_Init();
// MX_ThreadX_Init();
/* We should never get here as control is now taken by the scheduler */
@@ -113,7 +117,16 @@ int main(void)
while (1)
{
/* USER CODE END WHILE */
if(flag == 1)
{
HCBle_ExtractAndParseFrame();
flag = 0;
}
// Ŀǰ BLE<4C>Ľ<EFBFBD><C4BD>ջ<EFBFBD>û<EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ƿ<EFBFBD><C7B7>ʹ<EFBFBD><CDB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
HCBle_SendData("#{\"lat\":%.6f,\"lon\":%.6f,\"angle\":%.2f}\n",
23.123456, 113.654321, 95.0);
HAL_Delay(1000);
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */

View File

@@ -289,13 +289,29 @@ void USART3_IRQHandler(void)
*/
void UART4_IRQHandler(void)
{
/* USER CODE BEGIN UART4_IRQn 0 */
/* USER CODE END UART4_IRQn 0 */
HAL_UART_IRQHandler(&huart4);
/* USER CODE BEGIN UART4_IRQn 1 */
/* USER CODE END UART4_IRQn 1 */
if (__HAL_UART_GET_FLAG(&huart4, UART_FLAG_IDLE))
{
__HAL_UART_CLEAR_IDLEFLAG(&huart4); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>жϱ<D0B6>־
// ֹͣDMA
HAL_UART_DMAStop(&huart4);
// <20><><EFBFBD><EFBFBD>ʵ<EFBFBD>ʽ<EFBFBD><CABD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
uint16_t len = UART_DMA_RX_BUF_SIZE - __HAL_DMA_GET_COUNTER(huart4.hdmarx);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ring buffer
for (uint16_t i = 0; i < len; i++)
{
ble_rx_ring.buffer[ble_rx_ring.head] = uart_dma_rx_buf[i];
ble_rx_ring.head = (ble_rx_ring.head + 1) % RING_BUFFER_SIZE;
}
flag = 1;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DMA
HAL_UART_Receive_DMA(&huart4, uart_dma_rx_buf, UART_DMA_RX_BUF_SIZE);
}
}
/* USER CODE BEGIN 1 */

File diff suppressed because one or more lines are too long

View File

@@ -117,6 +117,21 @@
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGTARM</Key>
<Name>(6010=-1,-1,-1,-1,0)(6018=-1,-1,-1,-1,0)(6019=-1,-1,-1,-1,0)(6008=-1,-1,-1,-1,0)(6009=-1,-1,-1,-1,0)(6014=-1,-1,-1,-1,0)(6015=-1,-1,-1,-1,0)(6003=-1,-1,-1,-1,0)(6000=-1,-1,-1,-1,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMDBGFLAGS</Key>
<Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
<Name>(105=-1,-1,-1,-1,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>CMSIS_AGDI_V8M</Key>
@@ -130,10 +145,55 @@
<SetRegEntry>
<Number>0</Number>
<Key>ST-LINKIII-KEIL_SWO</Key>
<Name>-U-O142 -O2254 -S0 -C0 -A1 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32H5xx_2M_0800.FLM -FS08000000 -FL0200000 -FP0($$Device:STM32H563ZITx$CMSIS\Flash\STM32H5xx_2M_0800.FLM)</Name>
<Name>-U004200403132511238363431 -O2254 -SF10000 -C0 -A1 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(6BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32H5xx_2M_0800.FLM -FS08000000 -FL0200000 -FP0($$Device:STM32H563ZITx$CMSIS\Flash\STM32H5xx_2M_0800.FLM) -WA0 -WE0 -WVCE4 -WS2710 -WM0 -WP2 -WK0</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>120</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>../Core/Src/main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>117</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>../Core/Src/main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>
<count>0</count>
<WinNumber>1</WinNumber>
<ItemText>cmd</ItemText>
</Ww>
<Ww>
<count>1</count>
<WinNumber>1</WinNumber>
<ItemText>HC_Send_Data</ItemText>
</Ww>
</WatchWindow1>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
@@ -178,7 +238,7 @@
<pMultCmdsp></pMultCmdsp>
<DebugDescription>
<Enable>1</Enable>
<EnableFlashSeq>1</EnableFlashSeq>
<EnableFlashSeq>0</EnableFlashSeq>
<EnableLog>0</EnableLog>
<Protocol>2</Protocol>
<DbgClock>10000000</DbgClock>

View File

@@ -27,199 +27,9 @@ Project File Date: 06/25/2025
<h2>Output:</h2>
*** Using Compiler 'V6.21', folder: 'D:\keil5\ARM\ARMCLANG\Bin'
Build target 'AutoGuideStick'
compiling tim.c...
compiling gpdma.c...
compiling gpio.c...
compiling main.c...
compiling memorymap.c...
assembling startup_stm32h563xx.s...
compiling stm32h5xx_hal_timebase_tim.c...
compiling stm32h5xx_it.c...
compiling stm32h5xx_hal_tim_ex.c...
compiling stm32h5xx_hal_tim.c...
compiling usart.c...
compiling stm32h5xx_hal_msp.c...
compiling app_azure_rtos.c...
compiling app_threadx.c...
compiling stm32h5xx_hal_cortex.c...
compiling stm32h5xx_hal_rcc.c...
compiling stm32h5xx_hal_flash.c...
compiling stm32h5xx_hal_flash_ex.c...
compiling stm32h5xx_hal_gpio.c...
compiling stm32h5xx_hal_rcc_ex.c...
compiling stm32h5xx_hal_pwr.c...
compiling stm32h5xx_hal_dma.c...
compiling stm32h5xx_hal_pwr_ex.c...
compiling stm32h5xx_hal_dma_ex.c...
compiling stm32h5xx_hal.c...
compiling stm32h5xx_hal_exti.c...
compiling stm32h5xx_hal_uart_ex.c...
compiling stm32h5xx_hal_uart.c...
compiling system_stm32h5xx.c...
compiling tx_initialize_high_level.c...
compiling tx_initialize_kernel_enter.c...
compiling tx_thread_stack_error_notify.c...
compiling tx_initialize_kernel_setup.c...
compiling tx_thread_system_resume.c...
compiling tx_thread_stack_error_handler.c...
compiling tx_block_pool_create.c...
compiling tx_block_allocate.c...
compiling tx_block_pool_cleanup.c...
compiling tx_block_pool_delete.c...
compiling tx_block_pool_info_get.c...
compiling tx_block_pool_initialize.c...
compiling tx_block_pool_prioritize.c...
compiling tx_block_release.c...
compiling tx_byte_allocate.c...
compiling tx_byte_pool_cleanup.c...
compiling tx_byte_pool_create.c...
compiling tx_byte_pool_delete.c...
compiling tx_byte_pool_initialize.c...
compiling tx_byte_pool_prioritize.c...
compiling tx_byte_pool_search.c...
compiling tx_byte_pool_info_get.c...
compiling tx_byte_release.c...
compiling tx_event_flags_cleanup.c...
compiling tx_event_flags_create.c...
compiling tx_event_flags_delete.c...
compiling tx_event_flags_get.c...
compiling tx_event_flags_info_get.c...
compiling tx_event_flags_initialize.c...
compiling tx_event_flags_set.c...
compiling tx_mutex_cleanup.c...
compiling tx_event_flags_set_notify.c...
compiling tx_mutex_create.c...
compiling tx_mutex_delete.c...
compiling tx_mutex_initialize.c...
compiling tx_mutex_info_get.c...
compiling tx_mutex_priority_change.c...
compiling tx_mutex_get.c...
compiling tx_mutex_prioritize.c...
compiling tx_mutex_put.c...
compiling tx_queue_cleanup.c...
compiling tx_queue_create.c...
compiling tx_queue_delete.c...
compiling tx_queue_flush.c...
compiling tx_queue_front_send.c...
compiling tx_queue_info_get.c...
compiling tx_queue_initialize.c...
compiling tx_queue_prioritize.c...
compiling tx_queue_send.c...
compiling tx_queue_send_notify.c...
compiling tx_queue_receive.c...
compiling tx_semaphore_cleanup.c...
compiling tx_semaphore_ceiling_put.c...
compiling tx_semaphore_create.c...
compiling tx_semaphore_delete.c...
compiling tx_semaphore_get.c...
compiling tx_semaphore_info_get.c...
compiling tx_semaphore_initialize.c...
compiling tx_semaphore_prioritize.c...
compiling tx_semaphore_put.c...
compiling tx_semaphore_put_notify.c...
compiling tx_thread_create.c...
compiling tx_thread_delete.c...
compiling tx_thread_entry_exit_notify.c...
compiling tx_thread_identify.c...
compiling tx_thread_info_get.c...
compiling tx_thread_initialize.c...
compiling tx_thread_preemption_change.c...
compiling tx_thread_priority_change.c...
compiling tx_thread_relinquish.c...
compiling tx_thread_reset.c...
compiling tx_thread_resume.c...
compiling tx_thread_shell_entry.c...
compiling tx_thread_sleep.c...
compiling tx_thread_stack_analyze.c...
compiling tx_thread_suspend.c...
compiling tx_thread_system_preempt_check.c...
compiling tx_thread_system_suspend.c...
compiling tx_thread_terminate.c...
compiling tx_thread_time_slice.c...
compiling tx_thread_timeout.c...
compiling tx_thread_time_slice_change.c...
compiling tx_thread_wait_abort.c...
compiling tx_time_get.c...
compiling tx_time_set.c...
compiling txe_block_allocate.c...
compiling txe_block_pool_create.c...
compiling txe_block_pool_delete.c...
compiling txe_block_pool_info_get.c...
compiling txe_block_pool_prioritize.c...
compiling txe_block_release.c...
compiling txe_byte_allocate.c...
compiling txe_byte_pool_create.c...
compiling txe_byte_pool_delete.c...
compiling txe_byte_pool_info_get.c...
compiling txe_byte_pool_prioritize.c...
compiling txe_byte_release.c...
compiling txe_event_flags_create.c...
compiling txe_event_flags_delete.c...
compiling txe_event_flags_get.c...
compiling txe_event_flags_info_get.c...
compiling txe_event_flags_set.c...
compiling txe_event_flags_set_notify.c...
compiling txe_mutex_create.c...
compiling txe_mutex_delete.c...
compiling txe_mutex_get.c...
compiling txe_mutex_info_get.c...
compiling txe_mutex_prioritize.c...
compiling txe_mutex_put.c...
compiling txe_queue_create.c...
compiling txe_queue_delete.c...
compiling txe_queue_flush.c...
compiling txe_queue_info_get.c...
compiling txe_queue_front_send.c...
compiling txe_queue_prioritize.c...
compiling txe_queue_receive.c...
compiling txe_queue_send.c...
compiling txe_queue_send_notify.c...
compiling txe_semaphore_ceiling_put.c...
compiling txe_semaphore_create.c...
compiling txe_semaphore_delete.c...
compiling txe_semaphore_get.c...
compiling txe_semaphore_info_get.c...
compiling txe_semaphore_prioritize.c...
compiling txe_thread_entry_exit_notify.c...
compiling txe_semaphore_put.c...
compiling txe_thread_info_get.c...
compiling txe_thread_preemption_change.c...
compiling txe_thread_create.c...
compiling txe_semaphore_put_notify.c...
compiling txe_thread_priority_change.c...
compiling txe_thread_delete.c...
compiling txe_thread_relinquish.c...
compiling txe_thread_reset.c...
compiling txe_thread_resume.c...
compiling txe_thread_suspend.c...
compiling txe_thread_terminate.c...
compiling txe_thread_time_slice_change.c...
compiling txe_thread_wait_abort.c...
compiling tx_timer_activate.c...
compiling tx_timer_change.c...
compiling tx_timer_create.c...
compiling tx_timer_deactivate.c...
compiling tx_timer_delete.c...
compiling tx_timer_expiration_process.c...
compiling tx_timer_info_get.c...
compiling tx_timer_initialize.c...
compiling tx_timer_system_activate.c...
compiling tx_timer_system_deactivate.c...
compiling tx_timer_thread_entry.c...
compiling txe_timer_activate.c...
compiling txe_timer_change.c...
compiling txe_timer_create.c...
compiling txe_timer_deactivate.c...
compiling txe_timer_delete.c...
compiling txe_timer_info_get.c...
compiling HCBle.c...
compiling gps.c...
compiling Ultrasound.c...
compiling Buzzer.c...
compiling Shake_Motor.c...
compiling IMU.c...
linking...
Program Size: Code=65138 RO-data=726 RW-data=16 ZI-data=6200
Program Size: Code=73924 RO-data=1404 RW-data=12 ZI-data=4388
FromELF: creating hex file...
"AutoGuideStick\AutoGuideStick.axf" - 0 Error(s), 0 Warning(s).
@@ -245,7 +55,7 @@ Package Vendor: Keil
* Component: ARM::CMSIS:CORE@5.6.0
Include file: CMSIS/Core/Include/tz_context.h
Build Time Elapsed: 00:00:46
Build Time Elapsed: 00:00:03
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
Dependencies for Project 'AutoGuideStick', Target 'AutoGuideStick': (DO NOT MODIFY !)
CompilerVersion: 6210000::V6.21::ARMCLANG
F (startup_stm32h563xx.s)(0x685BB52D)(--target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -masm=auto -Wa,armasm,--diag_suppress=A1950W -c
-gdwarf-4 -I ../Core/Inc -I ../AZURE_RTOS/App -I ../Drivers/STM32H5xx_HAL_Driver/Inc -I ../Drivers/STM32H5xx_HAL_Driver/Inc/Legacy -I ../Middlewares/ST/threadx/common/inc -I ../Drivers/CMSIS/Device/ST/STM32H5xx/Include -I ../Middlewares/ST/threadx/ports/cortex_m33/ac6/inc -I ../Drivers/CMSIS/Include
-I./RTE/_AutoGuideStick
@@ -43,7 +43,7 @@ I (D:\keil5\ARM\ARMCLANG\include\stdio.h)(0x6569B012)
I (D:\keil5\ARM\ARMCLANG\include\stdint.h)(0x6569B012)
I (D:\advance_stick\AutoGuideStick\Drivers\CMSIS\Include\cmsis_version.h)(0x683FA4DE)
I (D:\advance_stick\AutoGuideStick\Drivers\CMSIS\Include\cmsis_compiler.h)(0x683FA4DE)
I (D:\advance_stick\AutoGuideStick\Drivers\CMSIS\Include\cmsis_armclang.h)(0x683FA4DE)
I (D:\advance_stick\AutoGuideStick\Drivers\CMSIS\Include\cmsis_armclang.h)(0x683FA4DE)
I (D:\advance_stick\AutoGuideStick\Drivers\CMSIS\Include\mpu_armv8.h)(0x683FA4DE)
I (..\Drivers\CMSIS\Device\ST\STM32H5xx\Include\system_stm32h5xx.h)(0x683FA4DE)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h)(0x683FA4DD)
@@ -140,8 +140,8 @@ I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim_ex.h)(0x683FA4DD)
-ID:/keil5/ARM/PACK/Keil/STM32H5xx_DFP/1.3.0/Drivers/CMSIS/Device/ST/STM32H5xx/Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32H563xx -D_RTE_ -DTX_INCLUDE_USER_DEFINE_FILE -DTX_SINGLE_MODE_NON_SECURE="1" -DUSE_HAL_DRIVER -DSTM32H563xx
-o autoguidestick/gpdma.o -MD)
-o autoguidestick/gpdma.o -MD)
I (..\Core\Inc\main.hc.\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal.h)(0x00000000)
I (..\Core\Inc\stm32h5xx_hal_conf.h)(0x684461E1)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_rcc.h)(0x683FA4DD)
@@ -182,7 +182,7 @@ I (..\Core\Inc\gpdma.ha.\Core\Inc\tim.h)(0x00000000)
-I./RTE/_AutoGuideStick
-ID:/keil5/ARM/PACK/ARM/CMSIS/5.9.0/CMSIS/Core/Include
-ID:/keil5/ARM/PACK/Keil/STM32H5xx_DFP/1.3.0/Drivers/CMSIS/Device/ST/STM32H5xx/Include
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32H563xx -D_RTE_ -DTX_INCLUDE_USER_DEFINE_FILE -DTX_SINGLE_MODE_NON_SECURE="1" -DUSE_HAL_DRIVER -DSTM32H563xx
@@ -214,7 +214,7 @@ I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim_ex.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_flash.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_flash_ex.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_pwr.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_pwr_ex.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_pwr_ex.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim_ex.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_uart.h)(0x683FA4DD)
@@ -246,7 +246,7 @@ I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim_ex.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_def.h)(0x683FA4DD)
I (..\Drivers\CMSIS\Device\ST\STM32H5xx\Include\stm32h5xx.h)(0x683FA4DE)
I (D:\keil5\ARM\ARMCLANG\include\math.h)(0x6569B012)
I (..\Drivers\CMSIS\Device\ST\STM32H5xx\Include\stm32h563xx.h)(0x683FA4DE)
I (..\Drivers\CMSIS\Device\ST\STM32H5xx\Include\stm32h563xx.h)(0x683FA4DE)
I (..\Drivers\CMSIS\Include\core_cm33.h)(0x683FA4DE)
I (D:\keil5\ARM\ARMCLANG\include\stdint.h)(0x6569B012)
I (D:\advance_stick\AutoGuideStick\Drivers\CMSIS\Include\cmsis_version.h)(0x683FA4DE)
@@ -320,7 +320,7 @@ I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim_ex.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim_ex.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_uart.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_uart_ex.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_uart_ex.h)(0x683FA4DD)
I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_exti.h)(0x683FA4DD)
F (../Core/Src/usart.c)(0x685BB8D6)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c
@@ -2070,7 +2070,7 @@ I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
-o autoguidestick/tx_event_flags_info_get.o -MD)
I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000)
I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA)
@@ -2111,9 +2111,9 @@ I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
-o autoguidestick/tx_event_flags_set.o -MD)
I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000)
I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000)
I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\common\inc\tx_event_flags.h)(0x683FA4DA)
@@ -2154,8 +2154,8 @@ I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
-o autoguidestick/tx_mutex_cleanup.o -MD)
I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000)
I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\common\inc\tx_mutex.h)(0x683FA4DA)
@@ -2197,8 +2197,8 @@ I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
-o autoguidestick/tx_mutex_delete.o -MD)
I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000)
I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA)
@@ -2240,8 +2240,8 @@ I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
-D__UVISION_VERSION="539" -D_RTE_ -DSTM32H563xx -D_RTE_ -DTX_INCLUDE_USER_DEFINE_FILE -DTX_SINGLE_MODE_NON_SECURE="1" -DUSE_HAL_DRIVER -DSTM32H563xx
-o autoguidestick/tx_mutex_info_get.o -MD)
I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000)
I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA)
@@ -2283,8 +2283,8 @@ I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
-o autoguidestick/tx_mutex_prioritize.o -MD)
I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000)
I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000)
I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\common\inc\tx_mutex.h)(0x683FA4DA)
@@ -2325,4 +2325,4 @@ I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012)
-o autoguidestick/tx_mutex_put.o -MD)
I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)
I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9)

View File

@@ -0,0 +1,2 @@
[EXTDLL]
Count=0

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component_viewer schemaVersion="0.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="Component_Viewer.xsd">
<component name="EventRecorderStub" version="1.0.0"/> <!--name and version of the component-->
<events>
</events>
</component_viewer>

View File

@@ -5,9 +5,15 @@
BLE --- DMA + IDLE <20>ж<EFBFBD> ѭ<><D1AD> DMA + <20><><EFBFBD><EFBFBD><EFBFBD>жϴ<D0B6><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UART IDLE
GPS --- DMA +<2B>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD> + TC<54>ж<EFBFBD> <20><><EFBFBD>ù̶<C3B9><CCB6><EFBFBD><EFBFBD><EFBFBD> DMA DMA<4D><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
#{
"lat": 23.123456,
"lon": 113.654321,
"angle": 95.0
}\n
**/
// <20>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern UART_HandleTypeDef huart4;
extern DMA_HandleTypeDef handle_GPDMA1_Channel5;
extern DMA_HandleTypeDef handle_GPDMA1_Channel4;
@@ -49,7 +55,7 @@ void HCBle_SendData(char *p,...)
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#ifdef DEBUG_EN
// <20><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>
HAL_UART_Transmit(&huart1,(uint8_t *)HC_Send_Data,strlen(HC_Send_Data),100);
HAL_UART_Transmit(&huart4,(uint8_t *)HC_Send_Data,strlen(HC_Send_Data),100);
// HAL_UART_Transmi(&huart1,(uint8_t *)formatBuf,strlen(formatBuf),1);
// <20><><EFBFBD><EFBFBD>û<EFBFBD><C3BB>ʹ<EFBFBD><CAB9><EFBFBD>жϵĴ<CFB5><C4B4>ڷ<EFBFBD><DAB7>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#else
@@ -62,36 +68,36 @@ void HCBle_SendData(char *p,...)
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><DDBD><EFBFBD>
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
if(huart->Instance == UART4)
{
if(rx_data == '\n')
{
if(rx_index > 0)
{
HC_Recevie[rx_index] = '\0';
data_received = 1;
rx_index = 0; //<2F><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD> <20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD> memset
}else if(rx_index < RX_DataSize - 1)
{
}else
{
rx_index = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
memset(HC_Recevie,'\0',RX_DataSize);
}
}
HAL_UART_Receive_IT(huart,&rx_data,1);
}
}
//// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><DDBD><EFBFBD>
//void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
//{
// if(huart->Instance == UART4)
// {
// if(rx_data == '\n')
// {
// if(rx_index > 0)
// {
// HC_Recevie[rx_index] = '\0';
// data_received = 1;
// rx_index = 0; //<2F><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD> <20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD> memset
// }else if(rx_index < RX_DataSize - 1)
// {
//
// }else
// {
// rx_index = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// memset(HC_Recevie,'\0',RX_DataSize);
// }
// }
//
// HAL_UART_Receive_IT(huart,&rx_data,1);
// }
//}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƕ<EFBFBD><C7B6><EFBFBD> Json<6F><6E><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD> <20>Լ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݸ<EFBFBD><DDB8>ֻ<EFBFBD>App
uint8_t flag;
// Json<6F><6E><EFBFBD>ݽ<EFBFBD><DDBD><EFBFBD> <20><><EFBFBD><EFBFBD>ʹ<EFBFBD>õ<EFBFBD>Thread x <20><><EFBFBD>н<EFBFBD><D0BD><EFBFBD>
void HCBle_ExtractAndParseFrame(void)
@@ -124,6 +130,7 @@ void HCBle_ExtractAndParseFrame(void)
sscanf(json_buf, "#{\"leftSpeed\":%d,\"rightSpeed\":%d}", &cmd.LeftSpeed, &cmd.RightSpeed);
tx_event_flags_set(&system_events,EVENT_BLE_COMMAND_RECEIVED,TX_OR);
//SetMotorSpeed(cmd.LeftSpeed, cmd.RightSpeed); <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
HCBle_SendData("<EFBFBD><EFBFBD>=%d, <20><>=%d\r\n", cmd.LeftSpeed, cmd.RightSpeed);
}
in_frame = 0;
@@ -143,7 +150,7 @@ void HCBle_ExtractAndParseFrame(void)
void ble_rx_task_entry(ULONG thread_input)
{
HCBle_InitDMAReception();
HCBle_SendData("BLE RX <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\r\n");
while(1)
{
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -154,9 +161,12 @@ void ble_rx_task_entry(ULONG thread_input)
void ble_tx_task_entry(ULONG thread_input) {
BLE_Message msg;
HCBle_SendData("BLE TX <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\r\n");
while(1) {
if (tx_queue_receive(&ble_tx_queue, &msg, TX_WAIT_FOREVER) == TX_SUCCESS) {
HCBle_SendData("%s", msg.data);
// HCBle_SendData("%s", msg.data);
HCBle_SendData("#{\"lat\":%.6f,\"lon\":%.6f,\"angle\":%.2f}\n",
23.123456, 113.654321, 95.0);
}
}
}

View File

@@ -37,8 +37,12 @@ extern RingBuffer ble_rx_ring; //
extern uint8_t uart_dma_rx_buf[UART_DMA_RX_BUF_SIZE];
extern LocationData current_location;
extern uint8_t flag;
void HCBle_SendData(char *p,...);
void HCBle_InitDMAReception(void);
void HCBle_ExtractAndParseFrame(void);
void ble_rx_task_entry(ULONG thread_input);
void ble_tx_task_entry(ULONG thread_input);
#endif