]> git.gir.st - tmk_keyboard.git/blob - keyboard/infinity_chibios/MEMO.txt
e2886aa0023b2368bf9b87cb74b8a04725341e8e
[tmk_keyboard.git] / keyboard / infinity_chibios / MEMO.txt
1 flabbergast's TMK/ChibiOS port
2 ==============================
3 2015/10/16
4
5
6 Build
7 -----
8 $ git clone -b chibios https://github.com/flabbergast/tmk_keyboard.git
9
10 $ cd tmk_keyboard
11 $ git submodule add -f -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios
12 or
13 $ cd tmk_keyboard/tmk_core/tool/chibios
14 $ git clone -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios
15
16 $ cd tmk_keyboard/keyboard/infinity_chibios
17 $ make
18
19
20
21
22 Chibios Configuration
23 ---------------------
24 halconf.h: for HAL configuration
25 placed in project directory
26 read in chibios/os/hal/hal.mk
27 included in chibios/os/hal/include/hal.h
28 mcuconf.h: for MCU configuration
29 placed in project directory
30 included in halconf.h
31
32
33 Chibios Term
34 ------------
35 PAL = Port Abstraction Layer
36 palWritePad
37 palReadPad
38 palSetPad
39 chibios/os/hal/include/pal.h
40
41 LLD = Low Level Driver
42
43
44 Makefile
45 --------
46 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
47 MCU_FAMILY = KINETIS
48 MCU_SERIES = KL2x
49
50 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
51 # or <this_dir>/ld/
52 MCU_LDSCRIPT = MKL26Z64
53
54 # - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
55 MCU_STARTUP = kl2x
56
57 # Board: it should exist either in <chibios>/os/hal/boards/
58 # or <this_dir>/boards
59 BOARD = PJRC_TEENSY_LC
60
61 MCU = cortex-m0
62
63 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
64 ARMV = 6
65
66
67 halconf.h
68 ---------
69
70
71 mcuconf.h
72 ---------
73
74
75 chconf.h
76 --------
77
78
79 ld script
80 ---------
81 --- ../../tmk_core/tool/chibios/chibios/os/common/ports/ARMCMx/compilers/GCC/ld/MKL26Z64.ld 2015-10-15 09:08:58.732904304 +0900
82 +++ ld/MKL26Z64.ld 2015-10-15 08:48:06.430215496 +0900
83 @@ -27,7 +27,8 @@
84 {
85 flash0 : org = 0x00000000, len = 0xc0
86 flashcfg : org = 0x00000400, len = 0x10
87 - flash : org = 0x00000410, len = 64k - 0x410
88 + flash : org = 0x00000410, len = 62k - 0x410
89 + eeprom_emu : org = 0x0000F800, len = 2k
90 ram : org = 0x1FFFF800, len = 8k
91 }
92
93 @@ -35,6 +36,10 @@
94 __ram_size__ = LENGTH(ram);
95 __ram_end__ = __ram_start__ + __ram_size__;
96
97 +__eeprom_workarea_start__ = ORIGIN(eeprom_emu);
98 +__eeprom_workarea_size__ = LENGTH(eeprom_emu);
99 +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__;
100 +
101 SECTIONS
102 {
103 . = 0;
104
105
106
107 Configuration/Startup for Infinity 60%
108 --------------------------------------
109 Configuration:
110
111
112 Clock:
113 Inifinity
114 FEI(FLL Engaged Internal) mode with core clock:48MHz, bus clock:48MHz, flash clock:24MHz
115 Clock dividor:
116 SIM_CLKDIV1[OUTDIV1] = 0 divide-by-1 for core clock
117 SIM_CLKDIV1[OUTDIV2] = 0 divide-by-1 for bus clock
118 SIM_CLKDIV1[OUTDIV4] = 1 divide-by-2 for flash clock
119 Internal reference clock:
120 MCG_C1[IREFS] = 1 Internal Reference Select for clock source for FLL
121 MCG_C1[IRCLKEN] = 1 Internal Reference Clock Enable
122 FLL multipilication:
123 MCG_C4[DMX32] = 1
124 MCG_C4[DRST_DRS] = 01 FLL factor 1464 * 32.768kHz = 48MHz
125
126 chibios/os/hal/ports/KINETIS/K20x/hal_lld.c
127 k20x_clock_init(): called in __early_init() defined in board.c
128 disable watchdog and configure clock
129
130 configurable macros:
131 KINETIS_NO_INIT: whether init or not
132 KINETIS_MCG_MODE: clock mode
133 KINETIS_MCG_MODE_FEI
134 KINETIS_MCG_MODE_PEE
135 hal/ports/KINETIS/K20x/hal_lld.h
136
137
138 chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.h
139 PALConfig pal_default_config
140 boardInit()
141 __early_init()
142 macro definitions for board infos, freq and mcu type
143
144 chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.c
145
146 USB
147
148
149 Startup
150 -------
151 common/ports/ARMCMx/GCC/crt0_v[67]m.s
152 Reset_Handler: startup code
153 common/ports/ARMCMx/GCC/crt1.c
154 __core_init(): weak
155 __early_init(): weak
156 __late_init(): weak
157 __default_exit(): weak
158 called from Reset_Handler of crt0
159 common/ports/ARMCMx/GCC/vector.c
160 common/ports/ARMCMx/GCC/ld/*.ld
161
162 chibios/os/common/ports/ARMCMx/compilers/GCC/
163 ├── crt0_v6m.s
164 ├── crt0_v7m.s
165 ├── crt1.c
166 ├── ld
167 │   ├── MK20DX128BLDR3.ld
168 │   ├── MK20DX128BLDR4.ld
169 │   ├── MK20DX128.ld
170 │   ├── MK20DX256.ld
171 │   ├── MKL25Z128.ld
172 │   ├── MKL26Z128.ld
173 │   ├── MKL26Z64.ld
174 │   └── STM32L476xG.ld
175 ├── mk
176 │   ├── startup_k20x5.mk
177 │   ├── startup_k20x7.mk
178 │   ├── startup_k20x.mk
179 │   ├── startup_kl2x.mk
180 │   └── startup_stm32l4xx.mk
181 ├── rules.ld
182 ├── rules.mk
183 └── vectors.c
184
185 chibios/os/hal/
186 ├── boards
187 │   ├── FREESCALE_FREEDOM_K20D50M
188 │   │   ├── board.c
189 │   │   ├── board.h
190 │   │   └── board.mk
191 │   ├── MCHCK_K20
192 │   │   ├── board.c
193 │   │   ├── board.h
194 │   │   └── board.mk
195 │   ├── PJRC_TEENSY_3
196 │   │   ├── board.c
197 │   │   ├── board.h
198 │   │   └── board.mk
199 │   ├── PJRC_TEENSY_3_1
200 │   │   ├── board.c
201 │   │   ├── board.h
202 │   │   └── board.mk
203 │   ├── PJRC_TEENSY_LC
204 │   │   ├── board.c
205 │   │   ├── board.h
206 │   │   └── board.mk
207 │   ├── readme.txt
208 │   ├── simulator
209 │   │   ├── board.c
210 │   │   ├── board.h
211 │   │   └── board.mk
212 │   ├── ST_NUCLEO_F030R8
213 │   │   ├── board.c
214 │   │   ├── board.h
215 │   │   ├── board.mk
216 │   │   └── cfg
217 │   │   └── board.chcfg
218 ├── hal.mk
219 ├── include
220 │   ├── adc.h
221 │   ├── can.h
222 │   ├── dac.h
223 │   ├── ext.h
224 │   ├── gpt.h
225 │   ├── hal_channels.h
226 │   ├── hal_files.h
227 │   ├── hal.h
228 │   ├── hal_ioblock.h
229 │   ├── hal_mmcsd.h
230 │   ├── hal_queues.h
231 │   ├── hal_streams.h
232 │   ├── i2c.h
233 │   ├── i2s.h
234 │   ├── icu.h
235 │   ├── mac.h
236 │   ├── mii.h
237 │   ├── mmc_spi.h
238 │   ├── pal.h
239 │   ├── pwm.h
240 │   ├── rtc.h
241 │   ├── sdc.h
242 │   ├── serial.h
243 │   ├── serial_usb.h
244 │   ├── spi.h
245 │   ├── st.h
246 │   ├── uart.h
247 │   └── usb.h
248 ├── lib
249 │   └── streams
250 │   ├── chprintf.c
251 │   ├── chprintf.h
252 │   ├── memstreams.c
253 │   ├── memstreams.h
254 │   ├── nullstreams.c
255 │   └── nullstreams.h
256 ├── osal
257 │   ├── nil
258 │   │   ├── osal.c
259 │   │   ├── osal.h
260 │   │   └── osal.mk
261 │   ├── os-less
262 │   │   └── ARMCMx
263 │   │   ├── osal.c
264 │   │   ├── osal.h
265 │   │   └── osal.mk
266 │   └── rt
267 │   ├── osal.c
268 │   ├── osal.h
269 │   └── osal.mk
270 ├── ports
271 │   ├── AVR
272 │   ├── common
273 │   │   └── ARMCMx
274 │   │   ├── mpu.h
275 │   │   ├── nvic.c
276 │   │   └── nvic.h
277 │   ├── KINETIS
278 │   │   ├── K20x
279 │   │   │   ├── hal_lld.c
280 │   │   │   ├── hal_lld.h
281 │   │   │   ├── kinetis_registry.h
282 │   │   │   ├── platform.dox
283 │   │   │   ├── platform.mk
284 │   │   │   ├── pwm_lld.c
285 │   │   │   ├── pwm_lld.h
286 │   │   │   ├── spi_lld.c
287 │   │   │   └── spi_lld.h
288 │   │   ├── KL2x
289 │   │   │   ├── hal_lld.c
290 │   │   │   ├── hal_lld.h
291 │   │   │   ├── kinetis_registry.h
292 │   │   │   ├── platform.mk
293 │   │   │   ├── pwm_lld.c
294 │   │   │   └── pwm_lld.h
295 │   │   ├── LLD
296 │   │   │   ├── adc_lld.c
297 │   │   │   ├── adc_lld.h
298 │   │   │   ├── ext_lld.c
299 │   │   │   ├── ext_lld.h
300 │   │   │   ├── gpt_lld.c
301 │   │   │   ├── gpt_lld.h
302 │   │   │   ├── i2c_lld.c
303 │   │   │   ├── i2c_lld.h
304 │   │   │   ├── pal_lld.c
305 │   │   │   ├── pal_lld.h
306 │   │   │   ├── serial_lld.c
307 │   │   │   ├── serial_lld.h
308 │   │   │   ├── st_lld.c
309 │   │   │   ├── st_lld.h
310 │   │   │   ├── usb_lld.c
311 │   │   │   └── usb_lld.h
312 │   │   └── README.md
313 │   ├── LPC
314 │   ├── simulator
315 │   └── STM32
316 ├── src
317 │   ├── adc.c
318 │   ├── can.c
319 │   ├── dac.c
320 │   ├── ext.c
321 │   ├── gpt.c
322 │   ├── hal.c
323 │   ├── hal_mmcsd.c
324 │   ├── hal_queues.c
325 │   ├── i2c.c
326 │   ├── i2s.c
327 │   ├── icu.c
328 │   ├── mac.c
329 │   ├── mmc_spi.c
330 │   ├── pal.c
331 │   ├── pwm.c
332 │   ├── rtc.c
333 │   ├── sdc.c
334 │   ├── serial.c
335 │   ├── serial_usb.c
336 │   ├── spi.c
337 │   ├── st.c
338 │   ├── uart.c
339 │   └── usb.c
340 └── templates
341 ├── adc_lld.c
342 ├── adc_lld.h
343 ├── can_lld.c
344 ├── can_lld.h
345 ├── dac_lld.c
346 ├── dac_lld.h
347 ├── ext_lld.c
348 ├── ext_lld.h
349 ├── gpt_lld.c
350 ├── gpt_lld.h
351 ├── halconf.h
352 ├── hal_lld.c
353 ├── hal_lld.h
354 ├── i2c_lld.c
355 ├── i2c_lld.h
356 ├── i2s_lld.c
357 ├── i2s_lld.h
358 ├── icu_lld.c
359 ├── icu_lld.h
360 ├── mac_lld.c
361 ├── mac_lld.h
362 ├── mcuconf.h
363 ├── osal
364 │   ├── osal.c
365 │   ├── osal.h
366 │   └── osal.mk
367 ├── pal_lld.c
368 ├── pal_lld.h
369 ├── platform.mk
370 ├── pwm_lld.c
371 ├── pwm_lld.h
372 ├── rtc_lld.c
373 ├── rtc_lld.h
374 ├── sdc_lld.c
375 ├── sdc_lld.h
376 ├── serial_lld.c
377 ├── serial_lld.h
378 ├── spi_lld.c
379 ├── spi_lld.h
380 ├── st_lld.c
381 ├── st_lld.h
382 ├── uart_lld.c
383 ├── uart_lld.h
384 ├── usb_lld.c
385 └── usb_lld.h
Imprint / Impressum