changeset 991:39b25be11009 BootloaderOstc5

Jump to Bootloader: In the previous version it was hard to get into the bootloader at startup. Rootcause was a change in the timing of the loop operations which detect a key press. The countdown values have been increased to allow an easier jump to the bootloader
author Ideenmodellierer
date Tue, 15 Apr 2025 17:36:19 +0200 (8 days ago)
parents 45a2bd04b156
children 39f28cd9dc46
files BootLoader/Src/base_bootlader.c
diffstat 1 files changed, 4 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/BootLoader/Src/base_bootlader.c	Sun Mar 30 21:39:52 2025 +0200
+++ b/BootLoader/Src/base_bootlader.c	Tue Apr 15 17:36:19 2025 +0200
@@ -417,7 +417,7 @@
 }
 
 
-int main(void)
+int __attribute__((optimize("O0"))) main(void)
 {
 
 /*
@@ -447,7 +447,7 @@
 	/* button press is only 40 to 50 us low */
 	MX_GPIO_One_Button_only_Init();
 
-	uint32_t i = 500000;
+	uint32_t i = 4000000;
 
 	callForUpdate = __HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST);
 
@@ -471,7 +471,7 @@
 		}
 		if(i)
 		{
-			i = 200000;
+			i = 4000000;
 			while(!MX_GPIO_Read_The_One_Button() && i)
 			{
 				i--;
@@ -479,30 +479,12 @@
 			}
 			if(i)
 			{
-				i = 200000;
+				i = 4000000;
 				while(MX_GPIO_Read_The_One_Button() && i)
 				{
 					i--;
 					__NOP();
 				}
-				if(i)
-				{
-					i = 200000;
-					while(!MX_GPIO_Read_The_One_Button() && i)
-					{
-						i--;
-						__NOP();
-					}
-					if(i)
-					{
-						i = 200000;
-						while(MX_GPIO_Read_The_One_Button() && i)
-						{
-							i--;
-							__NOP();
-						}
-					}
-				}
 			}
 		}
 	}