zhangbo
2025-04-25 5bf948272927a95041754945cbdef8c848c57738
添加OTA中断使能,待测试,
已修改8个文件
28315 ■■■■ 文件已修改
keil/JLinkLog.txt 14228 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Listings/uwb_simple_example.map 5437 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.build_log.htm 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.hex 8572 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example.htm 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/Objects/uwb_simple_example_MK8000 Release.dep 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/include/main/main.c 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/uwb_app.c 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
keil/JLinkLog.txt
ÎļþÌ«´ó
keil/Listings/uwb_simple_example.map
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.build_log.htm
@@ -42,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:01
Build Time Elapsed:  00:00:00
</pre>
</body>
</html>
keil/Objects/uwb_simple_example.hex
ÎļþÌ«´ó
keil/Objects/uwb_simple_example.htm
@@ -3,7 +3,7 @@
<title>Static Call Graph - [.\Objects\uwb_simple_example.axf]</title></head>
<body><HR>
<H1>Static Call Graph for image .\Objects\uwb_simple_example.axf</H1><HR>
<BR><P>#&#060CALLGRAPH&#062# ARM Linker, 6140002: Last Updated: Fri Apr 25 11:46:56 2025
<BR><P>#&#060CALLGRAPH&#062# ARM Linker, 6140002: Last Updated: Fri Apr 25 17:56:56 2025
<BR><P>
<H3>Maximum Stack Usage =       1604 bytes + Unknown(Cycles, Untraceable Function Pointers)</H3><H3>
Call chain for Maximum Stack Depth:</H3>
@@ -2410,8 +2410,8 @@
<BR>[Called By]<UL><LI><a href="#[1ce]">&gt;&gt;</a>&nbsp;&nbsp;&nbsp;check_input_change
</UL>
<P><STRONG><a name="[17d]"></a>Program_Init</STRONG> (Thumb, 496 bytes, Stack size 40 bytes, main.o(.text.Program_Init))
<BR><BR>[Stack]<UL><LI>Max Depth = 844<LI>Call Chain = Program_Init &rArr; parameter_init_anchor &rArr; flash_open &rArr; trace_printf &rArr; trace_output &rArr;  trace_printf (Cycle)
<P><STRONG><a name="[17d]"></a>Program_Init</STRONG> (Thumb, 500 bytes, Stack size 32 bytes, main.o(.text.Program_Init))
<BR><BR>[Stack]<UL><LI>Max Depth = 836<LI>Call Chain = Program_Init &rArr; parameter_init_anchor &rArr; flash_open &rArr; trace_printf &rArr; trace_output &rArr;  trace_printf (Cycle)
</UL>
<BR>[Calls]<UL><LI><a href="#[a5]">&gt;&gt;</a>&nbsp;&nbsp;&nbsp;trace_printf
<LI><a href="#[e6]">&gt;&gt;</a>&nbsp;&nbsp;&nbsp;delay_ms
@@ -3631,7 +3631,7 @@
<BR><BR>[Called By]<UL><LI><a href="#[1f9]">&gt;&gt;</a>&nbsp;&nbsp;&nbsp;power_enter_power_down_mode
</UL>
<P><STRONG><a name="[2a]"></a>main</STRONG> (Thumb, 596 bytes, Stack size 16 bytes, main.o(.text.main))
<P><STRONG><a name="[2a]"></a>main</STRONG> (Thumb, 600 bytes, Stack size 16 bytes, main.o(.text.main))
<BR><BR>[Stack]<UL><LI>Max Depth = 1220<LI>Call Chain = main &rArr; IdleTask &rArr; UART_CheckReceive &rArr; DBG_Poll &rArr; UsartParseDataHandler &rArr; GPS_RecvFsm &rArr; UDPClient_UploadGPS &rArr; Socket_Send &rArr; HIDO_Debug &rArr; Uart_Send &rArr; uart_send &rArr; dma_transfer &rArr; trace_assert_dump &rArr; trace_print_backtrace &rArr; mk_snprintf &rArr; trace_format &rArr; _PrintInt &rArr; _PrintUnsigned &rArr; __aeabi_uidiv
</UL>
<BR>[Calls]<UL><LI><a href="#[1b9]">&gt;&gt;</a>&nbsp;&nbsp;&nbsp;adc_open
keil/Objects/uwb_simple_example_MK8000 Release.dep
@@ -748,7 +748,7 @@
I (D:\keil\ARM\ARMCLANG\include\stdarg.h)(0x5DDFFD72)
I (include\drivers\mk_gpio.h)(0x6809FCA0)
I (include\drivers\Usart.h)(0x6809FCA0)
F (.\include\main\main.c)(0x680AFDCC)(-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 -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)(0x680B5C67)(-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 -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)(0x6809FCA0)
I (include\drivers\mk_common.h)(0x6809FCA0)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
@@ -846,7 +846,7 @@
I (include\drivers\mk_misc.h)(0x6809FCA0)
I (include\drivers\serial_at_cmd_app.h)(0x6809FCA0)
I (include\drivers\DBG.h)(0x6809FCA0)
F (.\uwb_app.c)(0x6809FCA0)(-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 -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)(0x680B507B)(-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 -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)(0x6809FCA0)
I (include\drivers\mk_common.h)(0x6809FCA0)
I (D:\keil\ARM\ARMCLANG\include\stddef.h)(0x5DDFFD72)
keil/include/main/main.c
@@ -40,6 +40,10 @@
#define UPDATE_TIME 10
#define UWB_OPEN_COUNT 1
#define UWB_MEASUREMENT_INTERVAL 3
#define UWB_MEASUREMENT_INTERVAL_SLEEP 60
extern uint8_t mUsartReceivePack[100];
extern uint8_t mUsart2ReceivePack[150];
extern uint8_t state5V_prase_flag,gps_prase_flag;
@@ -71,8 +75,20 @@
        LINK_SUCCESS,
        SEARCH_DEV,
} Operation_step;
Operation_step UWB_work_state;
Operation_step UWB_work_state;
// å®šä¹‰çŠ¶æ€
typedef enum {
    STATE_NORMAL,    // æ­£å¸¸çŠ¶æ€ï¼Œ3秒测距上传一次
    STATE_SLEEP      // ä¼‘眠状态,1分钟测距上传一次
} CountState_t;
uint32_t uwb_time_count = 0;  // å®šæ—¶å™¨è®¡æ•°å€¼
//uint32_t step_count = 0;      // æ­¥æ•°è®¡æ•°
//uint32_t last_step_count = 0; // ä¸Šä¸€æ¬¡æ­¥æ•°
CountState_t current_state = STATE_NORMAL; // å½“前状态
uint32_t state_start_time = 0; // çŠ¶æ€å¼€å§‹æ—¶é—´
Commend_SendDate send_struct;
struct ADC_CFG_T usr_adc_cfg = {
@@ -571,6 +587,49 @@
     uart_close(UART_ID0);//解绑原来串口0
}
extern uint32_t uwb_time_count;
void upload_apppoll()
{
      uint32_t elapsed_time_jibu;
    switch (current_state)
            {
        case STATE_NORMAL:
            elapsed_time_jibu = uwb_time_count - state_start_time;
                    switch(elapsed_time_jibu)
                        {
                            case UWB_OPEN_COUNT:
                                        CloseUWB();
                            break;
                            case UWB_MEASUREMENT_INTERVAL:
                                        OpenUWB();
                    state_start_time = uwb_time_count;
                            break;
                        }
            break;
        case STATE_SLEEP:
            elapsed_time_jibu = uwb_time_count - state_start_time;
                    switch(elapsed_time_jibu)
                        {
                            case UWB_OPEN_COUNT:
                                            CloseUWB();
                            break;
                            case UWB_MEASUREMENT_INTERVAL_SLEEP:
                                            OpenUWB();
                      state_start_time = uwb_time_count;
                            break;
                        }
            break;
            }
}
uint8_t flag_4guart_needinit=0;
uint8_t index1,index2,index3;
int16_t Voltage_input;
@@ -580,6 +639,7 @@
extern uint8_t receive_flag;
int main(void)
{
      __enable_irq();
    board_clock_run();
    boot_deinit();
    board_pins_config();
keil/uwb_app.c
@@ -141,7 +141,7 @@
    .phy_cfg.code_index = 9,                  /* TRX preamble code                         */
    .phy_cfg.mean_prf = MEAN_PRF_64M,         /* Mean prf 64/128/256M                      */
    .phy_cfg.data_bit_rate = DATA_BR_6M8,     /* Data rate 6.8M                            */
    .phy_cfg.sync_sym = PREAM_LEN_128,        /* Preamble duration, length of preamble 128 */
    .phy_cfg.sync_sym = PREAM_LEN_64,        /* Preamble duration, length of preamble 128 */
    .phy_cfg.sfd_sym = NON_STD_NSFD5_8,          /* Identifier for SFD sequence               */
    .phy_cfg.ranging_bit = 1,                 /* ranging bit set 1                         */
    .phy_cfg.trx_mode = TRX_MODE_15_4A,  /* IEEE802.15.4z - BPRF mode                 */