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