测试阶段:可以跟多个UWB基站测距,以及蓝牙协议转发,现在上传协议是强制写进去的,然后还有那个基站,标签时间同步没有调试正常,
已修改14个文件
23156 ■■■■ 文件已修改
keil/JLinkLog.txt 补丁 | 查看 | 原始文档 | blame | 历史
keil/Listings/uwb_simple_example.map 6877 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.build_log.htm 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.hex 10663 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.htm 4898 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example_MK8000 Release.dep 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/drivers/Usart.c 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/drivers/Usart.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/drivers/serial_at_cmd_app.c 301 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/main/main.c 182 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/lora_3029.c 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/lora_3029.h 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_app.c 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_simple_example.uvoptx 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/JLinkLog.txt
Binary files differ
keil/Listings/uwb_simple_example.map
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.build_log.htm
@@ -21,14 +21,20 @@
Dialog DLL:      TARMCM1.DLL V1.14.2.0
 
<h2>Project:</h2>
D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX - BT\keil\uwb_simple_example.uvprojx
D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX - BT-zuixinceshi\keil\uwb_simple_example.uvprojx
Project File Date:  12/23/2024
<h2>Output:</h2>
*** Using Compiler 'V6.14', folder: 'D:\keil\ARM\ARMCLANG\Bin'
Build Project 'uwb_simple_example' - Target 'MK8000 Release'
After Build - User command #1: fromelf.exe --bincombined -o "Output\uwb_simple_example.bin" "D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX - BT\keil\Objects\uwb_simple_example.axf"
".\Objects\uwb_simple_example.axf" - 0 Error(s), 0 Warning(s).
compiling lora_3029.c...
linking...
D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX - BT-zuixinceshi\keil\include\devices\MK800X\Source\ARM\MK800X_ac6_copy.sct(25): warning: L6314W: No section matches pattern *(.XIP_SECTION).
Program Size: Code=74028 RO-data=9452 RW-data=1628 ZI-data=28056
Finished: 0 information, 1 warning and 0 error messages.
FromELF: creating hex file...
After Build - User command #1: fromelf.exe --bincombined -o "Output\uwb_simple_example.bin" "D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-biaoqian-RX - BT-zuixinceshi\keil\Objects\uwb_simple_example.axf"
".\Objects\uwb_simple_example.axf" - 0 Error(s), 1 Warning(s).
<h2>Software Packages used:</h2>
@@ -42,7 +48,7 @@
  D:\keil\pack\MKSEMI\MK800X_DFP\1.0.3\Device\Include
<h2>Collection of Component Files used:</h2>
Build Time Elapsed:  00:00:00
Build Time Elapsed:  00:00:03
</pre>
</body>
</html>
keil/Objects/uwb_simple_example.hex
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.htm
ÎļþÌ«´ó
keil/Objects/uwb_simple_example_MK8000 Release.dep
@@ -553,10 +553,10 @@
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\mk_io.h)(0x67206CDC)
I (include\drivers\mk_power.h)(0x67206CDC)
I (..\keil\lora_3029.h)(0x67A9CCFF)
I (..\keil\lora_3029.h)(0x67BBDB00)
F (.\include\drivers\PCA9555.h)(0x67909B96)()
F (.\include\drivers\Usart1.c)(0x672050F0)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/usart1.o -MD)
I (include\drivers\Usart.h)(0x67AC72E5)
I (include\drivers\Usart.h)(0x67B4382E)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
I (include\drivers\Usart1.h)(0x672050F0)
I (include\drivers\mk_dma.h)(0x672473BD)
@@ -575,8 +575,8 @@
I (..\user_config.h)(0x67AC72E5)
I (include\drivers\mk_uart.h)(0x672473BD)
I (D:\keil\ARM\ARMCLANG\include\stdio.h)(0x5DDFFD72)
F (.\include\drivers\Usart.c)(0x672050F0)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/usart.o -MD)
I (include\drivers\Usart.h)(0x67AC72E5)
F (.\include\drivers\Usart.c)(0x67B437EF)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/usart.o -MD)
I (include\drivers\Usart.h)(0x67B4382E)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
I (D:\keil\ARM\ARMCLANG\include\string.h)(0x5DDFFD6C)
I (D:\keil\ARM\ARMCLANG\include\stdio.h)(0x5DDFFD72)
@@ -664,13 +664,13 @@
I (include\drivers\mk_dma.h)(0x672473BD)
I (include\drivers\mk_misc.h)(0x67206CDC)
I (include\drivers\mk_clock.h)(0x67206CDC)
F (.\include\drivers\serial_at_cmd_app.c)(0x672050F0)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/drivers -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/serial_at_cmd_app.o -MD)
F (.\include\drivers\serial_at_cmd_app.c)(0x67B59A1C)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/drivers -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/serial_at_cmd_app.o -MD)
I (include\drivers\serial_at_cmd_app.h)(0x672050F0)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
I (include\drivers\global_param.h)(0x672B0902)
I (D:\keil\ARM\ARMCLANG\include\string.h)(0x5DDFFD6C)
I (D:\keil\ARM\ARMCLANG\include\stdio.h)(0x5DDFFD72)
I (include\drivers\Usart.h)(0x67AC72E5)
I (include\drivers\Usart.h)(0x67B4382E)
I (include\drivers\mk_flash.h)(0x67206CDC)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -746,9 +746,9 @@
I (include\drivers\mk_dma.h)(0x672473BD)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\Usart.h)(0x67AC72E5)
I (..\keil\lora_3029.h)(0x67A9CCFF)
F (.\include\main\main.c)(0x67B2A1AB)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/main.o -MD)
I (include\drivers\Usart.h)(0x67B4382E)
I (..\keil\lora_3029.h)(0x67BBDB00)
F (.\include\main\main.c)(0x67B59611)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/main.o -MD)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -784,7 +784,7 @@
I (include\components\wsf\include\wsf_nvm.h)(0x67206CDE)
I (include\components\wsf\include\wsf_types.h)(0x67206CDE)
I (include\drivers\mk_power.h)(0x67206CDC)
I (include\drivers\Usart.h)(0x67AC72E5)
I (include\drivers\Usart.h)(0x67B4382E)
I (include\drivers\mk_adc.h)(0x67206CDC)
I (include\drivers\mk_sleep_timer.h)(0x67206CDC)
I (include\drivers\lis3dh_driver.h)(0x672050F0)
@@ -807,7 +807,7 @@
I (include\components\hal\pan_rf.h)(0x676E1685)
I (include\drivers\PCA9555.h)(0x67909B96)
I (include\drivers\mk_timer.h)(0x67206CDD)
I (..\keil\lora_3029.h)(0x67A9CCFF)
I (..\keil\lora_3029.h)(0x67BBDB00)
I (include\drivers\mk_phy.h)(0x67206CDD)
F (.\include\src\TCPClient.c)(0x672050F0)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/tcpclient.o -MD)
I (include\src\TCPClient.h)(0x672050F0)
@@ -867,7 +867,7 @@
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\mk_io.h)(0x67206CDC)
F (.\uwb_app.c)(0x67B29747)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/uwb_app.o -MD)
F (.\uwb_app.c)(0x67B425C5)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/uwb_app.o -MD)
I (include\drivers\mk_trace.h)(0x67206CDC)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -899,9 +899,9 @@
I (include\board\board.h)(0x67AC74B2)
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\mk_io.h)(0x67206CDC)
I (..\keil\lora_3029.h)(0x67A9CCFF)
F (.\lora_3029.c)(0x67B2DCA2)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/lora_3029.o -MD)
I (..\keil\lora_3029.h)(0x67A9CCFF)
I (..\keil\lora_3029.h)(0x67BBDB00)
F (.\lora_3029.c)(0x67BC2CC3)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I ./include/board -I ../keil -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/lora_3029.o -MD)
I (..\keil\lora_3029.h)(0x67BBDB00)
I (include\drivers\mk_io.h)(0x67206CDC)
I (include\drivers\mk_common.h)(0x67206CDC)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -1491,7 +1491,7 @@
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\mk_io.h)(0x67206CDC)
I (include\drivers\mk_spi.h)(0x67206CDD)
I (..\keil\lora_3029.h)(0x67A9CCFF)
I (..\keil\lora_3029.h)(0x67BBDB00)
F (.\include\components\hal\pan_rf.c)(0x6780BCB9)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -w -I .. -I ./include/board -I ./include/CMSIS/Include -I ./include/components/algo/inc -I ./include/components/crc -I ./include/components/libc -I ./include/components/wsf/include -I ./include/components/wsf/include/platform -I ./include/devices/MK800X/Include -I ./include/drivers -I ./include/components/hido/Include -I ./include/components/internet/inc -I ./include/components/hal -I ../keil -I ./include/src -I ./include -Wno-declaration-after-statement -Wno-double-promotion -Wno-extra-semi-stmt -Wno-gnu-zero-variadic-macro-arguments -Wno-padded -Wno-unused-parameter -I./RTE/_MK8000_Release -ID:/keil/pack/MKSEMI/MK800X_DFP/1.0.3/Device/Include -ID:/keil/ARM/CMSIS/Include -D__UVISION_VERSION="530" -D_RTE_ -DUWB_EN -DSTD_LIBC -o ./objects/pan_rf.o -MD)
I (include\components\hal\pan_port.h)(0x672050F0)
I (D:\keil\ARM\ARMCLANG\include\stdio.h)(0x5DDFFD72)
@@ -1521,4 +1521,4 @@
I (include\drivers\mk_gpio.h)(0x67206CDC)
I (include\drivers\mk_io.h)(0x67206CDC)
I (include\components\hal\pan_param.h)(0x672050F0)
I (..\keil\lora_3029.h)(0x67A9CCFF)
I (..\keil\lora_3029.h)(0x67BBDB00)
keil/include/drivers/Usart.c
@@ -71,7 +71,40 @@
}
void UART0_CheckReceive(void)
{
                int32_t DMACnt = 0;
                int32_t MaxDataLen = EUART_RX_BUF_SIZE;
                cndtr=get_uart0_dma_cndtr();
                //缺少check保护
        //如果正在往发送队列中添加数据,退出
        if(m_bEUARTPushingFrms)
                return;
        //判断是否正在Check
        if(m_bEUARTCheckingRec)
                return;
        m_bEUARTCheckingRec = 1;
        if(cndtr== 0)
        {
                m_bEUARTCheckingRec = 0;
                return;
        }
        DMACnt = EUART_RX_BUF_SIZE - cndtr;
        while( m_EUART_DMA_RXPtr != DMACnt && MaxDataLen > 0)
        {
                Usart1ParseDataCallback(m_EUART_DMA_RXBuf[m_EUART_DMA_RXPtr]);
                //waitusart_timer = tag_frequency*USART_KEEPWAKE_TIME;
                m_EUART_DMA_RXPtr++;
                if( m_EUART_DMA_RXPtr >= EUART_RX_BUF_SIZE )
                {
                        m_EUART_DMA_RXPtr = 0;
                }
                DMACnt = EUART_RX_BUF_SIZE - cndtr;
                MaxDataLen--;
        }
        m_bEUARTCheckingRec = 0;
}
#ifndef EXUART_USE_TXDMA
//查询方式发送数据
keil/include/drivers/Usart.h
@@ -51,6 +51,7 @@
void Uart1_Init(void);
void UART_CheckReceive(void);
void UART0_CheckReceive(void);
void UART_CheckSend(void);
void UART_PushFrame(uint8_t* pdata, int32_t data_len);
void UART_PopFrame(void);
keil/include/drivers/serial_at_cmd_app.c
@@ -136,145 +136,180 @@
}
double d_value;
#define buff_lenth 1024
#define MAX_BASE_STATIONS 10
uint8_t DMA_RXBuf_BT[200]={0};
uint8_t Forward_BT_buff[buff_lenth]={0};
uint8_t report_ancnum_bt=0;
void UsartParseDataHandler(uint8_t data)
{
    if(state5V_prase_flag&&!g_com_map[MODBUS_MODE])
    {   //升级程序
        static UsartRecvPackState usart_receive_state = UsartReceiveWaitHead0;
        uint16_t checksum = 0;
        static uint8_t pack_datalen = 0,pack_length = 0,pack_index = 0,pack_msgtype = 0,pack_cmd = CMD_READ;
        static uint8_t index = 0;
        if(usart_receive_state == UsartReceiveWaitChecksum)
        {   //若收到校验和包
            checksum = 0;
            for(int i = 0; i<pack_length-5; i++) {
                checksum += mUsartReceivePack[i];
            }
            checksum += pack_cmd;
            checksum += pack_length;
            checksum += pack_index;
            checksum += pack_datalen;
            checksum += pack_msgtype;
            if(((data + checksum)&0xff) == 0xFF)                //校验通过
            {
                switch(pack_cmd)
                {
                case CMD_WRITE:
                  if(pack_index==MODBUS_MODE*2)
                  {
                      Uart1GpsRecDebugSend();
                      g_com_map[MODBUS_MODE] = 1;
                      return;
                  }
                    //从mUsartReceivePack中读取pack_length长度的字节,放到全局变量中,赋值保存的参数并且存入flash
                    memcpy((uint8_t*)&g_com_map + pack_index, mUsartReceivePack, pack_datalen);
                    if(mUsartReceivePack[0]==1)
                        UpdateProcess(pack_index);
                    //返回一个error状态
                    //SendComMap(pack_datalen,pack_index);
                    save_com_map_to_flash();
                    //delay_ms(100);
                    NVIC_SystemReset();
                    break;
                case CMD_READ:
                    //read包中data字节,即mUsartReceivePack[0]表示数据长度;
                    //从g_com_data结构体中的第index位置读取长度为mUsartReceivePack[0]的字节,发送出来
                    SendComMap(pack_datalen,pack_index>>1);
                    break;
                default:
                    break;
                }
            }
            usart_receive_state = UsartReceiveWaitHead0;
            pack_index = 0;
            pack_length = 0;
            index=0;
        } else if((usart_receive_state == UsartReceiveWaitData) ) {    //若果收到的是正常通讯包
            mUsartReceivePack[index] = data;
            index++;
            if(index == pack_length-5) {        //如果收到的index与长度相等
                usart_receive_state = UsartReceiveWaitChecksum;
            }
        } else if(usart_receive_state == UsartReceiveWaitDataLen) {                        //收到指令类型字节
            pack_datalen = data;
            usart_receive_state = UsartReceiveWaitData;
        } else if(usart_receive_state == UsartReceiveWaitIndex) {                        //收到指令类型字节
            pack_index = data;
            usart_receive_state = UsartReceiveWaitDataLen;
        } else if(usart_receive_state == UsartReceiveWaitCMD) {                            //收到指令类型字节
            pack_cmd = data;
            usart_receive_state = UsartReceiveWaitIndex;
        } else if(usart_receive_state == UsartReceiveWaitLength) {                        //收到长度字节
            pack_length = data;
            pack_index = 0;
            usart_receive_state = UsartReceiveWaitCMD;
        } else if((usart_receive_state == UsartReceiveWaitHead0) && (data == 0x55)) {    //收到第一个包头
            usart_receive_state = UsartReceiveWaitHead1;
        } else if((usart_receive_state == UsartReceiveWaitHead1) && (data == 0xAA)) {    //收到第二个包头
            usart_receive_state = UsartReceiveWaitMsgType;
        } else if ((usart_receive_state == UsartReceiveWaitMsgType) && (data == 0x3)) {
            usart_receive_state = UsartReceiveWaitLength;
            pack_msgtype = data;
        }
        else {
            usart_receive_state = UsartReceiveWaitHead0;
            pack_index = 0;
            pack_length = 0;
        }
    } else if(gps_prase_flag)
      uint8_t buff[buff_lenth] = {0};
    uint8_t length = 0;
    uint8_t base_station_count = 0;
        memcpy(buff, m_EUART_DMA_RXBuf, 1024);
    //memcpy(buff, Forward_BT_buff, 1024);
    // éåކ
    for (int n = 0; n < 1024 - 6; n++)
    {
        static uint8_t index = 0;
//GPS解析数据
//    static ST_BLERecv BLE_recvive;
        GGA_DataStruct jdrecv,wdrecv,Posstate;
        //接收数据开始分析
        mUsart2ReceivePack[index]  =  data; //char数组传进来参数data
        mUsart2ReceivePack_before  =  mUsart2ReceivePack_now;
        mUsart2ReceivePack_now=data;
        index++;
        if( mUsart2ReceivePack_before == 0x0D && mUsart2ReceivePack_now==0x0A )//接收数据到“0x0D 0x0A”结束
        // åŒ…头 0x55 0xAA 0x41
        if (buff[n] == 0x55 && buff[n+1] == 0xAA && buff[n+2] == 0x41)
        {
            //解析该条GPS报文
            analysis_num=sscanf((char*)mUsart2ReceivePack,"$%[^,],%*[^,],%[^,],%*[^,],%[^,],%*[^,],%[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*s",gps_header,wdrecv.m_pData,jdrecv.m_pData,Posstate.m_pData);
            if(!memcmp(gps_header,"GNGGA",5))
            {
                if(g_com_map[MODBUS_MODE])
                    LOG_INFO(TRACE_MODULE_APP,"%s", mUsart2ReceivePack);
                    d_value = strtod(wdrecv.m_pData,NULL);
                if(d_value>1)
                {
                     blink_led(&gps_success_state);
                    wd=strtod(wdrecv.m_pData,NULL);
                    jd=strtod(jdrecv.m_pData,NULL);
                    pos_state=atoi(Posstate.m_pData);
                }
            }
            index = 0;
            if(pos_state!=0)
            {
                //4g.jd=jd;
                //4g.wd=wd;
                gps_timeout_flag=1;//不超时接收状态
                gps_need_data_flag=0;//接收数据完成
                gps_wait_count=0;//清0接收状态
//        gps_enable_flag=0;//收到有效数据关闭GPS
                        report_ancnum_bt=buff[n+4];
            length = buff[n+3];
            if (n + 6 + report_ancnum_bt * 6 + length > 1024) {
                continue; // å¦‚果数据越界,跳过该包
            }
            memset(mUsart2ReceivePack,0,sizeof(mUsart2ReceivePack));
            memset(wdrecv.m_pData,0,sizeof(wdrecv.m_pData));
            memset(jdrecv.m_pData,0,sizeof(jdrecv.m_pData));
            memset(Posstate.m_pData,0,sizeof(Posstate.m_pData));
            index=0;
            mUsart2ReceivePack_before=0;
            mUsart2ReceivePack_now=0;
            // å°†æ•°æ®å¤åˆ¶åˆ° DMA ç¼“冲区
            memcpy(DMA_RXBuf_BT, &buff[n+4], length);
            // ä¸ºäº†é¿å…å¤šæ¬¡é‡å¤è§£æžåŒä¸€ä¸ªæ•°æ®åŒ…,可以在这里添加跳跃
            n += 6 + report_ancnum_bt * 6 + length - 1; // è·³è¿‡å½“前数据包
        }
    }
    // æ¸…除临时缓冲区
    memset(buff, 0, buff_lenth);
//    if(state5V_prase_flag&&!g_com_map[MODBUS_MODE])
//    {   //升级程序
//        static UsartRecvPackState usart_receive_state = UsartReceiveWaitHead0;
//        uint16_t checksum = 0;
//        static uint8_t pack_datalen = 0,pack_length = 0,pack_index = 0,pack_msgtype = 0,pack_cmd = CMD_READ;
//        static uint8_t index = 0;
//        if(usart_receive_state == UsartReceiveWaitChecksum)
//        {   //若收到校验和包
//            checksum = 0;
//            for(int i = 0; i<pack_length-5; i++) {
//                checksum += mUsartReceivePack[i];
//            }
//            checksum += pack_cmd;
//            checksum += pack_length;
//            checksum += pack_index;
//            checksum += pack_datalen;
//            checksum += pack_msgtype;
//            if(((data + checksum)&0xff) == 0xFF)                //校验通过
//            {
//                switch(pack_cmd)
//                {
//                case CMD_WRITE:
//                  if(pack_index==MODBUS_MODE*2)
//                  {
//                      Uart1GpsRecDebugSend();
//                      g_com_map[MODBUS_MODE] = 1;
//                      return;
//                  }
//                    //从mUsartReceivePack中读取pack_length长度的字节,放到全局变量中,赋值保存的参数并且存入flash
//                    memcpy((uint8_t*)&g_com_map + pack_index, mUsartReceivePack, pack_datalen);
//                    if(mUsartReceivePack[0]==1)
//                        UpdateProcess(pack_index);
//                    //返回一个error状态
//                    //SendComMap(pack_datalen,pack_index);
//                    save_com_map_to_flash();
//                    //delay_ms(100);
//                    NVIC_SystemReset();
//                    break;
//                case CMD_READ:
//                    //read包中data字节,即mUsartReceivePack[0]表示数据长度;
//                    //从g_com_data结构体中的第index位置读取长度为mUsartReceivePack[0]的字节,发送出来
//                    SendComMap(pack_datalen,pack_index>>1);
//                    break;
//                default:
//                    break;
//                }
//            }
//            usart_receive_state = UsartReceiveWaitHead0;
//            pack_index = 0;
//            pack_length = 0;
//            index=0;
//        } else if((usart_receive_state == UsartReceiveWaitData) ) {    //若果收到的是正常通讯包
//            mUsartReceivePack[index] = data;
//            index++;
//            if(index == pack_length-5) {        //如果收到的index与长度相等
//                usart_receive_state = UsartReceiveWaitChecksum;
//            }
//        } else if(usart_receive_state == UsartReceiveWaitDataLen) {                        //收到指令类型字节
//            pack_datalen = data;
//            usart_receive_state = UsartReceiveWaitData;
//        } else if(usart_receive_state == UsartReceiveWaitIndex) {                        //收到指令类型字节
//            pack_index = data;
//            usart_receive_state = UsartReceiveWaitDataLen;
//        } else if(usart_receive_state == UsartReceiveWaitCMD) {                            //收到指令类型字节
//            pack_cmd = data;
//            usart_receive_state = UsartReceiveWaitIndex;
//        } else if(usart_receive_state == UsartReceiveWaitLength) {                        //收到长度字节
//            pack_length = data;
//            pack_index = 0;
//            usart_receive_state = UsartReceiveWaitCMD;
//        } else if((usart_receive_state == UsartReceiveWaitHead0) && (data == 0x55)) {    //收到第一个包头
//            usart_receive_state = UsartReceiveWaitHead1;
//        } else if((usart_receive_state == UsartReceiveWaitHead1) && (data == 0xAA)) {    //收到第二个包头
//            usart_receive_state = UsartReceiveWaitMsgType;
//        } else if ((usart_receive_state == UsartReceiveWaitMsgType) && (data == 0x3)) {
//            usart_receive_state = UsartReceiveWaitLength;
//            pack_msgtype = data;
//        }
//        else {
//            usart_receive_state = UsartReceiveWaitHead0;
//            pack_index = 0;
//            pack_length = 0;
//        }
//    } else if(gps_prase_flag)
//    {
//        static uint8_t index = 0;
////GPS解析数据
////    static ST_BLERecv BLE_recvive;
//        GGA_DataStruct jdrecv,wdrecv,Posstate;
//
//        //接收数据开始分析
//        mUsart2ReceivePack[index]  =  data; //char数组传进来参数data
//        mUsart2ReceivePack_before  =  mUsart2ReceivePack_now;
//        mUsart2ReceivePack_now=data;
//        index++;
//        if( mUsart2ReceivePack_before == 0x0D && mUsart2ReceivePack_now==0x0A )//接收数据到“0x0D 0x0A”结束
//        {
//            //解析该条GPS报文
//
//            analysis_num=sscanf((char*)mUsart2ReceivePack,"$%[^,],%*[^,],%[^,],%*[^,],%[^,],%*[^,],%[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*[^,],%*s",gps_header,wdrecv.m_pData,jdrecv.m_pData,Posstate.m_pData);
//            if(!memcmp(gps_header,"GNGGA",5))
//            {
//                if(g_com_map[MODBUS_MODE])
//                    LOG_INFO(TRACE_MODULE_APP,"%s", mUsart2ReceivePack);
//                    d_value = strtod(wdrecv.m_pData,NULL);
//                if(d_value>1)
//                {
//                     blink_led(&gps_success_state);
//                    wd=strtod(wdrecv.m_pData,NULL);
//                    jd=strtod(jdrecv.m_pData,NULL);
//                    pos_state=atoi(Posstate.m_pData);
//                }
//            }
//            index = 0;
//            if(pos_state!=0)
//            {
//                //4g.jd=jd;
//                //4g.wd=wd;
//                gps_timeout_flag=1;//不超时接收状态
//                gps_need_data_flag=0;//接收数据完成
//                gps_wait_count=0;//清0接收状态
////        gps_enable_flag=0;//收到有效数据关闭GPS
//            }
//            memset(mUsart2ReceivePack,0,sizeof(mUsart2ReceivePack));
//            memset(wdrecv.m_pData,0,sizeof(wdrecv.m_pData));
//            memset(jdrecv.m_pData,0,sizeof(jdrecv.m_pData));
//            memset(Posstate.m_pData,0,sizeof(Posstate.m_pData));
//            index=0;
//            mUsart2ReceivePack_before=0;
//            mUsart2ReceivePack_now=0;
//        }
//    }
}
keil/include/main/main.c
@@ -353,18 +353,48 @@
{
 lora_tx_flag++;
}
uint8_t DMA_RXBuf_BT[200]={0};
//void uart0_receive_callback()
//{
//  uint8_t buff[buff_lenth]={0};
//    uint8_t lenth=0;
//
//    uart_receive(UART_ID0,Forward_BT_buff,buff_lenth,uart0_receive_callback);
//    memcpy(buff,Forward_BT_buff,1024);
//    for(int n=0;n<1024;n++)
//    {
//        if(buff[n]==0x55)
//        {
//            if(buff[n+1]==0xAA)
//            {
//                if(buff[n+2]==0x41)
//                {
//                    lenth=buff[n+4];
//                    memcpy(DMA_RXBuf_BT,&buff[n+4],lenth);
//                }
//            }
//
//        }
//    }
//    memset(buff, 0, buff_lenth);
//    memset(DMA_RXBuf_BT, 0, buff_lenth);
//    if(buff[0]==0x55||buff[1]==0xAA||buff[2]==0x41)
//    {
//      uint8_t lenth=0;
//        lenth=((buff[4]*2)+(buff[4]*2)+1);
//        memcpy(DMA_RXBuf_BT,&buff[4],lenth);
//    }
//}
//uint8_t base_station_count = 0;
//uint8_t last_ids[MAX_BASE_STATIONS] = {0};
void uart0_receive_callback()
{
    uint8_t buff[200]={0};
    memcpy(buff,m_EUART_DMA_RXBuf,100);
    if(buff[0]==0x55||buff[1]==0xAA||buff[2]==0x41)
    {
      uint8_t lenth=0;
        lenth=((buff[4]*2)+(buff[4]*2)+1);
        memcpy(DMA_RXBuf_BT,&buff[4],lenth);
    }
        uart_receive(UART_ID0,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart0_receive_callback);
}
static void voltage_input_handler(enum IO_PIN_T pin)
{
@@ -421,34 +451,8 @@
void IdleTask(void)
{
    if(gpio_pin_get_val(INPUT_5V_Pin))
    {
        if(state5v==0)
        {
            state5v=1;
            state5V_prase_flag=state5v;
            gps_prase_flag=0;//解除gps解析
            uart1_change_from_gps_to_debug();//测试
         //   uart_receive(UART_ID1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback);//开启dma
            //UartInit();
        }
        //UART_CheckSend();
    } else {
        if(state5v==1)
        {
            g_com_map[MODBUS_MODE] = 0;
            state5v=0;
            state5V_prase_flag=state5v;
            gps_prase_flag=1;//恢复gps解析
            uart1_change_from_debug_to_gps();//测试
          //  uart_receive(UART_ID1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback);//开启dma
            //UartDeinit();
        }
    }
        UART_CheckReceive();
{
 UART0_CheckReceive();
}
int bind_check(void)
{
@@ -516,27 +520,23 @@
    io_pin_mux_set(LORA_CLK, IO_FUNC2);
      io_pin_mux_set(LORA_DIO, IO_FUNC0);
    
//    io_pin_mux_set(LORA_DIO, IO_FUNC0);
//    gpio_pin_set_dir(LORA_DIO , GPIO_DIR_OUT, 0);
//    io_pull_set(LORA_DIO, IO_HIGH_Z, IO_PULL_UP_NONE);
//    io_pin_mux_set(LORA_CS2, IO_FUNC0);
//    gpio_pin_set_dir(LORA_CS2 , GPIO_DIR_OUT, 0);
//    io_pull_set(LORA_CS2, IO_HIGH_Z, IO_PULL_UP_NONE);
    
//      //ADC
//      io_pin_mux_set(ADC_PIN, IO_FUNC1);
//       io_pull_set(ADC_PIN, IO_HIGH_Z, IO_PULL_UP_NONE);
//    //串口0
//        io_pin_mux_set(UART0_RX, IO_FUNC4);
//    io_pin_mux_set(UART0_TX, IO_FUNC4);
//      board_debug_console_open(TRACE_PORT_UART0);
//      uart_receive(UART_ID0,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart0_receive_callback);//开启dma
//
//      //串口1
//        io_pin_mux_set(UART1_RX, IO_FUNC4);
//    io_pin_mux_set(UART1_TX, IO_FUNC4);
    //串口0
        io_pin_mux_set(UART0_RX, IO_FUNC4);
    io_pin_mux_set(UART0_TX, IO_FUNC4);
      board_debug_console_open(TRACE_PORT_UART0);
//    uart_receive(UART_ID0,Forward_BT_buff,buff_lenth,uart0_receive_callback);
      uart_receive(UART_ID0,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart0_receive_callback);//开启dma
//      uart_receive(UART_ID0,&uart0_buffer,1024,uart0_receive_callback);
//      uart_receive(UART_ID0,DMA_RXBuf_BT,buff_lenth,uart0_receive_callback);
      //串口1
        io_pin_mux_set(UART1_RX, IO_FUNC4);
    io_pin_mux_set(UART1_TX, IO_FUNC4);
}
void spi_init()
{
@@ -642,9 +642,8 @@
           if(RX_Buffer[MSG_TYPE_IDX]==LORA_MSGTYPE_RANGEPOLL)
    {
                    
//                            time_flag_lorarx=phy_timer_count_get();
                      uwb_open();
                      //gpio_pin_clr(IO_PIN_5);//测试
                            UwbRange();
                      
                      uwb_ceju_count++;
@@ -682,31 +681,26 @@
                                        switch(RX_Buffer[PWTAG_RW_FLAG_IDX])
                                        {
                                                case WGRSP_RWTAG_NONE:
//                        current_count = HAL_LPTIM_ReadCounter(&hlptim1);
                                                 // sleep_time_count=xtal_38m4_off_time();
                        wg_report_freq = RX_Buffer[POLL_FREQ_IDX]+400;
                        memcpy(&rec_delaytime,&RX_Buffer[NEXTPOLL_TIME_IDX],2);
                        if(report_ancnum<2)
                        {
                            datalen_offset = report_ancnum*85;
                        }else{
                            datalen_offset = (report_ancnum-1)*46+85;
                        }
                        rec_secdelay = RX_Buffer[PWTAG_SECDELAY_IDX];
                        if(BufferSize!=13||rec_secdelay>20)
                        {
                            rec_secdelay = 0;
                        }
                        sleep_time_count = rec_delaytime*3.2768 - delaytime-datalen_offset;
                        while(sleep_time_count>=32768)
                            sleep_time_count-=32768;
                                                sleep_timer_start(sleep_time_count);
                                            //sleep_timer_start(sleep_time_count);sleep_timer_start(__MS_TO_32K_CNT(1000));//测试
//                                                #define __MS_TO_32K_CNT(ms) ((uint32_t)((float)(ms)*32768.0f / 1000.0f))
                       // __HAL_LPTIM_COMPARE_SET(&hlptim1, target_count);
                       // rx_count = HAL_LPTIM_ReadCounter(&hlptim1);
                     //   printf("tx %d,rx %d,delay %d",current_count>>5,rx_count>>5,rec_delaytime);
//                        wg_report_freq = RX_Buffer[POLL_FREQ_IDX]+400;
//                        memcpy(&rec_delaytime,&RX_Buffer[NEXTPOLL_TIME_IDX],2);
//                        if(report_ancnum<2)
//                        {
//                            datalen_offset = report_ancnum*85;
//                        }else{
//                            datalen_offset = (report_ancnum-1)*46+85;
//                        }
//                        rec_secdelay = RX_Buffer[PWTAG_SECDELAY_IDX];
//                        if(BufferSize!=13||rec_secdelay>20)
//                        {
//                            rec_secdelay = 0;
//                        }
//
//                        sleep_time_count = rec_delaytime*3.2768 - delaytime-datalen_offset;
//                        while(sleep_time_count>=32768)
//                            sleep_time_count-=32768;
//                                                sleep_timer_start(sleep_time_count);
                        break;
                                                case WGRSP_RWTAG_READ:
                                                            no_rx_flag = 1;
@@ -826,7 +820,7 @@
{
//        io_pin_mux_set(_4G_USART_RX_Pin,IO_FUNC0);//把原先io å˜ä¸ºæ™®é€šGPIO
        gpio_pin_set_dir(LORA_DIO , GPIO_DIR_IN, 0);
        io_pull_set(LORA_DIO, IO_HIGH_Z, IO_PULL_UP_LEVEL4);
        io_pull_set(LORA_DIO, IO_HIGH_Z, IO_PULL_UP_NONE);
        gpio_enable_irq(LORA_DIO, GPIO_IRQ_TYPE_RISING_EDGE, irq_handler);
}
extern uint8_t pca9555writedata_input[10];//暂存输入寄存器所有配置的数组
@@ -843,8 +837,8 @@
int main(void)
{
    board_clock_run();
        //    boot_deinit();
    board_debug_console_open(TRACE_PORT_UART1);
        //  boot_deinit();
    //  board_debug_console_open(TRACE_PORT_UART1);
    // Reset reason
    reset_cause_get();
    reset_cause_clear(); 
@@ -869,10 +863,10 @@
    Board_LORA_NVIC_Init(Lora_irq_handler);
        Lora_init();
        rf_set_default_para(DEFAULT_WG_SET_FREQ,DEFAULT_WG_SET_SF);
//        IIC2_Init();
//    Accelerometer_Init();
        IIC2_Init();
    Accelerometer_Init();
        //LIS3DH_Data_Init();
//        PCA9555_init();
        PCA9555_init();
//    adc_get(&sample[0], NUM_SAMPLES, adc_callback);//adc采样
           Program_Init();
@@ -883,7 +877,7 @@
//#endif             
      // rf_single_tx_data(TXBuffer,10,2);
//    uart_receive(UART_ID1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback);
//    uart_receive(UART_ID0,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart0_receive_callback);
//    
//// Initialize low power mode
//    power_init();
@@ -894,12 +888,7 @@
        
//      pca_input_detection_init(pca_handler);
//#ifdef DEBUG_BOXING
//        io_pin_mux_set(IO_PIN_5,IO_FUNC0);
//        gpio_pin_set_dir(IO_PIN_5,GPIO_DIR_OUT,0);
//        io_pull_set(IO_PIN_5,IO_PULL_DOWN,IO_PULL_UP_LEVEL4);
//#endif
    Uwbinit();
    while (1)
@@ -907,8 +896,9 @@
//        RED_LED_OFF;
//        BT_LED_OFF;
//        //    gpio_pin_clr(IO_PIN_5);
        Lora_Tx_Poll();
      IdleTask();
       // UwbRange();
   
//        if(flag_TCP_reconnectting||IfTCPConnected())
@@ -932,7 +922,7 @@
//            flag_secondtask = 0;
//            SecondTask();
//        }
//        IdleTask();
//        //3种情况后都要发包和休眠
//        //if(send_flag){
//        //message_construct();
keil/lora_3029.c
@@ -164,10 +164,11 @@
extern uint32_t freq_list[4];
extern uint8_t DMA_RXBuf_BT[200];
extern uint8_t report_ancnum;
extern uint8_t report_ancnum_bt;
void LoraReportPoll(void)
{
    // delay_ms(100);
    uint8_t report_ancnum_bt=0;
#ifdef _USE_BAR
    GetPressAndHeight();
    intheight = Height*100;
@@ -221,21 +222,26 @@
        }
    }
    
    if(report_ancnum>LORA_REPORT_MAXANC_NUM)    //考虑lora传输时间,最多发送10个基站数据。
        report_ancnum = LORA_REPORT_MAXANC_NUM;
    if(report_ancnum>LORA_REPORT_MAXANC_NUM)                                  //考虑lora传输时间,最多发送10个基站数据。
        {
      report_ancnum = LORA_REPORT_MAXANC_NUM;
        }
#ifdef USE_GPS
    lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_TAGMSGTOWG_GPS;
    lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+30;
#else
    lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_TAGMSGTOWG;
    lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+4*report_ancnum_bt+ANCID_IDX;
    lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+ANCID_IDX;
#endif
    memcpy(&lora_sendbuffer[SOURCE_ID_IDX],&g_com_map[DEV_ID],2);
    memcpy(&lora_sendbuffer[DEST_ID_IDX],&wg_report_id,2);
    lora_sendbuffer[SEQNUM_IDX] = seq_num++;
    lora_sendbuffer[BAT_IDX] = bat_percent;
        //GET_USERKEY这个是那个lora——busy那个引脚
//        lora_sendbuffer[STATE_IDX]=0x01;
//        lora_sendbuffer[GATEWAY_CHANL]=0x02;
//        lora_sendbuffer[CHANL_NUM]=0x03;
   // lora_sendbuffer[STATE_IDX] = !GET_USERKEY|stationary_flag<<1;
#ifdef USE_GPS
    memcpy(&lora_sendbuffer[GPS_JINGDU_IDX],&gps_jingdu,8);
@@ -253,17 +259,20 @@
    lora_sendbuffer[ANCNUM_IDX] = report_ancnum;
    memcpy(&lora_sendbuffer[ANCID_IDX],report_ancid,report_ancnum*2);
    memcpy(&lora_sendbuffer[ANCID_IDX+report_ancnum*2],report_ancdist,report_ancnum*2);
    uint8_t LORA_RETRANSNUSSION_BT=0;
    LORA_RETRANSNUSSION_BT=ANCID_IDX+report_ancnum*2+1;
        uint8_t LORA_RETRANSNUSSION_BT=0;
        if(0<report_ancnum_bt&&report_ancnum_bt<11)
        {
      lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_TAGMSGTOWG_BT;
    LORA_RETRANSNUSSION_BT=ANCID_IDX+report_ancnum*4;
        //LORA_RETRANSNUSSION_BT   report_ancnum_bt
        lora_sendbuffer[LORA_RETRANSNUSSION_BT] = 0x2D;                                                                                                             //蓝牙上传标识符
        DMA_RXBuf_BT[0]=report_ancnum_bt;                                                                                                                                              //蓝牙基站数量
    memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT],&DMA_RXBuf_BT[1],report_ancnum_bt*2);                                     //基站ID
    memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT+report_ancnum_bt*2],&DMA_RXBuf_BT[1+report_ancnum_bt*2],report_ancnum_bt*2);//基站距离
        lora_sendbuffer[LORA_RETRANSNUSSION_BT] = 0x2D;         //蓝牙上传标识符
    memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT+1],&DMA_RXBuf_BT[0],report_ancnum_bt*2+1);                                     //基站ID
    memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT+report_ancnum_bt*2+2],&DMA_RXBuf_BT[1+report_ancnum_bt*2],report_ancnum_bt*2);//基站距离
        lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+4*report_ancnum_bt+ANCID_IDX+4;
        }
        if(lora_sendbuffer[LORA_RETRANSNUSSION_BT]==0x2D)
        {
        checksum = Checksum_u16(lora_sendbuffer,4*report_ancnum_bt+4*report_ancnum+ANCID_IDX+1);
        checksum = Checksum_u16(lora_sendbuffer,4*report_ancnum_bt+4*report_ancnum+ANCID_IDX+2);
        memcpy(&lora_sendbuffer[ANCID_IDX+report_ancnum_bt*4+report_ancnum*4+2],&checksum,2);
        }
        else
@@ -271,14 +280,11 @@
        checksum = Checksum_u16(lora_sendbuffer,4*report_ancnum+ANCID_IDX);
        memcpy(&lora_sendbuffer[ANCID_IDX+report_ancnum*4],&checksum,2);
        }
        //rf_enter_continous_tx();
//    LORA_3029_SEND(lora_sendbuffer,ANCID_IDX+report_ancnum*4+2);
    LORA_3029_SINGLE_SEND(lora_sendbuffer,ANCID_IDX+report_ancnum*4+report_ancnum_bt*2+4,0);
    LORA_3029_SINGLE_SEND(lora_sendbuffer,ANCID_IDX+report_ancnum*4+report_ancnum_bt*4+4,0);
        memset(DMA_RXBuf_BT, 0,200);
        memset(&lora_sendbuffer[ANCID_IDX],0,200);
//            rf_single_tx_data(lora_sendbuffer,ANCID_IDX+report_ancnum*4+2,2);
    //rf_enter_continous_rx();
@@ -415,19 +421,19 @@
         //  group_min_dist[group_id] = 0xffff;
         //   Radio.Standby();
                        //rf_antenna_close();
                        rf_set_mode(RF_MODE_STB3);
                        uint32_t para;
//                        rf_set_mode(RF_MODE_STB3);
//                        uint32_t para;
//                        frqe=((UWB_CHANNEL_FRQ+group_id)*100000);
                        para=freq_list[1] * 100000;
//                        para=freq_list[1] * 100000;
////                        rf_set_default_para(frqe,UWB_CHANNEL_SF);
//                        rf_set_carrier_wave_off();
//                  rf_set_carrier_wave_on();
                        rf_set_freq(para);
                        rf_set_sf(5);
//                        rf_set_tx_power(para);
//                  rf_set_carrier_wave_freq(freq_list[1] * 100000);
            //SwitchLoraSettings(UWB_CHANNEL_FRQ+group_id,UWB_CHANNEL_SF,0);
                      dangqian_frqe=rf_read_freq();
////                  rf_set_carrier_wave_on();
//                        rf_set_freq(para);
//                        rf_set_sf(5);
////                        rf_set_tx_power(para);
////                  rf_set_carrier_wave_freq(freq_list[1] * 100000);
//            //SwitchLoraSettings(UWB_CHANNEL_FRQ+group_id,UWB_CHANNEL_SF,0);
//                      dangqian_frqe=rf_read_freq();
                //        LoraSendComMap(WGRSP_RWTAG_READ);
                        
                        //delay_us(5000);
keil/lora_3029.h
@@ -12,7 +12,7 @@
#define LORA_DIO IO_PIN_7
//#define LORA_DIO IO_PIN_4
#define ANC_MAX_NUM           50
#define LORA_REPORT_MAXANC_NUM  7
#define LORA_REPORT_MAXANC_NUM  10
//#define TEST_FREQ
#ifdef  TEST_FREQ
#define LORA_UPCHANNEL_FRQ 456
@@ -110,6 +110,8 @@
    #define BAT_IDX             7   //标签电量
    #define STATE_IDX           8
    #define BAR_HEIGHT_IDX      9  //气压高度
        #define GATEWAY_CHANL       9
        #define CHANL_NUM           10
    #define ANCNUM_IDX          11  
    #define ANCID_IDX           12   //校验在4*ancnum+ANCID_IDX ä½ç½®
//        #define LORA_RETRANSNUSSION_BT 13  //LORA转发蓝牙协议标识符
keil/uwb_app.c
@@ -415,49 +415,13 @@
    uint8_t i;
    uint16_t tempid;
    // The following peripherals will be initialized in the uwb_open function
    // phy/mac/aes/lsp/phy timers initialized
    //uwb_open();
////    // Set calibration parameters
//    uwb_calibration_params_set(config.phy_cfg.ch_num);
//    // set advanced parameters
//    struct PHY_ADV_CONFIG_T adv_config = {
//        .thres_fap_detect = 40,
//        .nth_scale_factor = 4,
//        .ranging_performance_mode = 0,
//        .skip_weakest_port_en = 0,
//    };
//    phy_adv_params_configure(&adv_config);
//    // uwb configure
//    uwb_configure(config.phy_work_mode, board_param.tx_power_fcc[CALIB_CH(config.phy_cfg.ch_num)], &config.phy_cfg);
//    ranging_frame_type_set(config.phy_cfg.sts_pkt_cfg);
    // Register rx interrupt callback function
    mac_register_process_handler(tx_int_callback, rx_int_callback);
    receive_flag = 0;
        flag_recsuccess = 0;
//    temp_count3=phy_timer_count_get();
    //gpio_pin_set(SCL_PIN);
    //    time_count_dkjs=phy_timer_count_get();
//        gpio_pin_set(IO_PIN_5);//测试
//        gpio_pin_clr(IO_PIN_5);
    uwb_rxflag=uwb_rx(0, 0, range_timeout_us);//开启接收
//            gpio_pin_clr(IO_PIN_5);
//        gpio_pin_clr(IO_PIN_5);//测试
        #ifdef DEBUG_BOXING
//        gpio_pin_clr(IO_PIN_5);//测试
//        gpio_pin_set(IO_PIN_5);//测试
        #endif
//        #ifdef DEBUG_BOXING
//        gpio_pin_set(IO_PIN_5);//测试
//      #endif
//      #ifdef DEBUG_BOXING
//        gpio_pin_set(IO_PIN_5);//测试
//        #endif
    uwb_rxflag_num1++;
  //  while(mac_is_busy());
  //  temp_count2=phy_timer_count_get();
@@ -551,6 +515,7 @@
            }
                        recev_error_num=0;
//            sleep_timer_start(__MS_TO_32K_CNT(UWB_DELAY_TIME_US));//测试
//            LOG_INFO(TRACE_MODULE_APP,"标签ID:%X,距离: %d ä¿¡å·å¼ºåº¦ï¼š%d.\r\n",g_com_map[BIND_DEV_ID],distance,rssi);
       
keil/uwb_simple_example.uvoptx
@@ -120,7 +120,7 @@
        <SetRegEntry>
          <Number>0</Number>
          <Key>DLGUARM</Key>
          <Name></Name>
          <Name>d</Name>
        </SetRegEntry>
        <SetRegEntry>
          <Number>0</Number>
@@ -435,17 +435,55 @@
        <Ww>
          <count>15</count>
          <WinNumber>2</WinNumber>
          <ItemText>Forward_BT_buff</ItemText>
        </Ww>
        <Ww>
          <count>16</count>
          <WinNumber>2</WinNumber>
          <ItemText>DMA_RXBuf_BT</ItemText>
        </Ww>
        <Ww>
          <count>17</count>
          <WinNumber>2</WinNumber>
          <ItemText>buff</ItemText>
        </Ww>
        <Ww>
          <count>18</count>
          <WinNumber>2</WinNumber>
          <ItemText>LORA_RETRANSNUSSION_BT</ItemText>
        </Ww>
        <Ww>
          <count>19</count>
          <WinNumber>2</WinNumber>
          <ItemText>checksum</ItemText>
        </Ww>
        <Ww>
          <count>20</count>
          <WinNumber>2</WinNumber>
          <ItemText>pdata</ItemText>
        </Ww>
        <Ww>
          <count>21</count>
          <WinNumber>2</WinNumber>
          <ItemText>report_ancnum_bt</ItemText>
        </Ww>
      </WatchWindow2>
      <MemoryWindow1>
        <Mm>
          <WinNumber>1</WinNumber>
          <SubType>8</SubType>
          <ItemText>applyid</ItemText>
          <ItemText>buffer</ItemText>
          <AccSizeX>0</AccSizeX>
        </Mm>
      </MemoryWindow1>
      <MemoryWindow2>
        <Mm>
          <WinNumber>2</WinNumber>
          <SubType>1</SubType>
          <ItemText>lora_sendbuffer</ItemText>
          <AccSizeX>0</AccSizeX>
        </Mm>
      </MemoryWindow2>
      <Tracepoint>
        <THDelay>0</THDelay>
      </Tracepoint>