Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RT200T_ESP32
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
RT200T
RT200T_ESP32
Commits
3805c087
Commit
3805c087
authored
Jun 04, 2024
by
李秉薇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:修改校验发送频率
parent
a85cf15e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
Protocol_User.c
RT200T_2_ESP32/main/Protocol_User.c
+26
-9
No files found.
RT200T_2_ESP32/main/Protocol_User.c
View file @
3805c087
...
@@ -427,10 +427,6 @@ void SetUpgradeFlashSize(uint32_t size,uint32_t len)
...
@@ -427,10 +427,6 @@ void SetUpgradeFlashSize(uint32_t size,uint32_t len)
StartAddr
=
len
;
StartAddr
=
len
;
BackupStartAddr
=
StartAddr
;
BackupStartAddr
=
StartAddr
;
Write_Counter
=
0
;
Write_Counter
=
0
;
ESP_LOGI
(
"MSI"
,
"DataTotalLen : %ld
\n
"
,
DataTotalLen
);
ESP_LOGI
(
"MSI"
,
"BackupDataTotalLen : %ld
\n
"
,
BackupDataTotalLen
);
ESP_LOGI
(
"MSI"
,
"StartAddr : %ld Erase Chip
\n
"
,
StartAddr
);
ESP_LOGI
(
"MSI"
,
"BackupStartAddr : %ld Erase Chip
\n
"
,
BackupStartAddr
);
}
}
...
@@ -444,8 +440,15 @@ void SendCmd_EraseBAT32A239_Chip(void)
...
@@ -444,8 +440,15 @@ void SendCmd_EraseBAT32A239_Chip(void)
{
{
Update_Frame
.
CMDH
=
CMD_FLASH_ERASE
;
Update_Frame
.
CMDH
=
CMD_FLASH_ERASE
;
Update_Frame
.
CMDL
=
0x00
;
Update_Frame
.
CMDL
=
0x00
;
Update_Frame
.
LEN
=
0x00
;
Update_Frame
.
LEN
=
0x08
;
memset
(
Update_Frame
.
DAT
,
0
,
16
);
Update_Frame
.
DAT
[
0
]
=
StartAddr
>>
24
;
Update_Frame
.
DAT
[
1
]
=
StartAddr
>>
16
;
Update_Frame
.
DAT
[
2
]
=
StartAddr
>>
8
;
Update_Frame
.
DAT
[
3
]
=
StartAddr
;
Update_Frame
.
DAT
[
0
]
=
BackupDataTotalLen
>>
24
;
Update_Frame
.
DAT
[
1
]
=
BackupDataTotalLen
>>
16
;
Update_Frame
.
DAT
[
2
]
=
BackupDataTotalLen
>>
8
;
Update_Frame
.
DAT
[
3
]
=
BackupDataTotalLen
;
UpdateBAT32A239Protocol_Send
(
Update_Frame
);
UpdateBAT32A239Protocol_Send
(
Update_Frame
);
}
}
uint32_t
Write_Size
=
0
;
uint32_t
Write_Size
=
0
;
...
@@ -514,7 +517,7 @@ void Upgrade_BAT32A239_Task(void *arg)
...
@@ -514,7 +517,7 @@ void Upgrade_BAT32A239_Task(void *arg)
{
{
UpgradeBAT32A239_1ms_Cnt
=
0
;
UpgradeBAT32A239_1ms_Cnt
=
0
;
}
}
if
((
UpgradeBAT32A239_1ms_Cnt
+
2
)
%
5
0
==
0
)
if
((
UpgradeBAT32A239_1ms_Cnt
+
2
)
%
2
0
==
0
)
{
{
BAT32A239_MCU_Update
();
BAT32A239_MCU_Update
();
}
}
...
@@ -560,9 +563,10 @@ void BAT32A239_MCU_Update(void)
...
@@ -560,9 +563,10 @@ void BAT32A239_MCU_Update(void)
else
else
{
{
Step_delayTime
++
;
Step_delayTime
++
;
if
(
Step_delayTime
>=
2
000
)
if
(
Step_delayTime
>=
5
000
)
{
{
ESP_LOGI
(
"MSI"
,
"UpgradeStep : %d Erase Chip timeout
\n
"
,
UpgradeStep
);
ESP_LOGI
(
"MSI"
,
"UpgradeStep : %d Erase Chip timeout
\n
"
,
UpgradeStep
);
Step_delayTime
=
0
;
UpgradeStep
=
5
;
//超时停止
UpgradeStep
=
5
;
//超时停止
}
}
}
}
...
@@ -614,6 +618,7 @@ void BAT32A239_MCU_Update(void)
...
@@ -614,6 +618,7 @@ void BAT32A239_MCU_Update(void)
if
(
BAT32A239_ACK
.
dat
.
verification
.
CR1
==
0x01
)
if
(
BAT32A239_ACK
.
dat
.
verification
.
CR1
==
0x01
)
{
{
ESP_LOGI
(
"MSI"
,
"Err : %2x
\n
"
,
BAT32A239_ACK
.
dat
.
download
.
CR2
);
ESP_LOGI
(
"MSI"
,
"Err : %2x
\n
"
,
BAT32A239_ACK
.
dat
.
download
.
CR2
);
Step_delayTime
=
0
;
}
}
if
(
BAT32A239_ACK
.
dat
.
verification
.
CR1
==
0x00
)
if
(
BAT32A239_ACK
.
dat
.
verification
.
CR1
==
0x00
)
{
{
...
@@ -622,9 +627,13 @@ void BAT32A239_MCU_Update(void)
...
@@ -622,9 +627,13 @@ void BAT32A239_MCU_Update(void)
}
}
}
}
else
else
{
if
((
Step_delayTime
%
20
)
==
0
)
{
{
SendCmd_CrcCheckBAT32A239_Flash
();
//校验flash
SendCmd_CrcCheckBAT32A239_Flash
();
//校验flash
}
}
Step_delayTime
++
;
}
//UpgradeStep=9;
//UpgradeStep=9;
break
;
break
;
...
@@ -657,12 +666,20 @@ void BAT32A239_MCU_Update(void)
...
@@ -657,12 +666,20 @@ void BAT32A239_MCU_Update(void)
else
else
{
{
UpgradeStep
=
3
;
UpgradeStep
=
3
;
Step_delayTime
=
0
;
}
}
}
}
break
;
break
;
default:
default:
UpgradeStep
=
5
;
UpgradeStep
=
5
;
/*Flash_Size =0;
temp_Size =0;
Write_Counter=0;
StartAddr = 0;
BackupStartAddr = 0;
DataTotalLen = 0;
BackupDataTotalLen = 0;*/
break
;
break
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment