File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ typedef enum detectedBinary_ENUM {
5050 detectedBinary_FIRMWARE_RAM , //!< Firmware for RAM
5151 detectedBinary_BOOTLOADER_FLASH , //!< New bootloader for FLASH
5252 detectedBinary_BOOTLOADER_RAM , //!< Bootloader for RAM
53+ detectedBinary_UNKNOWN , //!< Not existing or unknown signature
5354} detectedBinary_E ;
5455
5556detectedBinary_E Signature_verification (const signature_S * signature );
Original file line number Diff line number Diff line change @@ -63,10 +63,14 @@ BinaryUpdate_handleDetectedBinary(detectedBinary_E detected_binary) {
6363 s_address = RAM_FIRMWARE_ADDRESS ;
6464 break ;
6565
66- default :
66+ case detectedBinary_UNKNOWN :
67+ //we support unsigned binary but handle it as firmware for flash
6768 success = false;
6869 s_address = FLASH_FIRMWARE_ADDRESS ;
6970 break ;
71+
72+ default :
73+ break ;
7074 }
7175
7276 return success ;
@@ -130,9 +134,12 @@ BinaryUpdate_erase(uint32_t firmware_size) {
130134 case detectedBinary_BOOTLOADER_RAM :
131135 break ;
132136
133- default :
137+ case detectedBinary_UNKNOWN :
134138 success = FlashAdapter_erase (firmware_size , s_address );
135139 break ;
140+
141+ default :
142+ break ;
136143 }
137144
138145 return success ;
@@ -195,11 +202,14 @@ BinaryUpdate_finish(void) {
195202 boot_info .skip_bl_loop = true;
196203 break ;
197204
198- default :
205+ case detectedBinary_UNKNOWN :
199206 boot_info .jump_address = FLASH_FIRMWARE_ADDRESS ;
200207 boot_info .skip_bl_loop = false;
201208 success = FlashAdapter_finish ();
202209 break ;
210+
211+ default :
212+ break ;
203213 }
204214
205215 boot_info .previus_binary = s_detected_binary ;
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ Signature_verification(const signature_S* signature) {
5959 } else if (0 == memcmp (& (signature -> magic_key ), & bl_ram_signature_magic_key , sizeof (bl_ram_signature_magic_key ))) {
6060 detected_binary = detectedBinary_BOOTLOADER_RAM ;
6161 } else {
62- detected_binary = detectedBinary_FIRMWARE_FLASH ;
62+ detected_binary = detectedBinary_UNKNOWN ;
6363 }
6464
6565 return detected_binary ;
You can’t perform that action at this time.
0 commit comments