Skip to content

Commit a7a4157

Browse files
committed
Initial commit
0 parents  commit a7a4157

File tree

1,987 files changed

+511108
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,987 files changed

+511108
-0
lines changed

AT90USB1287 DFU bootloader.pdf

187 KB
Binary file not shown.

AT90USB1287 complete.pdf

10.6 MB
Binary file not shown.

AT90USB1287.pdf

827 KB
Binary file not shown.

AT90USBKEY upgrade firmware.pdf

1.28 MB
Binary file not shown.

AT90USBKEY.pdf

487 KB
Binary file not shown.

AT90USBKEY_Pin_Diagram.pdf

4.39 MB
Binary file not shown.

README.md

Lines changed: 177 additions & 0 deletions
Large diffs are not rendered by default.

clips_leds.jpg

95.5 KB
Loading

jtag_and_uart.jpg

376 KB
Loading
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
LUFA Library
3+
Copyright (C) Dean Camera, 2017.
4+
5+
dean [at] fourwalledcubicle [dot] com
6+
www.lufa-lib.org
7+
*/
8+
9+
/*
10+
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11+
12+
Permission to use, copy, modify, distribute, and sell this
13+
software and its documentation for any purpose is hereby granted
14+
without fee, provided that the above copyright notice appear in
15+
all copies and that both that the copyright notice and this
16+
permission notice and warranty disclaimer appear in supporting
17+
documentation, and that the name of the author not be used in
18+
advertising or publicity pertaining to distribution of the
19+
software without specific, written prior permission.
20+
21+
The author disclaims all warranties with regard to this
22+
software, including all implied warranties of merchantability
23+
and fitness. In no event shall the author be liable for any
24+
special, indirect or consequential damages or any damages
25+
whatsoever resulting from loss of use, data or profits, whether
26+
in an action of contract, negligence or other tortious action,
27+
arising out of or in connection with the use or performance of
28+
this software.
29+
*/
30+
31+
/** \file
32+
*
33+
* Bootloader user application API functions.
34+
*/
35+
36+
#include "BootloaderAPI.h"
37+
38+
void BootloaderAPI_ErasePage(const uint32_t Address)
39+
{
40+
boot_page_erase_safe(Address);
41+
boot_spm_busy_wait();
42+
boot_rww_enable();
43+
}
44+
45+
void BootloaderAPI_WritePage(const uint32_t Address)
46+
{
47+
boot_page_write_safe(Address);
48+
boot_spm_busy_wait();
49+
boot_rww_enable();
50+
}
51+
52+
void BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word)
53+
{
54+
boot_page_fill_safe(Address, Word);
55+
}
56+
57+
uint8_t BootloaderAPI_ReadSignature(const uint16_t Address)
58+
{
59+
return boot_signature_byte_get(Address);
60+
}
61+
62+
uint8_t BootloaderAPI_ReadFuse(const uint16_t Address)
63+
{
64+
return boot_lock_fuse_bits_get(Address);
65+
}
66+
67+
uint8_t BootloaderAPI_ReadLock(void)
68+
{
69+
return boot_lock_fuse_bits_get(GET_LOCK_BITS);
70+
}
71+
72+
void BootloaderAPI_WriteLock(const uint8_t LockBits)
73+
{
74+
boot_lock_bits_set_safe(LockBits);
75+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
LUFA Library
3+
Copyright (C) Dean Camera, 2017.
4+
5+
dean [at] fourwalledcubicle [dot] com
6+
www.lufa-lib.org
7+
*/
8+
9+
/*
10+
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11+
12+
Permission to use, copy, modify, distribute, and sell this
13+
software and its documentation for any purpose is hereby granted
14+
without fee, provided that the above copyright notice appear in
15+
all copies and that both that the copyright notice and this
16+
permission notice and warranty disclaimer appear in supporting
17+
documentation, and that the name of the author not be used in
18+
advertising or publicity pertaining to distribution of the
19+
software without specific, written prior permission.
20+
21+
The author disclaims all warranties with regard to this
22+
software, including all implied warranties of merchantability
23+
and fitness. In no event shall the author be liable for any
24+
special, indirect or consequential damages or any damages
25+
whatsoever resulting from loss of use, data or profits, whether
26+
in an action of contract, negligence or other tortious action,
27+
arising out of or in connection with the use or performance of
28+
this software.
29+
*/
30+
31+
/** \file
32+
*
33+
* Header file for BootloaderAPI.c.
34+
*/
35+
36+
#ifndef _BOOTLOADER_API_H_
37+
#define _BOOTLOADER_API_H_
38+
39+
/* Includes: */
40+
#include <avr/io.h>
41+
#include <avr/boot.h>
42+
#include <stdbool.h>
43+
44+
#include <LUFA/Common/Common.h>
45+
46+
#include "Config/AppConfig.h"
47+
48+
/* Function Prototypes: */
49+
void BootloaderAPI_ErasePage(const uint32_t Address);
50+
void BootloaderAPI_WritePage(const uint32_t Address);
51+
void BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word);
52+
uint8_t BootloaderAPI_ReadSignature(const uint16_t Address);
53+
uint8_t BootloaderAPI_ReadFuse(const uint16_t Address);
54+
uint8_t BootloaderAPI_ReadLock(void);
55+
void BootloaderAPI_WriteLock(const uint8_t LockBits);
56+
57+
#endif
58+
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
LUFA Library
3+
Copyright (C) Dean Camera, 2017.
4+
5+
dean [at] fourwalledcubicle [dot] com
6+
www.lufa-lib.org
7+
*/
8+
9+
/*
10+
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11+
12+
Permission to use, copy, modify, distribute, and sell this
13+
software and its documentation for any purpose is hereby granted
14+
without fee, provided that the above copyright notice appear in
15+
all copies and that both that the copyright notice and this
16+
permission notice and warranty disclaimer appear in supporting
17+
documentation, and that the name of the author not be used in
18+
advertising or publicity pertaining to distribution of the
19+
software without specific, written prior permission.
20+
21+
The author disclaims all warranties with regard to this
22+
software, including all implied warranties of merchantability
23+
and fitness. In no event shall the author be liable for any
24+
special, indirect or consequential damages or any damages
25+
whatsoever resulting from loss of use, data or profits, whether
26+
in an action of contract, negligence or other tortious action,
27+
arising out of or in connection with the use or performance of
28+
this software.
29+
*/
30+
31+
; Trampolines to actual API implementations if the target address is outside the
32+
; range of a rjmp instruction (can happen with large bootloader sections)
33+
.section .apitable_trampolines, "ax"
34+
.global BootloaderAPI_Trampolines
35+
BootloaderAPI_Trampolines:
36+
37+
BootloaderAPI_ErasePage_Trampoline:
38+
jmp BootloaderAPI_ErasePage
39+
BootloaderAPI_WritePage_Trampoline:
40+
jmp BootloaderAPI_WritePage
41+
BootloaderAPI_FillWord_Trampoline:
42+
jmp BootloaderAPI_FillWord
43+
BootloaderAPI_ReadSignature_Trampoline:
44+
jmp BootloaderAPI_ReadSignature
45+
BootloaderAPI_ReadFuse_Trampoline:
46+
jmp BootloaderAPI_ReadFuse
47+
BootloaderAPI_ReadLock_Trampoline:
48+
jmp BootloaderAPI_ReadLock
49+
BootloaderAPI_WriteLock_Trampoline:
50+
jmp BootloaderAPI_WriteLock
51+
BootloaderAPI_UNUSED1:
52+
ret
53+
BootloaderAPI_UNUSED2:
54+
ret
55+
BootloaderAPI_UNUSED3:
56+
ret
57+
BootloaderAPI_UNUSED4:
58+
ret
59+
BootloaderAPI_UNUSED5:
60+
ret
61+
62+
63+
64+
; API function jump table
65+
.section .apitable_jumptable, "ax"
66+
.global BootloaderAPI_JumpTable
67+
BootloaderAPI_JumpTable:
68+
69+
rjmp BootloaderAPI_ErasePage_Trampoline
70+
rjmp BootloaderAPI_WritePage_Trampoline
71+
rjmp BootloaderAPI_FillWord_Trampoline
72+
rjmp BootloaderAPI_ReadSignature_Trampoline
73+
rjmp BootloaderAPI_ReadFuse_Trampoline
74+
rjmp BootloaderAPI_ReadLock_Trampoline
75+
rjmp BootloaderAPI_WriteLock_Trampoline
76+
rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1
77+
rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2
78+
rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3
79+
rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4
80+
rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5
81+
82+
83+
84+
; Bootloader table signatures and information
85+
.section .apitable_signatures, "ax"
86+
.global BootloaderAPI_Signatures
87+
BootloaderAPI_Signatures:
88+
89+
.long BOOT_START_ADDR ; Start address of the bootloader
90+
.word 0xDF00 ; Signature for the CDC class bootloader
91+
.word 0xDCFB ; Signature for a LUFA class bootloader

0 commit comments

Comments
 (0)