]> git.gir.st - tmk_keyboard.git/blob - keyboard/infinity/MEMO.txt
infinity: Move project specific files to local
[tmk_keyboard.git] / keyboard / infinity / MEMO.txt
1 mbed patch for Infinity
2 -----------------------
3 Without ld script patch vector table it doesn't place vector table in binary file.
4 And clock setting is changed as Infinity uses internal oscillator instead of exteranl crystal.
5
6 diff --git a/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K20D50M/TOOLCHAIN_GCC_ARM/MK20D5.ld b/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K20D50M/TOOLCHAIN_GCC_ARM/MK20D5.ld
7 index 600751c..55c3393 100644
8 --- a/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K20D50M/TOOLCHAIN_GCC_ARM/MK20D5.ld
9 +++ b/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K20D50M/TOOLCHAIN_GCC_ARM/MK20D5.ld
10 @@ -43,7 +43,7 @@ SECTIONS
11 .isr_vector :
12 {
13 __vector_table = .;
14 - KEEP(*(.vector_table))
15 + KEEP(*(.isr_vector))
16 *(.text.Reset_Handler)
17 *(.text.System_Init)
18 . = ALIGN(4);
19 diff --git a/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K20D50M/system_MK20D5.c b/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K20D50M/system_MK20D5.c
20 index 393d1f0..b78b71a 100644
21 --- a/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K20D50M/system_MK20D5.c
22 +++ b/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_K20D50M/system_MK20D5.c
23 @@ -44,7 +44,7 @@
24
25 #define DISABLE_WDOG 1
26
27 -#define CLOCK_SETUP 1
28 +#define CLOCK_SETUP 0
29 /* Predefined clock setups
30 0 ... Multipurpose Clock Generator (MCG) in FLL Engaged Internal (FEI) mode
31 Reference clock source for MCG module is the slow internal clock source 32.768kHz
32
33
34
35 CMSIS/mbed HAL
36 ==============
37 http://developer.mbed.org/users/MACRUM/notebook/mbed-library-internals/
38
39 api/ mbed API
40 ├── AnalogIn.h
41 ├── AnalogOut.h
42 ├── BusIn.h
43 ├── BusInOut.h
44 ├── BusOut.h
45 ├── CallChain.h
46 ├── CAN.h
47 ├── can_helper.h
48 ├── DigitalIn.h
49 ├── DigitalInOut.h
50 ├── DigitalOut.h
51 ├── DirHandle.h
52 ├── Ethernet.h
53 ├── FileBase.h
54 ├── FileHandle.h
55 ├── FileLike.h
56 ├── FilePath.h
57 ├── FileSystemLike.h
58 ├── FunctionPointer.h
59 ├── I2C.h
60 ├── I2CSlave.h
61 ├── InterruptIn.h
62 ├── InterruptManager.h
63 ├── LocalFileSystem.h
64 ├── mbed_assert.h
65 ├── mbed_debug.h
66 ├── mbed_error.h
67 ├── mbed.h
68 ├── mbed_interface.h
69 ├── platform.h
70 ├── PortIn.h
71 ├── PortInOut.h
72 ├── PortOut.h
73 ├── PwmOut.h
74 ├── RawSerial.h
75 ├── rtc_time.h
76 ├── semihost_api.h
77 ├── SerialBase.h
78 ├── Serial.h
79 ├── SPI.h
80 ├── SPISlave.h
81 ├── Stream.h
82 ├── Ticker.h
83 ├── Timeout.h
84 ├── TimerEvent.h
85 ├── Timer.h
86 ├── toolchain.h
87 └── wait_api.h
88
89 common/ mbed API implementation
90
91 hal/ mbed HAL implementation interface
92 ├── analogin_api.h
93 ├── analogout_api.h
94 ├── can_api.h
95 ├── ethernet_api.h
96 ├── gpio_api.h
97 ├── gpio_irq_api.h
98 ├── i2c_api.h
99 ├── pinmap.h
100 ├── port_api.h
101 ├── pwmout_api.h
102 ├── rtc_api.h
103 ├── serial_api.h
104 ├── sleep_api.h
105 ├── spi_api.h
106 └── us_ticker_api.h
107
108 targets/hal/TARGET_<vendor>/TARGET_<board>/
109 mbed HAL implementation
110
111 targets/cmsis/ CMSIS interface
112 core_caInstr.h
113 core_ca9.h
114 core_cmFunc.h
115 core_caFunc.h
116 core_cmInstr.h
117 core_cm4_simd.h
118 core_ca_mmu.h
119 core_cm0.h
120 core_cm0plus.h
121 core_cm3.h
122 core_cm4.h
123
124 targets/cmsis/TARGET_<vendor>/TARGET_<chip>/
125 <chip>.h
126 system_<chip>.[ch]
127 cmsis.h 
128 cmsis_nvic.[ch]
129
130 targets/cmsis/TARGET_<vendor>/TARGET_<chip>/TOOLSCHAIN_<tool>/
131 startup_<chip>.s
132 linker-script
133
134
135
136 Infinity
137 ========
138 Massdrop Infinity Keyboard:
139 https://www.massdrop.com/buy/infinity-keyboard-kit
140
141 Freescale MK20DX128VLF5 48-QFP:
142 http://cache.freescale.com/files/32bit/doc/data_sheet/K20P48M50SF0.pdf
143
144 kiibohd controller(MD1):
145 https://github.com/kiibohd/controller
146
147 DFU bootloader:
148 https://github.com/kiibohd/controller/tree/master/Bootloader
149
150 Program with bootloader:
151 $ dfu-util -D kiibohd.dfu.bin
152
153 Pinout:
154 https://github.com/kiibohd/controller/blob/master/Scan/MD1/pinout
155
156
157
158 Pin Usage
159 =========
160
161 mk20dx128vlf5
162
163 ----
164 |Keys|
165 ----
166
167 * Strobe (Columns)
168
169 PTB0
170 PTB1
171 PTB2
172 PTB3
173 PTB16
174 PTB17
175 PTC4
176 PTC5
177 PTD0
178
179
180 * Sense (Rows)
181
182 PTD1
183 PTD2
184 PTD3
185 PTD4
186 PTD5
187 PTD6
188 PTD7
189
190
191 -----
192 |Debug|
193 -----
194
195 * SWD
196
197 PTA0 (Pull-down)
198 PTA3 (Pull-up)
199
200 * LEDs
201
202 PTA19 (LED only for PCB, not McHCK) (XTAL)
203
204 * UARTs
205
206 PTA1 - RX0
207 PTA2 - TX0
208
209
210 ------
211 |Unused|
212 ------
213
214 * GPIO
215
216 PTA1 (Not broken out on PCB, available on McHCK) (Pull-up)
217 PTA2 (")
218 PTA4 (Pull-up)
219 PTA18 (EXTAL)
220
221 PTC0
222 PTC1
223 PTC2
224 PTC3
225 PTC6
226 PTC7
227
228 * Analog
229
230 ADC0_DP0
231 ADC0_DM0
232
233
234
235 Freescale kinetis MK20DX128
236 ===========================
237 If FSEC of flash config at 0x400-40F is changed accidentally SWD/JTAG debug access will be lost and very difficult to get back.
238 For example, high level adapter like stlink cannot work to get access back after FSEC is changed. To regain the chip to be programmable low level DAP inteface like JTAG, CMSIS-DAP or OpenSAD.
239
240
241 Memory map
242 ==========
243 kiibohd bootloader: Lib/mk20dx128vlf5.bootloader.ld
244 0x0000_0000 +-------------------+ -----------------+---------------+
245 | .vectors | ---------. | StackPointer0 |
246 | .startup | \ | ResetHandler1 |
247 | .rodata | \ | ... |
248 0x0000_0400 | .flashconfig | 0x10 \ | ... |
249 | .text | \ | ... 61 | 0xF7
250 | .init | `--+---------------+ 0xF8
251 0x0000_1000 +-------------------+ 4KB
252 | _app_rom |
253 ~ ~
254 ~ ~
255 | |
256 0x07FF_FFFF +-------------------+ 128KB
257
258
259 0x1FFF_E000 +-------------------+
260 | |
261 | RAM |
262 | 8KB|
263 0x2000_0000 +-------------------+
264 | |
265 | RAM |
266 | 8KB|
267 0x2000_2000 +-------------------+ _estack
268
269
270
271
272
273 OpenOCD
274 ========
275 Synopsis of SWD, JTAG and SWJ-DP transport:
276 https://fedcsis.org/proceedings/2012/pliks/279.pdf
277
278 OpenSDA Freescale: Mass storage bootloader & serial port; part of CMSIS-DAP?
279 http://cache.freescale.com/files/32bit/doc/user_guide/OPENSDAUG.pdf
280
281
282 interface_list:
283 1: ftdi
284 2: usb_blaster
285 3: usbprog
286 4: jlink
287 5: vsllink
288 6: rlink
289 7: ulink
290 8: arm-jtag-ew
291 9: hla
292 10: osbdm
293 11: opendous
294 12: aice
295 13: cmsis-dap
296
297 transport list:
298 stlink_swim
299 hla_jtag
300 hla_swd
301 aice_jtag
302 swd
303 cmsis-dap
304 jtag
305
306 target types:
307 arm7tdmi
308 arm9tdmi
309 arm920t
310 arm720t
311 arm966e
312 arm946e
313 arm926ejs
314 fa526
315 feroceon
316 dragonite
317 xscale
318 cortex_m
319 cortex_a
320 cortex_r4
321 arm11
322 mips_m4k
323 avr
324 dsp563xx
325 dsp5680xx
326 testee
327 avr32_ap7k
328 hla_target
329 nds32_v2
330 nds32_v3
331 nds32_v3m
332 or1k
333 quark_x10xx
334
335
336 TAP
337 ---
338 http://openocd.sourceforge.net/doc/html/TAP-Declaration.html#TAP-Declaration
339 jtag newtap chipname tapname configparams...
340 hla newtap chipname tapname configparams...
341 swd newtap chipname tapname configparams...
342 cmsis-dap newtap chipname tapname configparams...
343
344 The tapname reflects the role of that TAP, and should follow this convention:
345 bs – For boundary scan if this is a separate TAP;
346 cpu – The main CPU of the chip, alternatively arm and dsp on chips with both ARM and DSP CPUs, arm1 and arm2 on chips with two ARMs, and so forth;
347 etb – For an embedded trace buffer (example: an ARM ETB11);
348 flash – If the chip has a flash TAP, like the str912;
349 jrc – For JTAG route controller (example: the ICEPick modules on many Texas Instruments chips, like the OMAP3530 on Beagleboards);
350 tap – Should be used only for FPGA- or CPLD-like devices with a single TAP;
351 unknownN – If you have no idea what the TAP is for (N is a number);
352 when in doubt – Use the chip maker's name in their data sheet. For example, the Freescale i.MX31 has a SDMA (Smart DMA) with a JTAG TAP; that TAP should be named sdma.
353
354 -irlen NUMBER
355 The length in bits of the instruction register, such as 4 or 5 bits.
356
357 Target
358 ------
359 http://openocd.sourceforge.net/doc/html/CPU-Configuration.html#CPU-Configuration
360
361 target create target_name type configparams...
362 $target_name configure configparams...
363
364 -chain-position dotted.name – names the TAP used to access this target.
365 -endian (big|little) – specifies whether the CPU uses big or little endian conventions
366 -event event_name event_body – See Target Events. Note that this updates a list of named event handlers. Calling this twice with two different event names assigns two different handlers, but calling it twice with the same event name assigns only one handler.
367 -work-area-backup (0|1) – says whether the work area gets backed up; by default, it is not backed up. When possible, use a working_area that doesn't need to be backed up, since performing a backup slows down operations. For example, the beginning of an SRAM block is likely to be used by most build systems, but the end is often unused.
368 -work-area-size size – specify work are size, in bytes. The same size applies regardless of whether its physical or virtual address is being used.
369 -work-area-phys address – set the work area base address to be used when no MMU is active.
370 -work-area-virt address – set the work area base address to be used when an MMU is active. Do not specify a value for this except on targets with an MMU. The value should normally correspond to a static mapping for the -work-area-phys address, set up by the current operating system.
371 -rtos rtos_type – enable rtos support for target, rtos_type can be one of auto|eCos|ThreadX| FreeRTOS|linux|ChibiOS|embKernel See RTOS Support.
372
373 Flash
374 -----
375 http://openocd.sourceforge.net/doc/html/Flash-Commands.html#norconfiguration
376
377 flash bank name driver base size chip_width bus_width target [driver_options]
378
379 name ... may be used to reference the flash bank in other flash commands. A number is also available.
380 driver ... identifies the controller driver associated with the flash bank being declared. This is usually cfi for external flash, or else the name of a microcontroller with embedded flash memory. See Flash Driver List.
381 base ... Base address of the flash chip.
382 size ... Size of the chip, in bytes. For some drivers, this value is detected from the hardware.
383 chip_width ... Width of the flash chip, in bytes; ignored for most microcontroller drivers.
384 bus_width ... Width of the data bus used to access the chip, in bytes; ignored for most microcontroller drivers.
385 target ... Names the target used to issue commands to the flash controller.
386 driver_options ... drivers may support, or require, additional parameters. See the driver-specific documentation for more information.
387
388 flash write_image [erase] [unlock] filename [offset] [type]
389
390
391 Memory Access
392 -------------
393 http://openocd.sourceforge.net/doc/html/General-Commands.html#imageaccess
394 {mdw,mdh,mdb} addr [count]
395 dump {word, half-word, byte} data
396 {mww,mwh,mwb} addr data
397 write data
398
Imprint / Impressum