From af81e3a0dc6e9c5c0fe46b252b369eb70270cfb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=90=83=E6=B2=B9=E7=82=B8=E9=B8=A1?= <1425962791@qq.com> Date: Thu, 9 Oct 2025 17:27:45 +0800 Subject: [PATCH] update bootloader --- bootloader/BSP/LCD/lcd.c | 16 ++++++++-------- bootloader/BSP/LCD/lcd_init.h | 6 +++--- bootloader/Core/Src/main.c | 8 ++++---- bootloader/Core/Src/usart.c | 2 +- bootloader/Ymodem/common.c | 12 ++++++------ bootloader/Ymodem/flash_if.h | 8 ++++---- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/bootloader/BSP/LCD/lcd.c b/bootloader/BSP/LCD/lcd.c index de11f0e..49a1370 100644 --- a/bootloader/BSP/LCD/lcd.c +++ b/bootloader/BSP/LCD/lcd.c @@ -4,7 +4,7 @@ #include "delay.h" #include "spi.h" -#define OFFSET_Y 0 +#define OFFSET_Y 80 /****************************************************************************** 函数说明:在指定区域填充颜色 @@ -60,7 +60,7 @@ void LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color) ******************************************************************************/ void LCD_DrawPoint(u16 x,u16 y,u16 color) { - LCD_Address_Set(x,y,x,y);//设置光标位置 + LCD_Address_Set(x,y+OFFSET_Y,x,y+OFFSET_Y);//设置光标位置 LCD_WR_DATA(color); } @@ -201,7 +201,7 @@ void LCD_ShowChinese12x12(u16 x,u16 y,u8 *s,u16 fc,u16 bc,u8 sizey,u8 mode) { if((tfont12[k].Index[0]==*(s))&&(tfont12[k].Index[1]==*(s+1))) { - LCD_Address_Set(x,y,x+sizey-1,y+sizey-1); + LCD_Address_Set(x,y+OFFSET_Y,x+sizey-1,y+sizey-1+OFFSET_Y); for(i=0;i
© COPYRIGHT 2011 STMicroelectronics
****************************************************************************** - */ + */ /** @addtogroup STM32F4xx_IAP * @{ @@ -191,7 +191,7 @@ uint32_t SerialKeyPressed(uint8_t *key) { if (__HAL_UART_GET_FLAG(&huart6, UART_FLAG_RXNE) != RESET) { - *key = (uint16_t)((&huart6)->Instance->DR & (uint16_t)0x01FF); + *key = (uint16_t)((&huart6)->Instance->DR & (uint16_t)0x01FF); return 1; } else @@ -227,7 +227,7 @@ uint8_t GetKey(void) */ void SerialPutChar(uint8_t c) { - USART_SendData(USART1, c); + USART_SendData(USART6, c); while (__HAL_UART_GET_FLAG(&huart6, UART_FLAG_TXE) == RESET) { } @@ -293,8 +293,8 @@ void USART_SendData(USART_TypeDef* USARTx, uint16_t Data) { /* Check the parameters */ assert_param(IS_USART_ALL_PERIPH(USARTx)); - assert_param(IS_USART_DATA(Data)); - + assert_param(IS_USART_DATA(Data)); + /* Transmit Data */ USARTx->DR = (Data & (uint16_t)0x01FF); } diff --git a/bootloader/Ymodem/flash_if.h b/bootloader/Ymodem/flash_if.h index e6440d4..ffddc06 100644 --- a/bootloader/Ymodem/flash_if.h +++ b/bootloader/Ymodem/flash_if.h @@ -37,10 +37,10 @@ #define ADDR_FLASH_SECTOR_5 ((uint32_t)0x08020000) /* Base @ of Sector 5, 128 Kbyte */ #define ADDR_FLASH_SECTOR_6 ((uint32_t)0x08040000) /* Base @ of Sector 6, 128 Kbyte */ #define ADDR_FLASH_SECTOR_7 ((uint32_t)0x08060000) /* Base @ of Sector 7, 128 Kbyte */ -#define ADDR_FLASH_SECTOR_8 ((uint32_t)0x08080000) /* Base @ of Sector 8, 128 Kbyte */ -//#define ADDR_FLASH_SECTOR_9 ((uint32_t)0x080A0000) /* Base @ of Sector 9, 128 Kbyte */ -//#define ADDR_FLASH_SECTOR_10 ((uint32_t)0x080C0000) /* Base @ of Sector 10, 128 Kbyte */ -//#define ADDR_FLASH_SECTOR_11 ((uint32_t)0x080E0000) /* Base @ of Sector 11, 128 Kbyte */ +// #define ADDR_FLASH_SECTOR_8 ((uint32_t)0x08080000) /* Base @ of Sector 8, 128 Kbyte */ +// #define ADDR_FLASH_SECTOR_9 ((uint32_t)0x080A0000) /* Base @ of Sector 9, 128 Kbyte */ +// #define ADDR_FLASH_SECTOR_10 ((uint32_t)0x080C0000) /* Base @ of Sector 10, 128 Kbyte */ +// #define ADDR_FLASH_SECTOR_11 ((uint32_t)0x080E0000) /* Base @ of Sector 11, 128 Kbyte */ /* End of the Flash address */ #define USER_FLASH_END_ADDRESS 0x0807FFFF