Skip to content

Commit

Permalink
Merge pull request #47 from armfly/origin/armfly
Browse files Browse the repository at this point in the history
优化自动烧录功能,识别到IDCODE后延迟一段时间后再进行烧录
  • Loading branch information
armfly authored Jan 24, 2021
2 parents cc7eb88 + 6dafd36 commit ea315ad
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 16 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@

----------------------------------------------------------------------------
2021-01-24 V1.47 对应PC软件版本 V1.4.4
1. 优化插入自动烧录功能。识别到IDCODE后延迟一段时间后再进行烧录。
解决上电较快但是硬件复位比较慢的板子自动烧录失败的问题。
延迟时间通过PC配置,参数名称:重新上电后的延迟(ms)
2. 解决灵动MM32L07X芯片多路烧录时失败的问题。
增加一个配置参数,在读内存指令之间增加几十us级别的延迟(50us)。
迟时间通过PC配置,参数名称:读内存指令间延迟(us)
3. EMMC磁盘文件更新: MM32L07x_128.lua --新增缺省参数 MUL_DELAYUS_READ_DATA = 50

----------------------------------------------------------------------------
2021-01-08 V1.46 对应PC软件版本 V1.4.3
1. 部分界面文字颜色加深
Expand Down
Binary file modified Project/H7-BOOT.bin
Binary file not shown.
42 changes: 31 additions & 11 deletions Project/MDK-ARM(uV5)/project.uvoptx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
<Name></Name>
<Name>(105=-1,-1,-1,-1,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
Expand Down Expand Up @@ -164,7 +164,7 @@
<Type>0</Type>
<LineNumber>214</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134443372</Address>
<Address>134443664</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
Expand Down Expand Up @@ -232,6 +232,26 @@
<WinNumber>1</WinNumber>
<ItemText>s_lua_prog_buf[0x000038AB]</ItemText>
</Ww>
<Ww>
<count>11</count>
<WinNumber>1</WinNumber>
<ItemText>R0</ItemText>
</Ww>
<Ww>
<count>12</count>
<WinNumber>1</WinNumber>
<ItemText>ack[0]</ItemText>
</Ww>
<Ww>
<count>13</count>
<WinNumber>1</WinNumber>
<ItemText>ack[1]</ItemText>
</Ww>
<Ww>
<count>14</count>
<WinNumber>1</WinNumber>
<ItemText>s_debug</ItemText>
</Ww>
</WatchWindow1>
<MemoryWindow1>
<Mm>
Expand Down Expand Up @@ -1851,7 +1871,7 @@

<Group>
<GroupName>Doc</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -2923,7 +2943,7 @@

<Group>
<GroupName>LwIP_TCP</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -3059,7 +3079,7 @@

<Group>
<GroupName>Programmer</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand All @@ -3079,7 +3099,7 @@
<GroupNumber>17</GroupNumber>
<FileNumber>221</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\User\programmer\prog_if.c</PathWithFileName>
Expand Down Expand Up @@ -3887,7 +3907,7 @@

<Group>
<GroupName>DAP_bsp</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -4083,7 +4103,7 @@

<Group>
<GroupName>ST_USB_Device_Library_Core</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -4127,7 +4147,7 @@

<Group>
<GroupName>ST_USB_Device_Library_Class</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -4195,7 +4215,7 @@

<Group>
<GroupName>ST_USBD_Virtual_COM</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down Expand Up @@ -4287,7 +4307,7 @@

<Group>
<GroupName>ST_USBD_Mass Storage</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
Expand Down
2 changes: 1 addition & 1 deletion Project/MDK-ARM(uV5)/startup_stm32h743xx.s
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ __Vectors DCD __initial_sp ; Top of Stack
DCD MemManage_Handler ; MPU Fault Handler
DCD BusFault_Handler ; Bus Fault Handler
DCD UsageFault_Handler ; Usage Fault Handler
DCD 0x00000146 ; Reserved H7-TOOL APP 固件版本
DCD 0x00000147 ; Reserved H7-TOOL APP 固件版本
DCD 0 ; Reserved 固件小版本
DCD 0 ; Reserved
DCD 0 ; Reserved
Expand Down
Binary file not shown.
3 changes: 3 additions & 0 deletions User/app/src/status_programmer.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ void status_ProgWork(void)
ucAutoState = 0;
fRunOnce = 1;
bsp_PutKey(KEY_DB_S); /* 任意发一个本状态无用的按键消息,重开背光 */

/* 2021-01-21 V1.47 增加延迟,有些客户的板子上电延迟比较大 */
bsp_DelayMS(lua_GetVarUint32("POWEROFF_TIME3", 20));
}
}
else
Expand Down
11 changes: 10 additions & 1 deletion User/daplink/source/daplink/interface/swd_host_multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,12 @@ static uint8_t MUL_swd_read_data(uint32_t addr, uint32_t *val)
return 0;
}

/* 2021-01-24 多路烧录MM32L073FP时,增加如下延迟才正常 */
if (g_tProg.MulDelayUsReadData > 0)
{
bsp_DelayUS(g_tProg.MulDelayUsReadData); /* 20us 失败,30us成功, 选择50us */
}

// dummy read
req = SWD_REG_DP | SWD_REG_R | SWD_REG_ADR(DP_RDBUFF);
pAck = MUL_swd_transfer_retry(req, (uint32_t *)val);
Expand All @@ -696,6 +702,9 @@ static uint8_t MUL_swd_read_data(uint32_t addr, uint32_t *val)
else
{
ack = 0;

printf("MUL_swd_read_data() Error, MUL_DELAYUS_READ_DATA\r\n");

}
// *val = 0;
// tmp = tmp_out[3];
Expand Down Expand Up @@ -1389,7 +1398,7 @@ uint8_t MUL_swd_flash_syscall_exec(const program_syscall_t *sysCallParam, uint32
if (!MUL_swd_write_debug_state(&state)) {
return 0;
}

if (!MUL_swd_wait_until_halted()) {
return 0;
}
Expand Down
7 changes: 6 additions & 1 deletion User/programmer/prog_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ void PG_ReloadLuaVar(void)

if (g_tProg.ChipType == CHIP_SWD_ARM)
{
;
/*
2021-01-24 多路烧录MM32L073FP时,增加如下延迟才正常
static uint8_t MUL_swd_read_data(uint32_t addr, uint32_t *val);
20us 失败,30us成功, 选择50us
*/
g_tProg.MulDelayUsReadData = lua_GetVarUint32("MUL_DELAYUS_READ_DATA", 0);
}
else if (g_tProg.ChipType == CHIP_SWIM_STM8)
{
Expand Down
5 changes: 3 additions & 2 deletions User/programmer/prog_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ typedef struct
uint32_t SwdResetDelay; /* 硬件复位后的延迟时间,ms */
uint32_t ResetMode; /* 复位模式 */

uint8_t AbortOnError; /* 多路模式,0表示出错时继续烧录OK的芯片 1表示出错后立刻同时终止 */
uint8_t AbortOnError; /* 多路模式,0表示出错时继续烧录OK的芯片 1表示出错后立刻同时终止 */

uint8_t ChNum; /* 通道个数 */
uint8_t ChNum; /* 通道个数 */

uint16_t MulDelayUsReadData; /* 多路模式读内存操作中的延迟,仅 MM32L073系列 */
}OFFLINE_PROG_T;

/* lua脚本fix_data_begin()返回一个table,用于通知C程序哪些内存地址需要填充数据 */
Expand Down

0 comments on commit ea315ad

Please sign in to comment.