实现APP进行飞控固件升级

This commit is contained in:
OPTOC
2025-10-23 18:40:19 +08:00
parent ee28ccf5a7
commit 9754257a40
4 changed files with 170 additions and 7 deletions

View File

@@ -71,7 +71,7 @@ int send_cmd_wait(stmisp_device_t *stmisp_device, uint8_t cmd, uint32_t timeout)
switch(ack)
{
case 1:
printf("stmisp: ACK to cmd 0x%02x\n", cmd);
// printf("stmisp: ACK to cmd 0x%02x\n", cmd);
return 1;
case 2:
printf("stmisp: NACK to cmd 0x%02x\n", cmd);
@@ -235,7 +235,7 @@ int cmd_write_memory(stmisp_device_t *stmisp_device, uint32_t addr, const uint8_
stmisp_device->send((void *)&data[idx], chunk, 0);
stmisp_device->send(&cs, 1, 0);
if(wait_ack(stmisp_device, 5000) != 1) return 0;
if(wait_ack(stmisp_device, 1000) != 1) return 0;
//是否需要校验写入的数据块
if (verify)
{

View File

@@ -38,6 +38,10 @@ typedef struct
uint32_t adder_offset; //地址偏移
}stmisp_device_t;
typedef struct
{
uint32_t stmisp_file_size;
}stmisp_parm_t;
/**
* @brief 计算校验和
*/