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
750759ff
Commit
750759ff
authored
Jun 05, 2024
by
李秉薇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:擦除指令加入地址和长度
parent
3805c087
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
Protocol_Lib.c
RT200T_2_ESP32/main/Protocol_Lib.c
+6
-3
Protocol_User.c
RT200T_2_ESP32/main/Protocol_User.c
+6
-6
No files found.
RT200T_2_ESP32/main/Protocol_Lib.c
View file @
750759ff
...
...
@@ -334,14 +334,17 @@ Protocol_uint32_t UpdateBAT32A239Protocol_Send(UpdateProtocolStructure SendPd)
dataBuf
[
frameLen
-
2
]
=
(
Protocol_uint8_t
)(
DAT_CRC
>>
24
);
}
}
if
(
SendPd
.
CMDH
==
CMD_FLASH_ERASE
)
{
memcpy
(
&
dataBuf
[
6
],
&
SendPd
.
DAT
[
0
],
SendPd
.
LEN
);
}
for
(
i
=
0
;
i
<
(
frameLen
-
1
);
i
++
)
{
checksumXor
^=
dataBuf
[
i
];
}
dataBuf
[
frameLen
-
1
]
=
(
Protocol_uint8_t
)
checksumXor
;
printf
(
"dataBuf[frameLen - 1] = %2x
\n
"
,
dataBuf
[
frameLen
-
1
]);
printf
(
"frameLen = %d
\n
"
,
frameLen
);
//
printf("dataBuf[frameLen - 1] = %2x\n", dataBuf[frameLen - 1]);
//
printf("frameLen = %d\n", frameLen);
if
(
UARTSend_Cbk
!=
Protocol_NULL
)
{
return
UARTSend_Cbk
(
dataBuf
,
frameLen
);
...
...
RT200T_2_ESP32/main/Protocol_User.c
View file @
750759ff
...
...
@@ -445,10 +445,10 @@ void SendCmd_EraseBAT32A239_Chip(void)
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
;
Update_Frame
.
DAT
[
4
]
=
BackupDataTotalLen
>>
24
;
Update_Frame
.
DAT
[
5
]
=
BackupDataTotalLen
>>
16
;
Update_Frame
.
DAT
[
6
]
=
BackupDataTotalLen
>>
8
;
Update_Frame
.
DAT
[
7
]
=
BackupDataTotalLen
;
UpdateBAT32A239Protocol_Send
(
Update_Frame
);
}
uint32_t
Write_Size
=
0
;
...
...
@@ -651,14 +651,14 @@ void BAT32A239_MCU_Update(void)
}
if
(
DataTotalLen
>
MAX_OTA_BUFF
)
{
ESP_LOGI
(
"MSI"
,
"~~~~~~~~~~~~~~~~~~~~~~
\n
"
);
//
ESP_LOGI("MSI","~~~~~~~~~~~~~~~~~~~~~~\n");
Flash_Size
=
MAX_OTA_BUFF
;
esp_partition_read
(
assert_update_partition
,
StartAddr
-
BackupStartAddr
+
16
,
buf
,
Flash_Size
);
DataTotalLen
-=
Flash_Size
;
}
else
if
(
DataTotalLen
!=
0
)
{
ESP_LOGI
(
"MSI"
,
"!!!!!!!!!!!!!!!!!!!!!!!!!!
\n
"
);
//
ESP_LOGI("MSI","!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
Flash_Size
=
DataTotalLen
;
esp_partition_read
(
assert_update_partition
,
StartAddr
-
BackupStartAddr
+
16
,
buf
,
Flash_Size
);
DataTotalLen
=
0
;
...
...
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