cm3.nut 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. --
  2. -- Copyright (C) 2004-2007 by egnite Software GmbH. All rights reserved.
  3. --
  4. -- Redistribution and use in source and binary forms, with or without
  5. -- modification, are permitted provided that the following conditions
  6. -- are met:
  7. --
  8. -- 1. Redistributions of source code must retain the above copyright
  9. -- notice, this list of conditions and the following disclaimer.
  10. -- 2. Redistributions in binary form must reproduce the above copyright
  11. -- notice, this list of conditions and the following disclaimer in the
  12. -- documentation and/or other materials provided with the distribution.
  13. -- 3. Neither the name of the copyright holders nor the names of
  14. -- contributors may be used to endorse or promote products derived
  15. -- from this software without specific prior written permission.
  16. --
  17. -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. -- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. -- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. -- COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. -- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. -- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. -- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. -- AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. -- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. -- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. -- SUCH DAMAGE.
  29. --
  30. -- For additional information see http://www.ethernut.de/
  31. --
  32. -- ARM CortexM3 Architecture
  33. --
  34. -- $Log$
  35. -- Revision 1.0 2010/09/10 13:24:58 ulrichprinz
  36. -- STM32F Initial Port
  37. --
  38. nutarch_cm3 =
  39. {
  40. --
  41. -- MCU Family CortexM3
  42. --
  43. {
  44. name = "nutarch_cm3_family",
  45. brief = "MCU Family",
  46. options =
  47. {
  48. {
  49. macro = "MCU_CM3",
  50. brief = "CortexM3 Family",
  51. type = "integer",
  52. default = 1,
  53. requires = { "HW_MCU_CM3" },
  54. file = "include/cfg/arch.h"
  55. }
  56. }
  57. },
  58. --
  59. -- CortexM3 Core Functions
  60. --
  61. {
  62. name = "nutarch_cm3_init",
  63. brief = "Initialization and interrupt registration(CortexM3)",
  64. description = "Contains spurious interrupt handler.",
  65. requires = { "HW_MCU_CM3" },
  66. provides = { "DEV_IRQ_CM3" },
  67. sources = { "cm3/cmsis/cortex_init.c" },
  68. options =
  69. {
  70. {
  71. macro = "NUT_BOOT_FUNCTION",
  72. brief = "Boot Function",
  73. description = "This function is given for the reset entry vecor.\n"..
  74. "Default is NutInit\n"..
  75. "The function must be declarated as int function(void).",
  76. flavor = "booldata",
  77. file = "include/cfg/arch.h"
  78. },
  79. {
  80. macro = "MSP_STACK_SIZE",
  81. brief = "Main Stack Size",
  82. description = "Number of bytes reserved for interrupt stack\n"..
  83. "Default is 128 words.\n\n"..
  84. "This stack is used in flat mode, i.e. the thread mode the CPU uses with Nut/OS.\n"..
  85. "The stack is needed for any operation and function call while Nut/OS startup.\n",
  86. flavor = "booldata",
  87. file = "include/cfg/memory.h"
  88. },
  89. {
  90. macro = "PSP_STACK_SIZE",
  91. brief = "Process Stack Size",
  92. description = "Number of bytes reserved for process stack\n"..
  93. "Default is 32 words.\n\n"..
  94. "The process stack is actually not used in Nut/OS but may be used for faster task switching "..
  95. "in a later release. So beware of modifications.",
  96. flavor = "booldata",
  97. file = "include/cfg/memory.h"
  98. }
  99. }
  100. },
  101. --
  102. -- CortexM3 SysTick Timer
  103. --
  104. {
  105. name = "nutarch_cm3_ostimer",
  106. brief = "System Timer (CortexM3)",
  107. requires = { "HW_MCU_CM3" },
  108. provides = { "NUT_OSTIMER_DEV" },
  109. sources = { "cm3/cmsis/ostimer_cortex.c" },
  110. },
  111. --
  112. -- CortexM3 Context Switching
  113. --
  114. {
  115. name = "nutarch_cm3_context",
  116. brief = "Context Switching (CortexM3)",
  117. provides = { "NUT_CONTEXT_SWITCH" },
  118. requires = { "HW_MCU_CM3", "TOOL_GCC" },
  119. sources = { "cm3/os/context.c" },
  120. },
  121. --
  122. -- CortexM3 Common IRQ Control
  123. --
  124. {
  125. name = "nutarch_cm3_irqctl",
  126. brief = "Common IRQ control for CM3",
  127. provides = { "DEV_IRQ_CM3" },
  128. requires = { "HW_MCU_CM3", "TOOL_GCC" },
  129. sources = { "cm3/os/cortex_irqctl.c" },
  130. },
  131. --
  132. -- CortexM3 Reset Controller
  133. --
  134. {
  135. name = "nutarch_cm3_reset",
  136. brief = "Cortex Reset Controller support",
  137. requires = { "HW_MCU_CM3" },
  138. sources =
  139. {
  140. "cm3/cmsis/cortex_reset.c",
  141. },
  142. },
  143. --
  144. -- CortexM4 FPU
  145. --
  146. {
  147. name = "nutarch_cm4_fpu",
  148. brief = "FPU support (CortexM4)",
  149. requires = { "HW_MCU_FPU" },
  150. options =
  151. {
  152. {
  153. macro = "MCU_USE_CORTEX_FPU",
  154. brief = "Enable FPU support",
  155. provides = { "MCU_USE_CORTEX_FPU" },
  156. flavor = "boolean",
  157. file = "include/cfg/arch.h",
  158. makedefs = { "FPUFLAGS=-mfloat-abi=hard -mfpu=fpv4-sp-d16" }
  159. }
  160. }
  161. },
  162. --
  163. -- Board Initialization
  164. --
  165. {
  166. name = "nutarch_cm3_bs",
  167. brief = "Board Support",
  168. sources =
  169. function()
  170. return { "cm3/board/"..string.lower(c_macro_edit("PLATFORM"))..".c" };
  171. end,
  172. requires = { "HW_BOARD_SUPPORT" },
  173. },
  174. --
  175. -- Cortex Based Cpu Directory
  176. --
  177. {
  178. name = "nutarch_cm3_stm32_family",
  179. brief = "STM32 Family",
  180. requires = { "HW_MCU_STM32" },
  181. description = "ST Microelectronics STM32 Series",
  182. script = "arch/cm3/stm32fam.nut"
  183. },
  184. {
  185. name = "nutarch_cm3_sam3",
  186. brief = "SAM3",
  187. requires = { "HW_MCU_SAM3" },
  188. description = "ATMEL AT91SAM3 Series",
  189. script = "arch/cm3/sam3u.nut"
  190. },
  191. {
  192. name = "nutarch_cm3_lm3",
  193. brief = "LM3",
  194. requires = { "HW_MCU_LM3" },
  195. description = "Luminary Micro LM3 Series",
  196. script = "arch/cm3/lm3.nut"
  197. },
  198. {
  199. name = "nutarch_cm3_lpc17xx_family",
  200. brief = "LPC17xx",
  201. requires = { "HW_MCU_LPC17xx" },
  202. description = "NXP LPC17xx Series",
  203. script = "arch/cm3/lpc17xxfam.nut"
  204. }
  205. }