diff --git a/checher_slave.uvoptx b/checher_slave.uvoptx index 365583f..7b090d8 100644 --- a/checher_slave.uvoptx +++ b/checher_slave.uvoptx @@ -611,24 +611,7 @@ - - - 0 - 0 - 959 - 1 -
134254714
- 0 - 0 - 0 - 0 - 0 - 1 - D:\work\SVN\鍐夊窛\mcu_program\checker_slave\source\elec_det\driver\EWDriver.c - - \\checker_slave_app\source/elec_det/driver/EWDriver.c\959 -
-
+ 0 @@ -640,7 +623,7 @@ 1 1 - APP_TEST_PLAN_ADDR + 0x20003af4 0 @@ -1534,6 +1517,18 @@ 0 0 + + 6 + 65 + 1 + 0 + 0 + 0 + .\source\elec_det\elec_task_slot.c + elec_task_slot.c + 0 + 0 + @@ -1544,7 +1539,7 @@ 0 7 - 65 + 66 1 0 0 @@ -1556,7 +1551,7 @@ 7 - 66 + 67 1 0 0 @@ -1576,7 +1571,7 @@ 0 8 - 67 + 68 1 0 0 @@ -1588,7 +1583,7 @@ 8 - 68 + 69 1 0 0 @@ -1600,7 +1595,7 @@ 8 - 69 + 70 1 0 0 @@ -1612,7 +1607,7 @@ 8 - 70 + 71 1 0 0 @@ -1624,7 +1619,7 @@ 8 - 71 + 72 1 0 0 @@ -1636,7 +1631,7 @@ 8 - 72 + 73 1 0 0 @@ -1648,7 +1643,7 @@ 8 - 73 + 74 1 0 0 @@ -1660,7 +1655,7 @@ 8 - 74 + 75 1 0 0 @@ -1672,7 +1667,7 @@ 8 - 75 + 76 1 0 0 @@ -1684,7 +1679,7 @@ 8 - 76 + 77 1 0 0 @@ -1696,7 +1691,7 @@ 8 - 77 + 78 1 0 0 @@ -1708,7 +1703,7 @@ 8 - 78 + 79 1 0 0 @@ -1720,7 +1715,7 @@ 8 - 79 + 80 1 0 0 @@ -1732,7 +1727,7 @@ 8 - 80 + 81 1 0 0 @@ -1744,7 +1739,7 @@ 8 - 81 + 82 1 0 0 @@ -1756,7 +1751,7 @@ 8 - 82 + 83 1 0 0 @@ -1768,7 +1763,7 @@ 8 - 83 + 84 1 0 0 @@ -1780,7 +1775,7 @@ 8 - 84 + 85 1 0 0 @@ -1792,7 +1787,7 @@ 8 - 85 + 86 2 0 0 @@ -1812,7 +1807,7 @@ 0 9 - 86 + 87 1 0 0 @@ -1824,7 +1819,7 @@ 9 - 87 + 88 1 0 0 @@ -1836,7 +1831,7 @@ 9 - 88 + 89 1 0 0 @@ -1848,7 +1843,7 @@ 9 - 89 + 90 1 0 0 @@ -1860,7 +1855,7 @@ 9 - 90 + 91 1 0 0 @@ -1872,7 +1867,7 @@ 9 - 91 + 92 1 0 0 @@ -1884,7 +1879,7 @@ 9 - 92 + 93 1 0 0 @@ -1896,7 +1891,7 @@ 9 - 93 + 94 1 0 0 @@ -1908,7 +1903,7 @@ 9 - 94 + 95 1 0 0 @@ -1920,7 +1915,7 @@ 9 - 95 + 96 1 0 0 @@ -1932,7 +1927,7 @@ 9 - 96 + 97 1 0 0 @@ -1944,7 +1939,7 @@ 9 - 97 + 98 1 0 0 @@ -1964,7 +1959,7 @@ 0 10 - 98 + 99 1 0 0 @@ -1976,7 +1971,7 @@ 10 - 99 + 100 1 0 0 @@ -1988,7 +1983,7 @@ 10 - 100 + 101 1 0 0 @@ -2000,7 +1995,7 @@ 10 - 101 + 102 1 0 0 @@ -2012,7 +2007,7 @@ 10 - 102 + 103 1 0 0 @@ -2032,7 +2027,7 @@ 0 11 - 103 + 104 1 0 0 @@ -2052,7 +2047,7 @@ 0 12 - 104 + 105 1 0 0 @@ -2064,7 +2059,7 @@ 12 - 105 + 106 1 0 0 @@ -2076,7 +2071,7 @@ 12 - 106 + 107 1 0 0 @@ -2088,7 +2083,7 @@ 12 - 107 + 108 1 0 0 @@ -2100,7 +2095,7 @@ 12 - 108 + 109 1 0 0 @@ -2112,7 +2107,7 @@ 12 - 109 + 110 1 0 0 @@ -2132,7 +2127,7 @@ 0 13 - 110 + 111 5 0 0 @@ -2152,7 +2147,7 @@ 0 14 - 111 + 112 5 0 0 @@ -2164,7 +2159,7 @@ 14 - 112 + 113 5 0 0 diff --git a/checher_slave.uvprojx b/checher_slave.uvprojx index 84cdee3..4329994 100644 --- a/checher_slave.uvprojx +++ b/checher_slave.uvprojx @@ -185,7 +185,6 @@ 0 0 0 - 0 0 0 8 @@ -352,7 +351,7 @@ 0 0 0 - 4 + 0 @@ -804,7 +803,7 @@ 2 2 2 - 0 + 2 @@ -950,6 +949,11 @@ 1 .\source\elec_det\elec_judge.c + + elec_task_slot.c + 1 + .\source\elec_det\elec_task_slot.c + @@ -1908,7 +1912,7 @@ 2 2 2 - 0 + 2 @@ -2404,7 +2408,7 @@ 2 2 2 - 0 + 2 @@ -2503,7 +2507,7 @@ 2 2 2 - 0 + 2 @@ -2582,7 +2586,7 @@ 2 2 2 - 0 + 2 @@ -2656,7 +2660,7 @@ app 0x4 ARM-ADS - 5060960::V5.06 update 7 (build 960)::.\ARMCC + 5060750::V5.06 update 6 (build 750)::ARMCC 0 @@ -2831,7 +2835,6 @@ 0 0 0 - 0 0 0 8 @@ -2959,7 +2962,7 @@ 1 - 4 + 1 0 0 1 @@ -2998,7 +3001,7 @@ 0 0 0 - 4 + 0 @@ -3782,6 +3785,11 @@ 1 .\source\elec_det\elec_judge.c + + elec_task_slot.c + 1 + .\source\elec_det\elec_task_slot.c + @@ -4347,7 +4355,6 @@ 0 0 0 - 0 0 0 8 @@ -4514,7 +4521,7 @@ 0 0 0 - 4 + 0 @@ -5043,6 +5050,11 @@ 1 .\source\elec_det\elec_judge.c + + elec_task_slot.c + 1 + .\source\elec_det\elec_task_slot.c + diff --git a/doc/CSMZM_V0.06.bin b/doc/CSMZM_V0.06.bin new file mode 100644 index 0000000..c95fb7f Binary files /dev/null and b/doc/CSMZM_V0.06.bin differ diff --git a/doc/__csmzm_app.bin b/doc/__csmzm_app.bin new file mode 100644 index 0000000..a38abdf Binary files /dev/null and b/doc/__csmzm_app.bin differ diff --git a/doc/creat_jwt_boot.py b/doc/creat_jwt_boot.py index 8a7dac2..f3c02ae 100644 --- a/doc/creat_jwt_boot.py +++ b/doc/creat_jwt_boot.py @@ -6,7 +6,7 @@ import json BOOT_PATH ="JW3425_boot_v12.bin" -APP_PATH ="ms-10-30.bin" +APP_PATH ="csmzm_app_v0.06.bin" OUT_PATH = BOOT_PATH.split('.')[0]+APP_PATH.split('.')[0]+".jwt" # 创建离线下载器的镜像 @@ -77,12 +77,18 @@ def creat(): if __name__ == "__main__": - creat() - # d=bytearray() - # with open("MS-10-30-1.bin","rb") as f: - # d+=f.read() - # with open("ms-10-30.bin","wb+") as f: - # f.write(d[4096:4096+9800]) + + if(len(sys.argv)>=2): + + rom_input=sys.argv[1] + APP_PATH ="__csmzm_app.bin" + OUT_PATH = '.'.join(rom_input.split('.')[:-1])+".jwt" + d=bytearray() + with open(rom_input,"rb") as f: + d+=f.read() + with open(APP_PATH,"wb+") as f: + f.write(d[4096:4096+11*1024]) + creat() diff --git a/source/ReadMe.txt b/source/ReadMe.txt index 275700f..bedf11c 100644 --- a/source/ReadMe.txt +++ b/source/ReadMe.txt @@ -284,4 +284,8 @@ 广播命令根据数据量自动计算发送数据的窗口时间 2023.12.10 添加任务插槽,未写完 - +2023.12.11 + V0.08 解决任务执行次数异常的bug,原因是每次执行任务未更新任务结构体指针,此bug在V2.06版本被引入 + 解决 EW_Test_ReadUID 函数数组越界的问题 +2023.12.12 + 添加 总线翻转任务 JQ_Test_Toggle diff --git a/source/elec_det/driver/EWDriver.c b/source/elec_det/driver/EWDriver.c index 5e836d7..c8509ad 100644 --- a/source/elec_det/driver/EWDriver.c +++ b/source/elec_det/driver/EWDriver.c @@ -856,8 +856,8 @@ uint8_t DMod_FireBusReadDatasV2_RC(uint8_t* buf, uint8_t len, uint32_t time_out) EW_DIFF_MOD_H; Power_SetSampleCurrentRange(range); if(ret){ - DBG_LOG("cur_idle=%d,high_value=%d,idle_line=%d.",fire_dat.cur_idle, fire_dat.cur_high_value,fire_dat.cur_idle_line); - DBG_LOG("cur_max=%d,cur_idle_ad=%d",fire_dat.cur_max,fire_dat.cur_idle_ad); +// DBG_LOG("cur_idle=%d,high_value=%d,idle_line=%d.",fire_dat.cur_idle, fire_dat.cur_high_value,fire_dat.cur_idle_line); +// DBG_LOG("cur_max=%d,cur_idle_ad=%d",fire_dat.cur_max,fire_dat.cur_idle_ad); } return ret; } diff --git a/source/elec_det/elec_det.c b/source/elec_det/elec_det.c index b53aaa5..1dbaf0a 100644 --- a/source/elec_det/elec_det.c +++ b/source/elec_det/elec_det.c @@ -440,6 +440,7 @@ int elec_check_load_task_param(uint8_t task_index) } // 装载参数 + s->task_par=task_par; memcpy(&checker_runcfg.task_info,task_par,sizeof(CheckerTask_Info_st)); checker_runcfg.param_count = checker_runcfg.task_info.param_rtv_count & 0x0F; checker_runcfg.rtv_count = (checker_runcfg.task_info.param_rtv_count >> 4) & 0x0F; @@ -509,6 +510,7 @@ void elec_exe_task(void) if(s->task_fun==0){ return; } + DBG_LOG("start task_index:%d",s->task_index); for(int i=0;i<1+s->task_par->retry_time;i++) { checker_runcfg.excue_rtv=1; diff --git a/source/elec_det/elec_task_slot.c b/source/elec_det/elec_task_slot.c index 7fef8eb..e67dcb2 100644 --- a/source/elec_det/elec_task_slot.c +++ b/source/elec_det/elec_task_slot.c @@ -28,7 +28,7 @@ typedef struct{ task_node *head; task_node *current; int err_num; - uint8_t err_table[ERR_TABLE_SIZE] + uint8_t err_table[ERR_TABLE_SIZE]; }task_slot_def; @@ -114,7 +114,7 @@ int task_slot_add_err(void *context,uint8_t err) if(index<0) index=i; } if(t->err_table[i]==err){ - return; + return 0; } } if(index>=0){ diff --git a/source/elec_det/interface/CheckerExt.c b/source/elec_det/interface/CheckerExt.c index 9b920b1..0e1a2d4 100644 --- a/source/elec_det/interface/CheckerExt.c +++ b/source/elec_det/interface/CheckerExt.c @@ -133,13 +133,14 @@ void CheckerExt_Slot(void) int index; uint16_t ret=0; int self_index=checker_runcfg.task_info.runindex; + task_def *t=0; + void *task_slot=0; if(checker_runcfg.param_count<1){ ret=1; goto end; } index=checker_runcfg.params[0]; - task_def *t=0; - void *task_slot=task_slot_init(); + task_slot=task_slot_init(); if(task_slot==0){ goto end; } diff --git a/source/elec_det/interface/EWChecker.c b/source/elec_det/interface/EWChecker.c index 0d04600..6f4308c 100644 --- a/source/elec_det/interface/EWChecker.c +++ b/source/elec_det/interface/EWChecker.c @@ -80,7 +80,7 @@ void EW_Test_SetBusV(void) /* @brief 测量总线基本电压 -@rtv1 返回总线电流 单位0.01uA +@rtv1 返回总线电流 单位0.1uA */ void EW_Test_BaseCur(void) { @@ -128,7 +128,7 @@ void EW_Test_ReadUID(void) { uint8_t uc_rtv = 0; uint8_t uc_count = 0; - uint16_t aus_temp[12]; + uint16_t aus_temp[14]; uint32_t ul_temp = 0; memset(EW_RunBuf,0,EW_CHECKER_RUN_BUF); if(checker_runcfg.params[0] == 0) @@ -175,7 +175,7 @@ void EW_Test_ReadUID(void) uc_count = (checker_runcfg.params[0]+7+1)/2; } Checker_MaskResult(uc_rtv,checker_runcfg.task_info.runindex); - memcpy(aus_temp+4,EW_RunBuf,24); + memcpy(aus_temp+4,EW_RunBuf,16); Checker_SetRtv(aus_temp,checker_runcfg.rtv_count); } /* diff --git a/source/elec_det/interface/JQChecker.c b/source/elec_det/interface/JQChecker.c index c278794..46b9970 100644 --- a/source/elec_det/interface/JQChecker.c +++ b/source/elec_det/interface/JQChecker.c @@ -62,7 +62,7 @@ void JQ_Test_SetBusV(void) } /* @brief 测量总线基本电压 -@rtv1 返回总线电流 单位0.01uA +@rtv1 返回总线电流 单位0.1uA */ void JQ_Test_BaseCur(void) { @@ -1195,6 +1195,29 @@ void JQ_Test_VerifyDelay(void) end: Checker_MaskResult(uc_rtv,checker_runcfg.task_info.runindex); } +/* +@brief 切换总线极性 +@par0 从一个极性切换到另一个极性的间隔 +@par1 从正极性切换到负极性为一个循环,循环的次数 +@rtv1 返回最后一次总线电流 单位0.1uA +*/ +void JQ_Test_Toggle(void) +{ + uint16_t ul_cur[2]; + uint16_t interval_ms = checker_runcfg.params[0]; + uint16_t times = checker_runcfg.params[1]; + for(int i=0;itran,s->cmd,ret); // s->submit_delay=150; + s->submit_delay+=elec_local_addr()*3; }else{ //while(1); } @@ -187,7 +188,7 @@ static void check_later(void *t) { s->submit_times=10; s->submit_running=1; - s->submit_delay=150; + s->submit_delay=elec_local_addr()*10+200; later_execute(check_submit_later,s,s->submit_delay); }else{ s->cmd=0;