Professional Documents
Culture Documents
FlashTool V6 Command Customization Guide
FlashTool V6 Command Customization Guide
FlashTool V6 Command Customization Guide
Guide
Version: 1.0
Release date: 07/02/2021
Table of contents
1. Purpose............................................................................................................................................... 4
2. General command format and execution flow......................................................................................5
2.1. Command Format.............................................................................................................................5
2.2. The command execution flow...........................................................................................................5
2.3. Security concern................................................................................................................................6
3. DA Implementation............................................................................................................................. 7
3.1. Command registration......................................................................................................................7
3.2. Function examples............................................................................................................................7
Lists of tables
未找到图形项目表。
1. Purpose
2) Have node “<da/version>”, version format: “major.minor”. “1.x” must compatible with early version. If
not, update to “2.x”.
1) Service send string to flash.dll library, and the library just send it directly to DA, do not modify and check it.
4) Command handler use protocol functions already implemented in DA to communicate with flash.dll.
b. Read/Write file on host. File can be: memory buffer, host normal file, customized file type.
3. DA Implementation
//If command “CMD:CUST1” and version ver1_0 is received, “cmd_cust1” will handle
this.
//parameter:
//channel: USB channel, must not be used directly to transfer data.
// or will cause protocol error.
//xml: the xml string sent by host.
int cmd_cust1(struct com_channel_struct *channel, const char *xml) {
clear_error_msg();
mxml_node_t *tree;
const char *info;
if ((tree = mxmlLoadString(NULL, xml, MXML_OPAQUE_CALLBACK)) == NULL ||
(info = mxmlGetNodeText(tree, "da/arg/cust_node1")) == NULL) {
set_error_msg(“This error message will be reported to host.”);
return STATUS_ERR;
}
//do functions.
MXMLDELETE(tree);
return STATUS_OK;
}
char *buffer = 0;
uint32_t data_length = 0;
"cust-message");
Doing a time consumption job and prevent host timeout and appear no response to user, need report
progress:
progress.cb = cb_op_progress_report;
fp_progress_report_start(channel, part_info.name);
fp_progress_report_end(channel);