Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MEMO.txt 11KB

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