Compare commits

...

1 Commits

Author SHA1 Message Date
576d32adb1 适配bootloader 2025-09-20 01:40:24 +08:00
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 */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 16K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 4K
FLASH (rx) : ORIGIN = 0x08002000, LENGTH = 32K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
}
/* Sections */

View File

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