@@ -7,8 +7,8 @@ English | [中文](README_zh-CN.md)
77
88This guide is written for developers who wish to start programming
99microcontrollers using a GCC compiler and a datasheet, without using any
10- framework! This guide explains the fundamentals - and it helps to
11- understand how embedded frameworks ( Cube, Keil, Arduino, etc) work.
10+ framework. This guide explains the fundamentals, and helps to understand how
11+ embedded frameworks like Cube, Keil, Arduino, and others, work.
1212
1313The guide covers the following topics: memory and registers, interrupt vector
1414table, startup code, linker script, build automation using ` make ` , GPIO
@@ -332,7 +332,7 @@ __attribute__((naked, noreturn)) void _reset(void) {
332332extern void _estack(void); // Defined in link.ld
333333
334334// 16 standard and 91 STM32-specific handlers
335- __attribute__((section(".vectors"))) void (*tab[16 + 91])(void) = {
335+ __attribute__((section(".vectors"))) void (*const tab[16 + 91])(void) = {
336336 _estack, _reset
337337};
338338```
@@ -341,10 +341,10 @@ For function `_reset()`, we have used GCC-specific attributes `naked` and
341341`noreturn` - they mean, standard function' s prologue and epilogue should not
342342be created by the compiler, and that function does not return .
343343
344- The `void (*tab[16 + 91 ])(void )` expression means: define an array of 16 + 91
345- pointers to functions, that return nothing (void ) and take to arguments. Each
346- such function is an IRQ handler (Interrupt ReQuest handler). An array of those
347- handlers is called a vector table.
344+ The `void (*const tab[16 + 91 ])(void )` expression means: define an array of 16
345+ + 91 pointers to functions, that return nothing (void ) and take to arguments.
346+ Each such function is an IRQ handler (Interrupt ReQuest handler). An array of
347+ those handlers is called a vector table.
348348
349349The vector table ` tab ` we put in a separate section called ` .vectors ` - that we
350350need later to tell the linker to put that section right at the beginning of the
@@ -893,7 +893,7 @@ updated by interrupt handlers, or by the hardware, declare as `volatile`**.
893893Now we should add ` SysTick_Handler()` interrupt handler to the vector table:
894894
895895` ` ` c
896- __attribute__(( section(".vectors")) ) void (* tab[16 + 91])(void) = {
896+ __attribute__(( section(".vectors")) ) void (* const tab[16 + 91])(void) = {
897897 0, _reset, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, SysTick_Handler};
898898` ` `
899899
@@ -1583,7 +1583,7 @@ WEAK_ALIAS void NMI_Handler(void);
15831583WEAK_ALIAS void HardFault_Handler(void);
15841584WEAK_ALIAS void MemManage_Handler(void);
15851585...
1586- __attribute__(( section(".vectors")) ) void (* tab[16 + 91])(void) = {
1586+ __attribute__(( section(".vectors")) ) void (* const tab[16 + 91])(void) = {
15871587 0, _reset, NMI_Handler, HardFault_Handler, MemManage_Handler,
15881588 ...
15891589` ` `
0 commit comments