-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
platformio.ini
165 lines (132 loc) · 3.49 KB
/
platformio.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
;default_envs = ATmega1284P
[env]
platform = atmelavr
framework = arduino
build_flags =
-Os ; optimize for size
-funsigned-char
-funsigned-bitfields
-fpack-struct
-fshort-enums
-fno-exceptions
-fno-jump-tables
-mrelax
-Wl,--relax
-Wl,--cref
-Wl,-Map=$BUILD_DIR/firmware.map
board_build.f_cpu = 16000000L
upload_protocol = stk500v1
upload_flags =
-P$UPLOAD_PORT
-b$UPLOAD_SPEED
-e
upload_port = COM5
upload_speed = 19200
[env:ATmega32]
board = ATmega32
build_flags =
${env.build_flags}
-Wl,--section-start=.text=0x7000 ; 2048 words bootloader, 0x3800 * 2
;board_fuses.lfuse = 0x3F
;board_fuses.hfuse = 0xD8
[env:ATmega32U4]
board = micro ; there is no atmega32u4 board in platformio but arduino micro should be fine
board_build.mcu = atmega32u4
build_flags =
${env.build_flags}
-Wl,--section-start=.text=0x7000 ; 2048 words bootloader, 0x3800 * 2
;board_fuses.lfuse = 0xFF
;board_fuses.hfuse = 0xD8
;board_fuses.efuse = 0xFC
[env:ATmega328P]
board = ATmega328P
build_flags =
${env.build_flags}
-Wl,--section-start=.text=0x7000 ; 2048 words bootloader, 0x3800 * 2
;board_fuses.lfuse = 0xFF
;board_fuses.hfuse = 0xD8
;board_fuses.efuse = 0xFC
[env:ATmega328PB]
board = ATmega328PB
build_flags =
${env.build_flags}
-Wl,--section-start=.text=0x7000 ; 2048 words bootloader, 0x3800 * 2
;board_fuses.lfuse = 0xFF
;board_fuses.hfuse = 0xD8
;board_fuses.efuse = 0xFC
[env:ATmega64]
board = ATmega64
build_flags =
${env.build_flags}
-Wl,--section-start=.text=0xF000 ; 2048 words bootloader, 0x7800 * 2
;board_fuses.lfuse = 0x3F
;board_fuses.hfuse = 0xDA
;board_fuses.efuse = 0xFF
[env:ATmega644P]
board = ATmega644P
build_flags =
${env.build_flags}
-Wl,--section-start=.text=0xF000 ; 2048 words bootloader, 0x7800 * 2
;board_fuses.lfuse = 0xFF
;board_fuses.hfuse = 0xDA
;board_fuses.efuse = 0xFC
[env:ATmega128]
board = ATmega128
build_flags =
${env.build_flags}
-Wl,--section-start=.text=0x01F000 ; 2048 words bootloader, 0xF800 * 2
;board_fuses.lfuse = 0x3F
;board_fuses.hfuse = 0xDA
;board_fuses.efuse = 0xFF
[env:ATmega1284P]
board = ATmega1284P
build_flags =
${env.build_flags}
-Wl,--section-start=.text=0x01F000 ; 2048 words bootloader, 0xF800 * 2
;board_fuses.lfuse = 0xFF
;board_fuses.hfuse = 0xDA
;board_fuses.efuse = 0xFC
[env:ATmega2560]
board = ATmega2560
build_flags =
${env.build_flags}
-Wl,--section-start=.text=0x03F000 ; 2048 words bootloader, 0x1F800 * 2
;board_fuses.lfuse = 0xFF
;board_fuses.hfuse = 0xDA
;board_fuses.efuse = 0xFC
; ***
; Additional environments as examples below
; ***
; ATmega328P with AVR ISP MK2
[env:ATmega328P_via_AVRISP_mkII]
board = ATmega328P
build_flags =
${env.build_flags}
-Wl,--section-start=.text=0x7000 ; 2048 words bootloader, 0x3800 * 2
board_build.f_cpu = 16000000L
board_fuses.lfuse = 0xFF
board_fuses.hfuse = 0xD8
board_fuses.efuse = 0xFC
upload_protocol = custom
upload_port = usb
upload_flags =
-C
; use "tool-avrdude-megaavr" for the atmelmegaavr platform
${platformio.packages_dir}/tool-avrdude/avrdude.conf
-p
$BOARD_MCU
-P
$UPLOAD_PORT
-c
stk500v2 ; avrispmkII
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i