summaryrefslogtreecommitdiff
path: root/tmk_core/common/avr/bootloader.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/avr/bootloader.c')
-rw-r--r--tmk_core/common/avr/bootloader.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/tmk_core/common/avr/bootloader.c b/tmk_core/common/avr/bootloader.c
index ee150817c3..d89c8d768d 100644
--- a/tmk_core/common/avr/bootloader.c
+++ b/tmk_core/common/avr/bootloader.c
@@ -13,12 +13,11 @@
13#endif 13#endif
14 14
15 15
16/* Bootloader Size in *bytes* 16/** \brief Bootloader Size in *bytes*
17 * 17 *
18 * AVR Boot section size are defined by setting BOOTSZ fuse in fact. Consult with your MCU datasheet. 18 * AVR Boot section size are defined by setting BOOTSZ fuse in fact. Consult with your MCU datasheet.
19 * Note that 'Word'(2 bytes) size and address are used in datasheet while TMK uses 'Byte'. 19 * Note that 'Word'(2 bytes) size and address are used in datasheet while TMK uses 'Byte'.
20 * 20 *
21 *
22 * Size of Bootloaders in bytes: 21 * Size of Bootloaders in bytes:
23 * Atmel DFU loader(ATmega32U4) 4096 22 * Atmel DFU loader(ATmega32U4) 4096
24 * Atmel DFU loader(AT90USB128) 8192 23 * Atmel DFU loader(AT90USB128) 8192
@@ -28,10 +27,8 @@
28 * Teensy halfKay(ATmega32U4) 512 27 * Teensy halfKay(ATmega32U4) 512
29 * Teensy++ halfKay(AT90USB128) 1024 28 * Teensy++ halfKay(AT90USB128) 1024
30 * 29 *
31 *
32 * AVR Boot section is located at the end of Flash memory like the followings. 30 * AVR Boot section is located at the end of Flash memory like the followings.
33 * 31 *
34 *
35 * byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB128) 32 * byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB128)
36 * 0x0000 +---------------+ 0x00000 +---------------+ 33 * 0x0000 +---------------+ 0x00000 +---------------+
37 * | | | | 34 * | | | |
@@ -57,7 +54,6 @@
57 * | Bootloader | 512B | Bootloader | 1KB 54 * | Bootloader | 512B | Bootloader | 1KB
58 * 0x7FFF +---------------+ 0x1FFFF +---------------+ 55 * 0x7FFF +---------------+ 0x1FFFF +---------------+
59 */ 56 */
60
61#define FLASH_SIZE (FLASHEND + 1L) 57#define FLASH_SIZE (FLASHEND + 1L)
62 58
63#if !defined(BOOTLOADER_SIZE) 59#if !defined(BOOTLOADER_SIZE)
@@ -69,14 +65,17 @@
69#define BOOT_SIZE_1024 0b010 65#define BOOT_SIZE_1024 0b010
70#define BOOT_SIZE_2048 0b000 66#define BOOT_SIZE_2048 0b000
71 67
72/* 68/** \brief Entering the Bootloader via Software
73 * Entering the Bootloader via Software 69 *
74 * http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__software_bootloader_start.html 70 * http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__software_bootloader_start.html
75 */ 71 */
76#define BOOTLOADER_RESET_KEY 0xB007B007 72#define BOOTLOADER_RESET_KEY 0xB007B007
77uint32_t reset_key __attribute__ ((section (".noinit"))); 73uint32_t reset_key __attribute__ ((section (".noinit")));
78 74
79/* initialize MCU status by watchdog reset */ 75/** \brief initialize MCU status by watchdog reset
76 *
77 * FIXME: needs doc
78 */
80void bootloader_jump(void) { 79void bootloader_jump(void) {
81 80
82 #if !defined(BOOTLOADER_SIZE) 81 #if !defined(BOOTLOADER_SIZE)