浏览代码

HFR 진행사항

Bank 의 이미지파일이 CRC가 안맞으면 File을 부팅시키지 않는다.
PYJ 5 年之前
父节点
当前提交
df49b2196b
共有 9 个文件被更改,包括 4527 次插入4768 次删除
  1. 二进制
      Debug/STM32F103_ATTEN_PLL_Zig.elf
  2. 707 739
      Debug/STM32F103_ATTEN_PLL_Zig.hex
  3. 3345 3560
      Debug/STM32F103_ATTEN_PLL_Zig.list
  4. 423 449
      Debug/STM32F103_ATTEN_PLL_Zig.map
  5. 1 1
      STM32F103_ATTEN_PLL_Zig.elf.launch
  6. 3 0
      Src/MBIC_Bootloader.c
  7. 44 15
      Src/eeprom.c
  8. 1 1
      Src/flash.c
  9. 3 3
      Src/main.c

二进制
Debug/STM32F103_ATTEN_PLL_Zig.elf


文件差异内容过多而无法显示
+ 707 - 739
Debug/STM32F103_ATTEN_PLL_Zig.hex


文件差异内容过多而无法显示
+ 3345 - 3560
Debug/STM32F103_ATTEN_PLL_Zig.list


文件差异内容过多而无法显示
+ 423 - 449
Debug/STM32F103_ATTEN_PLL_Zig.map


+ 1 - 1
STM32F103_ATTEN_PLL_Zig.elf.launch

@@ -57,5 +57,5 @@
57 57
 </listAttribute>
58 58
 <stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;&gt;&#13;&#10;&lt;gdbmemoryBlockExpression address=&quot;536873172&quot; label=&quot;data&quot;/&gt;&#13;&#10;&lt;gdbmemoryBlockExpression address=&quot;536873172&quot; label=&quot;data&quot;/&gt;&#13;&#10;&lt;/memoryBlockExpressionList&gt;&#13;&#10;"/>
59 59
 <stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
60
-<stringAttribute key="saved_expressions&lt;seperator&gt;Unknown" value="update_data_buf,data"/>
60
+<stringAttribute key="saved_expressions&lt;seperator&gt;Unknown" value="update_data_buf,data,Bank1data,Bank2data,MBIC_BOOT_VERSION"/>
61 61
 </launchConfiguration>

+ 3 - 0
Src/MBIC_Bootloader.c

@@ -275,6 +275,9 @@ void MBIC_Bootloader_FirmwareUpdate(uint8_t* data){
275 275
 //            printf("ccc\r\n");
276 276
         break;
277 277
         case MBIC_Download_DATA_REQ:
278
+       /*     bluecell_Currdatastatus.CPUVERSION1 = 0xFF;
279
+            bluecell_Currdatastatus.CPUVERSION2 = 0xFF;
280
+            bluecell_Currdatastatus.CPUVERSION3 = 0xFF;  */
278 281
             TotalFrame = data[MBIC_PAYLOADSTART + 0] << 24
279 282
                         |data[MBIC_PAYLOADSTART + 1] << 16
280 283
                         |data[MBIC_PAYLOADSTART + 2] << 8

+ 44 - 15
Src/eeprom.c

@@ -69,13 +69,13 @@ void EEPROM_M24C08_Init(void){
69 69
     bluecell_Currdatastatus.CPU_Bank1_Image_Version2 = Bank1data[MBIC_BOOT_VERSION + 1];
70 70
     bluecell_Currdatastatus.CPU_Bank1_Image_Version3 = Bank1data[MBIC_BOOT_VERSION + 2];
71 71
 
72
-    pdata = &bluecell_Currdatastatus.CPU_Bank1_Image_Name;
73
-    printf("BANK1 IMAGE NAME : ");
74
-    for(int i = 0 ; i< 32; i++){
75
-       pdata[i] = Bank1data[MBIC_BOOT_FILENAME + i];
76
-       printf("%c",pdata[i]);
77
-    }
78
-    printf("\r\n");
72
+//    pdata = &bluecell_Currdatastatus.CPU_Bank1_Image_Name;
73
+//    printf("BANK1 IMAGE NAME : ");
74
+//    for(int i = 0 ; i< 32; i++){
75
+//       pdata[i] = Bank1data[MBIC_BOOT_FILENAME + i];
76
+//       printf("%c",pdata[i]);
77
+//    }
78
+//    printf("\r\n");
79 79
 
80 80
 
81 81
     bluecell_Currdatastatus.CPU_Bank2_Image_BuildTime1 = Bank2data[MBIC_BOOT_CREATION_TIME + 0];
@@ -89,13 +89,13 @@ void EEPROM_M24C08_Init(void){
89 89
     bluecell_Currdatastatus.CPU_Bank2_Image_Version2 = Bank2data[MBIC_BOOT_VERSION + 1];
90 90
     bluecell_Currdatastatus.CPU_Bank2_Image_Version3 = Bank2data[MBIC_BOOT_VERSION + 2];
91 91
 
92
-    pdata = & bluecell_Currdatastatus.CPU_Bank2_Image_Name;
93
-    printf("BANK2 IMAGE NAME : ");
94
-    for(int i = 0 ; i< 32; i++){
95
-       pdata[i] = Bank2data[MBIC_BOOT_FILENAME + i];  
96
-       printf("%c",pdata[i]);
97
-    }
98
-    printf("\r\n");
92
+//    pdata = & bluecell_Currdatastatus.CPU_Bank2_Image_Name;
93
+//    printf("BANK2 IMAGE NAME : ");
94
+//    for(int i = 0 ; i< 32; i++){
95
+//       pdata[i] = Bank2data[MBIC_BOOT_FILENAME + i];  
96
+//       printf("%c",pdata[i]);
97
+//    }
98
+//    printf("\r\n");
99 99
 
100 100
 
101 101
    printf("20%d Y / %d M / %d D / %d H / %d M / %d S  \r\n",
@@ -107,6 +107,7 @@ void EEPROM_M24C08_Init(void){
107 107
    Currdata[MBIC_BOOT_CREATION_TIME + 5]        
108 108
 );
109 109
 
110
+#if 0 // PYJ.2020.06.29_BEGIN -- 
110 111
     if(Currdata[MBIC_BOOT_VERSION + 0] == Bank1data[MBIC_BOOT_VERSION + 0]
111 112
      &&Currdata[MBIC_BOOT_VERSION + 1] == Bank1data[MBIC_BOOT_VERSION + 1]
112 113
      &&Currdata[MBIC_BOOT_VERSION + 2] == Bank1data[MBIC_BOOT_VERSION + 2]){
@@ -119,11 +120,12 @@ void EEPROM_M24C08_Init(void){
119 120
     }else{
120 121
       ret = 0;
121 122
     }
123
+#endif // PYJ.2020.06.29_END -- 
122 124
 
123 125
     bluecell_Currdatastatus.CPU_Current_Bank = ret;
124 126
     printf("MBIC BANK %d Booting \r\n",bluecell_Currdatastatus.CPU_Current_Bank);    
125 127
     printf("bluecell_Currdatastatus.CPU_Bank_Select : %d \r\n",bluecell_Currdatastatus.CPU_Bank_Select);
126
-
128
+    
127 129
     if(bluecell_Currdatastatus.CPU_Bank_Select == HFR_BANK2_SEL)
128 130
     {
129 131
        ret = HFR_BANK2_SEL;
@@ -187,6 +189,7 @@ void EEPROM_M24C08_Init(void){
187 189
         }
188 190
         crcret = crc32(&Bank2data[MBIC_BOOT_DATA], CrcLength);
189 191
     }
192
+#if 1 // PYJ.2020.06.29_BEGIN -- 
190 193
     printf("CRC LENGTH : %d,CRC LENGTH : %X \r\n",CrcLength,CrcLength);
191 194
     if(crcret != FileCrc){
192 195
         printf("CRC ERROR : %x , File CRC : %x \r\n",crcret,FileCrc);
@@ -194,8 +197,34 @@ void EEPROM_M24C08_Init(void){
194 197
     }
195 198
     else
196 199
         printf("CRC SUCCESS  : %x , File CRC : %x \r\n",crcret,FileCrc);      
200
+#endif // PYJ.2020.06.29_END -- 
201
+#if 0 // PYJ.2020.06.30_BEGIN -- 
202
+        uint32_t  CurrApiAddress = 0,Bank1Address=0,Bank2Address = 0;
203
+        int32_t CrcLength = 0;
204
+        CurrApiAddress = FLASH_MBICUSER_START_ADDR;
205
+        Bank1Address = FLASH_USER_BANK1_START_ADDR;
206
+        Bank2Address = FLASH_USER_BANK2_START_ADDR;
207
+
208
+        uint8_t* Currdata = (uint8_t*)CurrApiAddress;
209
+        uint8_t* Bank1data = (uint8_t*)Bank1Address;
210
+        uint8_t* Bank2data = (uint8_t*)Bank2Address;
211
+
212
+        uint16_t crcret = 0;
213
+
214
+        CrcLength=
215
+        ((Bank1data[MBIC_BOOT_LENGTH] << 24 ) 
216
+        | Bank1data[MBIC_BOOT_LENGTH + 1]<<16 
217
+        | Bank1data[MBIC_BOOT_LENGTH + 2]<<8   
218
+        | Bank1data[MBIC_BOOT_LENGTH + 3]);    
197 219
 
220
+        if(CrcLength > 0)
221
+            crcret = CRC16_Generate(Bank1data, CrcLength + 128);
222
+        CrcLength += 128;
223
+        
224
+        printf("Bank 1 Crc ret : %x  Length : %x :  %d \r\n",crcret ,CrcLength,CrcLength);
198 225
 
226
+        if()
227
+#endif // PYJ.2020.06.30_END -- 
199 228
     
200 229
     if(bluecell_Currdatastatus.CPU_Bank_Select == HFR_BANK1_SEL && bluecell_Currdatastatus.CPU_Current_Bank != HFR_BANK1_SEL){
201 230
         printf("Write Start BANK 1 Down Start\r\n");

+ 1 - 1
Src/flash.c

@@ -17,7 +17,7 @@ fptr jump_to_app;
17 17
 uint32_t jump_addr;
18 18
 void Jump_App(void){
19 19
     __HAL_RCC_TIM6_CLK_DISABLE(); // 留ㅼ씤???占쏙옙癒몌옙?? ?占쏙옙占�??占쏙옙?占쏙옙?占쏙옙
20
-    printf("boot loader start\n");               //硫붿꽭占�? 異쒕젰
20
+    //printf("boot loader start\n");               //硫붿꽭占�? 異쒕젰
21 21
     jump_addr = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
22 22
     jump_to_app = (fptr) jump_addr;
23 23
     

+ 3 - 3
Src/main.c

@@ -166,7 +166,7 @@ int main(void)
166 166
   MX_NVIC_Init();
167 167
   /* USER CODE BEGIN 2 */
168 168
   HAL_TIM_Base_Start_IT(&htim6);
169
-  InitUartQueue(&TerminalQueue);
169
+  //InitUartQueue(&TerminalQueue);
170 170
   setbuf(stdout, NULL);
171 171
   /*printf("Uart Start \r\n");
172 172
   printf("Crc generate %x \r\n",CRC16_Generate(tempdata,11));*/
@@ -197,11 +197,11 @@ int main(void)
197 197
 //  while(1);
198 198
 #endif // PYJ.2020.06.28_END -- 
199 199
 
200
-  printf("BootLoader Start ---\r\n");
200
+  printf("BootStart ---\r\n");
201 201
   EEPROM_M24C08_Init();
202 202
 
203 203
 //  BootingBankSelect();
204
-  printf("BootLoader END\r\n");
204
+  printf("Boot END\r\n");
205 205
   Jump_App();
206 206
   while(1);
207 207