zhangbo
2 天以前 0817c03a55b444ff4958723476f807486439e107
4G升级待详细测试,基本功能开发完成
已修改12个文件
20301 ■■■■■ 文件已修改
keil/JLinkLog.txt 8228 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Listings/uwb_simple_example.map 7405 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.build_log.htm 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.htm 4332 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example_MK8000 Release.dep 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/drivers/Usart.c 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/drivers/global_param.c 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/drivers/serial_at_cmd_app.c 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/main/main.c 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/src/TCPClient.c 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_app.c 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_simple_example.uvoptx 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/JLinkLog.txt
ÎļþÌ«´ó
keil/Listings/uwb_simple_example.map
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.build_log.htm
@@ -27,14 +27,8 @@
<h2>Output:</h2>
*** Using Compiler 'V6.14', folder: 'D:\keil\ARM\ARMCLANG\Bin'
Build Project 'uwb_simple_example' - Target 'MK8000 Release'
compiling uwb_app.c...
linking...
D:\zhangbo\2024\Code\ChinaUWB\ChinaUWBProject-1-5HZ\keil\include\devices\MK800X\Source\ARM\MK800X_ac6_copy.sct(25): warning: L6314W: No section matches pattern *(.XIP_SECTION).
Program Size: Code=85544 RO-data=11928 RW-data=2328 ZI-data=51324
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-1-5HZ\keil\Objects\uwb_simple_example.axf"
".\Objects\uwb_simple_example.axf" - 0 Error(s), 1 Warning(s).
".\Objects\uwb_simple_example.axf" - 0 Error(s), 0 Warning(s).
<h2>Software Packages used:</h2>
@@ -48,7 +42,7 @@
  D:\keil\pack\MKSEMI\MK800X_DFP\1.0.3\Device\Include
<h2>Collection of Component Files used:</h2>
Build Time Elapsed:  00:00:02
Build Time Elapsed:  00:00:00
</pre>
</body>
</html>
keil/Objects/uwb_simple_example.htm
ÎļþÌ«´ó
keil/Objects/uwb_simple_example_MK8000 Release.dep
@@ -550,7 +550,7 @@
I (..\user_config.h)(0x687DA899)
I (include\drivers\mk_uart.h)(0x6721A6AD)
I (D:\keil\ARM\ARMCLANG\include\stdio.h)(0x5DDFFD72)
F (.\include\drivers\Usart.c)(0x687F0501)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -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/components/internet/src -I ../keil -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)
F (.\include\drivers\Usart.c)(0x6881F808)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -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/components/internet/src -I ../keil -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)(0x6721A6AD)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
I (D:\keil\ARM\ARMCLANG\include\string.h)(0x5DDFFD6C)
@@ -646,7 +646,7 @@
I (include\drivers\mk_trace.h)(0x6721A6AD)
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\drivers\global_param.h)(0x6878C20F)
F (.\include\drivers\global_param.c)(0x68789C6C)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -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/components/internet/src -I ../keil -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/global_param.o -MD)
F (.\include\drivers\global_param.c)(0x687F50BD)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -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/components/internet/src -I ../keil -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/global_param.o -MD)
I (include\drivers\global_param.h)(0x6878C20F)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
I (include\drivers\mk_flash.h)(0x6721A6AD)
@@ -665,7 +665,7 @@
I (..\user_config.h)(0x687DA899)
I (include\drivers\mk_dma.h)(0x6721A6AD)
I (include\drivers\mk_misc.h)(0x6721A6AD)
F (.\include\drivers\serial_at_cmd_app.c)(0x6879E03C)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -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/components/internet/src -I ../keil -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)(0x6881FBB4)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -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/components/internet/src -I ../keil -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)(0x6879E03C)
I (D:\keil\ARM\ARMCLANG\include\stdint.h)(0x5DDFFD72)
I (include\drivers\global_param.h)(0x6878C20F)
@@ -749,7 +749,7 @@
I (include\drivers\mk_gpio.h)(0x6721A6AD)
I (include\drivers\Usart.h)(0x6721A6AD)
I (include\drivers\global_param.h)(0x6878C20F)
F (.\include\main\main.c)(0x687F2EC9)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -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/components/internet/src -I ../keil -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)
F (.\include\main\main.c)(0x68804CDC)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -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/components/internet/src -I ../keil -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)(0x6721A6AD)
I (include\drivers\mk_common.h)(0x6721A6AD)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -808,7 +808,8 @@
I (..\keil\dw_app_anchor.h)(0x6878C7B6)
I (..\keil\ymodem.h)(0x680AF3B4)
I (include\drivers\mk_phy.h)(0x6721A6AD)
F (.\include\src\TCPClient.c)(0x68789C6C)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -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/components/internet/src -I ../keil -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\components\hido\Include\HIDO_Debug.h)(0x6721A6AD)
F (.\include\src\TCPClient.c)(0x6881FB35)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -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/components/internet/src -I ../keil -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)(0x68510435)
I (include\components\hido\Include\HIDO_TYpeDef.h)(0x6721A6AD)
I (include\components\internet\inc\Socket.h)(0x6721A6AD)
@@ -850,7 +851,8 @@
I (include\drivers\mk_misc.h)(0x6721A6AD)
I (include\drivers\serial_at_cmd_app.h)(0x6879E03C)
I (include\drivers\DBG.h)(0x68510435)
F (.\uwb_app.c)(0x687F3EB2)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -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/components/internet/src -I ../keil -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\Usart.h)(0x6721A6AD)
F (.\uwb_app.c)(0x6881D221)(-xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m0 -c -fno-rtti -funsigned-char -D__MICROLIB -gdwarf-3 -O3 -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/components/internet/src -I ../keil -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)(0x6721A6AD)
I (include\drivers\mk_common.h)(0x6721A6AD)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
keil/include/drivers/Usart.c
@@ -73,6 +73,8 @@
//        DMACnt = EUART_RX_BUF_SIZE - cndtr;
//        MaxDataLen--;
        Usart1ParseDataCallback(m_EUART_DMA_RXBuf[m_EUART_DMA_RXPtr]);
//        Usart1ParseDataHandler(m_EUART_DMA_RXBuf);
//        DBG_Poll();
        //waitusart_timer = tag_frequency*USART_KEEPWAKE_TIME;
        m_EUART_DMA_RXPtr++;
        if( m_EUART_DMA_RXPtr >= EUART_RX_BUF_SIZE )
@@ -85,6 +87,31 @@
    m_bEUARTCheckingRec = 0;
}
void INTERNET_CheckReceive(void)
{
    int32_t DMACnt = 0;
    int32_t MaxDataLen = EUART_RX_BUF_SIZE;
    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/global_param.c
@@ -136,11 +136,11 @@
        g_com_map[MODBUS_MODE]=0;
        g_com_map[ACTIVE_INDEX]=0;
        g_com_map[IP_0]=39;
        g_com_map[IP_1]=106;
        g_com_map[IP_2]=210;
        g_com_map[IP_3]=13;
        g_com_map[PORT]=7000;
        g_com_map[IP_0]=117;
        g_com_map[IP_1]=72;
        g_com_map[IP_2]=111;
        g_com_map[IP_3]=237;
        g_com_map[PORT]=1102;
        g_com_map[TCP_IP_0]=121;
        g_com_map[TCP_IP_1]=33;
keil/include/drivers/serial_at_cmd_app.c
@@ -310,8 +310,183 @@
struct pwtag_structure pwtag;
extern uint8_t Get_anchor_appdata_flag;
extern uint8_t Get_anchor_appdata_num;
void Usart1ParseDataHandler(uint8_t data)
{
    if(!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-2; i++) {
                checksum += mUsartReceivePack[i];
            }
        checksum += pack_msgtype;
        checksum += pack_length;
            if(((data + checksum)&0xff) == 0xFF)                //校验通过
            {
              switch(pack_msgtype)
              {
                uint16_t serial_tag_id_recv;
                case MSG_RW:
                pack_cmd = mUsartReceivePack[0];
                pack_index = mUsartReceivePack[1];
                pack_datalen = mUsartReceivePack[2];
                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[3], pack_datalen);
                    if(g_com_map[YAOGEIANC_UPWENJIAN_FLAG]==1)
                    {
                    Get_anchor_appdata_flag=1;
                    Get_anchor_appdata_num=0;
                    save_com_map_to_flash();
                    delay_ms(300);
                    SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader
                    break;
                    }
                    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;
                }
                break;
                case MSG_RW_TAG_ANC:        //批量修改标签参数
                memcpy(&pwtag_idrec,&mUsartReceivePack[2],2);
                if(mUsartReceivePack[0]<0x10)  //判断是修改基站还是修改标签。
                {
                    if(mUsartReceivePack[0]==0x06)//如果是升级
                    {
                    for(uint8_t i=0; i<PWTAG_MAXGROUPNUM; i++)
                    {
                        if(pwtag.groupid[i][0]==pwtag_idrec)
                        {
                            pwtag.duorxie[i]=mUsartReceivePack[0];
                            pwtag.index[i] =  mUsartReceivePack[1];
                            pwtag.remain_time[i] = 5;
                            memcpy(pwtag.groupid[i],&mUsartReceivePack[2],4);
                            pwtag.len[pwtag_index] = pack_length-8;
                            memcpy(&pwtag.value[i][0],&g_com_map[YAOGEIANC_UPWENJIAN_DAXIAO],2);
                            memcpy(&mubiao_anchor_ID,&mUsartReceivePack[2],2);
                            break;
                        }
                        if(i==PWTAG_MAXGROUPNUM-1)
                        {
                            if(pwtag_index++>=PWTAG_MAXGROUPNUM)
                            {
                                pwtag_index = 0;
                            }
                            pwtag.index[pwtag_index] =  mUsartReceivePack[1];
                            pwtag.remain_time[pwtag_index] = 5;
                            pwtag.duorxie[pwtag_index]=mUsartReceivePack[0];
                            memcpy(pwtag.groupid[pwtag_index],&mUsartReceivePack[2],4);
                            pwtag.len[pwtag_index] = pack_length-8;
                            memcpy(&pwtag.value[pwtag_index][0],&g_com_map[YAOGEIANC_UPWENJIAN_DAXIAO],2);
                            memcpy(&mubiao_anchor_ID,&mUsartReceivePack[2],2);
                        }
                    }
                    }
                    else
                    {
                    for(uint8_t i=0; i<PWTAG_MAXGROUPNUM; i++)
                    {
                        if(pwtag.groupid[i][0]==pwtag_idrec)
                        {
                            pwtag.duorxie[i]=mUsartReceivePack[0];
                            pwtag.index[i] =  mUsartReceivePack[1];
                            pwtag.remain_time[i] = 5;
                            memcpy(pwtag.groupid[i],&mUsartReceivePack[2],4);
                            pwtag.len[pwtag_index] = pack_length-8;
                            memcpy(&pwtag.value[i][0],&mUsartReceivePack[6],pack_length-8);
                            break;
                        }
                        if(i==PWTAG_MAXGROUPNUM-1)
                        {
                            if(pwtag_index++>=PWTAG_MAXGROUPNUM)
                            {
                                pwtag_index = 0;
                            }
                            pwtag.index[pwtag_index] =  mUsartReceivePack[1];
                            pwtag.remain_time[pwtag_index] = 5;
                            pwtag.duorxie[pwtag_index]=mUsartReceivePack[0];
                            memcpy(pwtag.groupid[pwtag_index],&mUsartReceivePack[2],4);
                            pwtag.len[pwtag_index] = pack_length-8;
                            memcpy(&pwtag.value[pwtag_index][0],&mUsartReceivePack[6],pack_length-8);
                        }
                    }
                    }
                }
                 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-2) {        //如果收到的index与长度相等
            usart_receive_state = UsartReceiveWaitChecksum;
        }
    } else if(usart_receive_state == UsartReceiveWaitLength) {                        //收到长度字节
        pack_length = data;
        pack_index = 0;
        usart_receive_state = UsartReceiveWaitData;
    } 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)) {
        usart_receive_state = UsartReceiveWaitLength;
        pack_msgtype = data;
    }
    else {
        usart_receive_state = UsartReceiveWaitHead0;
        pack_index = 0;
        pack_length = 0;
    }
    }
}
void Usart2ParseDataHandler(uint8_t data)
{
    if(state5V_prase_flag&&!g_com_map[MODBUS_MODE])
    {   //升级程序
        static UsartRecvPackState usart_receive_state = UsartReceiveWaitHead0;
keil/include/main/main.c
@@ -27,6 +27,7 @@
#include "dw_app_anchor.h"
#include "ymodem.h"
#include "mk_phy.h"
#include "HIDO_Debug.h"
//#define DEBUG_MODE
extern int simple_main(void);
@@ -1060,6 +1061,7 @@
            if(jindu>baifenbi)
            {
            uart_send(UART_ID1, Dtu_shengji_jindu,9, NULL);
            TCPClient_Upload_hex(Dtu_shengji_jindu,9);
                baifenbi=baifenbi+10;
            }
            tx_en_start_u32 = phy_timer_count_get()+US_TO_PHY_TIMER_COUNT(100U);//发送必须要延时发送才可以用于测距否则立即发送会获取时间戳不对,需要计算程序运行时间,避免设置过去时间
@@ -1201,6 +1203,6 @@
        IMUTask();
        IdleTask();
//        check_step_and_update_state();
//        led_offtask();
        led_offtask();
    }
}
keil/include/src/TCPClient.c
@@ -26,6 +26,7 @@
#include "mk_flash.h"
#include <serial_at_cmd_app.h>
#include "DBG.h"
#include "Usart.h"
/*******************************************************************************
 *                                  Macro                                      *
 *******************************************************************************/
@@ -622,12 +623,19 @@
    {
        HIDO_INT32 i32Ret = 0;
        HIDO_UINT32 u32RecvLen = 0;
         HIDO_UINT32 u32Index = 0;  // æ–°å¢žç´¢å¼•变量
        i32Ret = Socket_Recv(l_i32TCPClientID, l_au8CmdBuff, sizeof(l_au8CmdBuff) - 1, &u32RecvLen);
        if(HIDO_OK == i32Ret)
        {
            l_au8CmdBuff[u32RecvLen]=0;
            TCPClient_DataProc(l_au8CmdBuff, u32RecvLen);
//             Usart1ParseDataCallback(l_au8CmdBuff[u32RecvLen]);
            for(int t=0;t< u32RecvLen;t++)
            {
                Usart1ParseDataCallback(l_au8CmdBuff[t]);
            }
//            TCPClient_DataProc(l_au8CmdBuff, u32RecvLen);
        }
        break;
    }
@@ -872,6 +880,17 @@
    return HIDO_OK;
}
HIDO_INT32 TCPClient_Upload_hex(uint8_t *_pcGGA, uint16_t u32Len)
{
    if(TCP_CLIENT_STATE_CONNECTED == l_eTCPClientState)
    {
        Socket_Send(l_i32TCPClientID, _pcGGA, u32Len);
    }
    return HIDO_OK;
}
HIDO_BOOL TCPClient_IsSendOver(HIDO_VOID)
{
    return Socket_IsSendQueueEmpty(l_i32TCPClientID);
keil/uwb_app.c
@@ -313,6 +313,7 @@
                {
                    memcpy(&lorarec_usart_send[2],rx_buf,rx_length);
                    uart_send(UART_ID1, lorarec_usart_send,rx_length+2, NULL);
                    TCPClient_Upload_hex(lorarec_usart_send,rx_length+2);
                    for(uint8_t i=0; i<PWTAG_MAXGROUPNUM; i++)
                    {
                        if(pwtag.groupid[i][0]<=lorarec_tagid&&lorarec_tagid<=pwtag.groupid[i][1])
@@ -697,6 +698,8 @@
        memcpy(&uwbsend[4+taglist_num*2],&tagdist_list,taglist_num*2);
        memcpy(&uwbsend[4+taglist_num*4],&anchordata_version,taglist_num*2);
        uart_send(UART_ID1, uwbsend,taglist_num*6+4, NULL);
//        TCPClient_Uploadhex(uwbsend,taglist_num*6+4);
        TCPClient_Upload_hex(uwbsend,taglist_num*6+4);
        taglist_num=0;
//        for(int i=0;i<anchordata_num;i++)
//        {
keil/uwb_simple_example.uvoptx
@@ -148,7 +148,24 @@
          <Name></Name>
        </SetRegEntry>
      </TargetDriverDllRegistry>
      <Breakpoint/>
      <Breakpoint>
        <Bp>
          <Number>0</Number>
          <Type>0</Type>
          <LineNumber>425</LineNumber>
          <EnabledFlag>1</EnabledFlag>
          <Address>42270</Address>
          <ByteObject>0</ByteObject>
          <HtxType>0</HtxType>
          <ManyObjects>0</ManyObjects>
          <SizeOfObject>0</SizeOfObject>
          <BreakByAccess>0</BreakByAccess>
          <BreakIfRCount>1</BreakIfRCount>
          <Filename>&lt;1&gt;.\include\drivers\serial_at_cmd_app.c</Filename>
          <ExecCommand></ExecCommand>
          <Expression>\\uwb_simple_example\include/drivers/serial_at_cmd_app.c\425</Expression>
        </Bp>
      </Breakpoint>
      <WatchWindow1>
        <Ww>
          <count>0</count>
@@ -350,77 +367,42 @@
        <Ww>
          <count>0</count>
          <WinNumber>2</WinNumber>
          <ItemText>tag_id_recv</ItemText>
          <ItemText>m_EUART_DMA_RXBuf</ItemText>
        </Ww>
        <Ww>
          <count>1</count>
          <WinNumber>2</WinNumber>
          <ItemText>rec_nearbase_num</ItemText>
          <ItemText>mUsartReceivePack</ItemText>
        </Ww>
        <Ww>
          <count>2</count>
          <WinNumber>2</WinNumber>
          <ItemText>rx_buf</ItemText>
          <ItemText>l_au8CmdBuff</ItemText>
        </Ww>
        <Ww>
          <count>3</count>
          <WinNumber>2</WinNumber>
          <ItemText>temp_count3,0x0A</ItemText>
          <ItemText>usart_receive_state</ItemText>
        </Ww>
        <Ww>
          <count>4</count>
          <WinNumber>2</WinNumber>
          <ItemText>resp_tx_en_start_u32,0x0A</ItemText>
          <ItemText>UsartReceiveWaitHead0</ItemText>
        </Ww>
        <Ww>
          <count>5</count>
          <WinNumber>2</WinNumber>
          <ItemText>tempid</ItemText>
          <ItemText>UsartReceiveWaitChecksum</ItemText>
        </Ww>
        <Ww>
          <count>6</count>
          <WinNumber>2</WinNumber>
          <ItemText>tempid_test,0x10</ItemText>
          <ItemText>usart_receive_state</ItemText>
        </Ww>
        <Ww>
          <count>7</count>
          <WinNumber>2</WinNumber>
          <ItemText>dev_id</ItemText>
        </Ww>
        <Ww>
          <count>8</count>
          <WinNumber>2</WinNumber>
          <ItemText>group_id</ItemText>
        </Ww>
        <Ww>
          <count>9</count>
          <WinNumber>2</WinNumber>
          <ItemText>send_buffer</ItemText>
        </Ww>
        <Ww>
          <count>10</count>
          <WinNumber>2</WinNumber>
          <ItemText>ceju_count,0x0A</ItemText>
        </Ww>
        <Ww>
          <count>11</count>
          <WinNumber>2</WinNumber>
          <ItemText>dev_id</ItemText>
        </Ww>
        <Ww>
          <count>12</count>
          <WinNumber>2</WinNumber>
          <ItemText>tagid_list</ItemText>
        </Ww>
        <Ww>
          <count>13</count>
          <WinNumber>2</WinNumber>
          <ItemText>poll_rx_num</ItemText>
        </Ww>
        <Ww>
          <count>14</count>
          <WinNumber>2</WinNumber>
          <ItemText>send_buffer</ItemText>
          <ItemText>mUsartReceivePack</ItemText>
        </Ww>
      </WatchWindow2>
      <MemoryWindow1>