Hallo,
ich habe eine Stm32F0-Applikation mit Bootloader, eigentlich
"in-application programming (IAP)".
D.h. der Bootloader steht ab 0x8000000, wird bei einem Reset
angesprungen und lauscht 50ms lang nach SPI-Kommandos, die ihm
möglicherweise eine neue Firmware (ab 0x8004000) aufspielen würden, und
springt anderfalls zur Applikation bei 0x8004000.
Jetzt würde ich gerne den Bootloader erweitern, dass er jedesmal einen
CRC-Check macht, bevor er die Applikation anspringt.
(Beim Programmieren einer neuen Applikation macht er sowieso einen
CRC-Check, dass ist im Kommunikations-Protokoll enthalten)
Dazu müsste die CRC16 an einem festen Platz stehen im Image stehen.
3 Bytes, 2 Byte für CRC16, 1 Byte für die Länge des Image in
1024Byte-Sektoren.
Wenn ich mir die ersten 2x48 Bytes anschaue (Vektoren-Tabelle), da gibt
es etliche Stellen, wo die 3 Bytes problemlos unterbringen könnte.
D.h. die Stellen mit 0, oder Vektoren, die ich garantiert niemals
benutzen würde.
Was denkt ihr dazu?
1 | .word _estack
|
2 | .word Reset_Handler
|
3 | .word NMI_Handler
|
4 | .word HardFault_Handler
|
5 | .word 0
|
6 | .word 0
|
7 | .word 0
|
8 | .word 0
|
9 | .word 0
|
10 | .word 0
|
11 | .word 0
|
12 | .word SVC_Handler
|
13 | .word 0
|
14 | .word 0
|
15 | .word PendSV_Handler
|
16 | .word SysTick_Handler
|
17 | .word WWDG_IRQHandler
|
18 | .word PVD_IRQHandler
|
19 | .word RTC_IRQHandler
|
20 | .word FLASH_IRQHandler
|
21 | .word RCC_IRQHandler
|
22 | .word EXTI0_1_IRQHandler
|
23 | .word EXTI2_3_IRQHandler
|
24 | .word EXTI4_15_IRQHandler
|
25 | .word TS_IRQHandler
|
26 | .word DMA1_Channel1_IRQHandler
|
27 | .word DMA1_Channel2_3_IRQHandler
|
28 | .word DMA1_Channel4_5_IRQHandler
|
29 | .word ADC1_COMP_IRQHandler
|
30 | .word TIM1_BRK_UP_TRG_COM_IRQHandler
|
31 | .word TIM1_CC_IRQHandler
|
32 | .word TIM2_IRQHandler
|
33 | .word TIM3_IRQHandler
|
34 | .word TIM6_DAC_IRQHandler
|
35 | .word 0
|
36 | .word TIM14_IRQHandler
|
37 | .word TIM15_IRQHandler
|
38 | .word TIM16_IRQHandler
|
39 | .word TIM17_IRQHandler
|
40 | .word I2C1_IRQHandler
|
41 | .word I2C2_IRQHandler
|
42 | .word SPI1_IRQHandler
|
43 | .word SPI2_IRQHandler
|
44 | .word USART1_IRQHandler
|
45 | .word USART2_IRQHandler
|
46 | .word 0
|
47 | .word CEC_IRQHandler
|
48 | .word 0
|
49 | .word BootRAM /* @0x108. This is for boot in RAM mode for
|
50 | STM32F0xx devices. */
|