modify bootloader version
authorkyz <kongyuzhong@google.com>
Thu, 30 May 2024 03:10:00 +0000 (11:10 +0800)
committerkyz <kongyuzhong@google.com>
Thu, 30 May 2024 03:10:00 +0000 (11:10 +0800)
MDK-ARM/bootloader.uvprojx
user/bootloader.c
user/user_cdc_rx_2.c

index 51a966677a00239d70a09f0a06e6cd93d676255a..bb19bb23d4c76c07e4614ff197545c04b9c97995 100644 (file)
               <FileType>1</FileType>
               <FilePath>../Core/Src/i2c.c</FilePath>
             </File>
-            <File>
-              <FileName>spi.c</FileName>
-              <FileType>1</FileType>
-              <FilePath>../Core/Src/spi.c</FilePath>
-            </File>
             <File>
               <FileName>tim.c</FileName>
               <FileType>1</FileType>
index 326603ccb175b864f8e9b6b6aa288f545ddad448..0c96cfa279d802e8ac905ca574e1a6f23203f025 100644 (file)
@@ -23,7 +23,6 @@
 #include "dac.h"
 #include "dma.h"
 #include "i2c.h"
-#include "spi.h"
 #include "tim.h"
 #include "usart.h"
 #include "usb_device.h"
@@ -39,7 +38,7 @@ void SystemClock_Config(void);
 void PeriphCommonClock_Config(void);
 void MX_FREERTOS_Init(void);
 
-const uint8_t SW_VER[16] = {1,1,}; //bootloader version
+const uint8_t SW_VER[4] = {1,2,}; //bootloader version
 
 uint8_t CDC_Transmit_HS(uint8_t* Buf, uint16_t Len);
 
index cce61ea9425170e0b53c0c6886c5a27b2f7d67a8..6dceaa93174db59838bd53df54f0a7d7820cb9e1 100644 (file)
@@ -349,6 +349,8 @@ int32_t load_app( void )
 }
 #endif // BOOTLOADER
 
+extern uint8_t SW_VER[];
+
 int32_t handle_cdc_pkt( cdc_pkt_t *pkt )
 {
     static uint8_t tx_pkt[250];
@@ -388,8 +390,8 @@ int32_t handle_cdc_pkt( cdc_pkt_t *pkt )
           #ifdef BOOTLOADER
             resp[0] = 0;
             resp[1] = 'B';
-            resp[2] = 1; //BOOT_VER_MAJOR;
-            resp[3] = 0; //BOOT_VER_MINOR;
+            resp[2] = SW_VER[0]; //BOOT_VER_MAJOR;
+            resp[3] = SW_VER[1]; //BOOT_VER_MINOR;
             put_u32_big( &resp[4], 0 ); //fw size
             put_u32_big( &resp[8], 0 ); //fw crc
           #else