适配bootloader

This commit is contained in:
2025-09-20 01:40:24 +08:00
parent d2519f4cf7
commit 576d32adb1
2 changed files with 9 additions and 2 deletions

View File

@@ -12,8 +12,8 @@ _Min_Stack_Size = 0x400; /* required amount of stack */
/* Memories definition */ /* Memories definition */
MEMORY MEMORY
{ {
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 16K FLASH (rx) : ORIGIN = 0x08002000, LENGTH = 32K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 4K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
} }
/* Sections */ /* Sections */

View File

@@ -17,6 +17,7 @@
#include <stdio.h> #include <stdio.h>
#include "board_config.h" #include "board_config.h"
#include "gd32e23x_usart.h" #include "gd32e23x_usart.h"
#include "gd32e23x_misc.h"
#include "ultrasonic_analog.h" #include "ultrasonic_analog.h"
#include "systick.h" #include "systick.h"
@@ -291,6 +292,12 @@ void handle_command(const uint8_t *frame, uint8_t len) {
// send_response(RESP_TYPE_OK, (uint8_t *)"v23.0.0.3", 9); // send_response(RESP_TYPE_OK, (uint8_t *)"v23.0.0.3", 9);
return; return;
case 9999u:
// M9999: 重启系统
__disable_irq(); // 关闭全局中断GD32E230 CMSIS标准函数
nvic_system_reset(); // 系统复位GD32E230标准库函数
break;
default: default:
// 其它无参数命令在此扩展示例M100处理逻辑该如何待定 // 其它无参数命令在此扩展示例M100处理逻辑该如何待定
// send_response(RESP_TYPE_OK, s_report_status_ok, sizeof(s_report_status_ok)); // send_response(RESP_TYPE_OK, s_report_status_ok, sizeof(s_report_status_ok));