STM32F407xx.py 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. #!/usr/bin/env python
  2. '''
  3. these tables are generated from the STM32 datasheets for the
  4. STM32F40x
  5. '''
  6. # additional build information for ChibiOS
  7. build = {
  8. "CHIBIOS_STARTUP_MK" : "os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk",
  9. "CHIBIOS_PLATFORM_MK" : "os/hal/ports/STM32/STM32F4xx/platform.mk"
  10. }
  11. # MCU parameters
  12. mcu = {
  13. # location of MCU serial number
  14. 'UDID_START' : 0x1FFF7A10,
  15. # ram map, as list of (address, size-kb, flags)
  16. # flags of 1 means DMA-capable
  17. # flags of 2 means faster memory for CPU intensive work
  18. 'RAM_MAP' : [
  19. (0x20000000, 128, 1), # main memory, DMA safe
  20. (0x10000000, 64, 2), # CCM memory, faster, but not DMA safe
  21. ]
  22. }
  23. DMA_Map = {
  24. # format is (DMA_TABLE, StreamNum, Channel)
  25. # extracted from tabula-STM32F4x7-dma.csv
  26. "ADC1" : [(2,0,0),(2,4,0)],
  27. "ADC2" : [(2,2,1),(2,3,1)],
  28. "ADC3" : [(2,0,2),(2,1,2)],
  29. "CRYP_IN" : [(2,6,2)],
  30. "CRYP_OUT" : [(2,5,2)],
  31. "DAC1" : [(1,5,7)],
  32. "DAC2" : [(1,6,7)],
  33. "DCMI" : [(2,1,1),(2,7,1)],
  34. "HASH_IN" : [(2,7,2)],
  35. "I2C1_RX" : [(1,0,1),(1,5,1)],
  36. "I2C1_TX" : [(1,6,1),(1,7,1)],
  37. "I2C2_RX" : [(1,2,7),(1,3,7)],
  38. "I2C2_TX" : [(1,7,7)],
  39. "I2C3_RX" : [(1,2,3)],
  40. "I2C3_TX" : [(1,4,3)],
  41. "I2S2_EXT_RX" : [(1,3,3)],
  42. "I2S2_EXT_TX" : [(1,4,2)],
  43. "I2S3_EXT_RX" : [(1,2,2),(1,0,3)],
  44. "I2S3_EXT_TX" : [(1,5,2)],
  45. "SDIO" : [(2,3,4),(2,6,4)],
  46. "SPI1_RX" : [(2,0,3),(2,2,3)],
  47. "SPI1_TX" : [(2,3,3),(2,5,3)],
  48. "SPI2_RX" : [(1,3,0)],
  49. "SPI2_TX" : [(1,4,0)],
  50. "SPI3_RX" : [(1,0,0),(1,2,0)],
  51. "SPI3_TX" : [(1,5,0),(1,7,0)],
  52. "TIM1_CH1" : [(2,6,0),(2,1,6),(2,3,6)],
  53. "TIM1_CH2" : [(2,6,0),(2,2,6)],
  54. "TIM1_CH3" : [(2,6,0),(2,6,6)],
  55. "TIM1_CH4" : [(2,4,6)],
  56. "TIM1_COM" : [(2,4,6)],
  57. "TIM1_TRIG" : [(2,0,6),(2,4,6)],
  58. "TIM1_UP" : [(2,5,6)],
  59. "TIM2_CH1" : [(1,5,3)],
  60. "TIM2_CH2" : [(1,6,3)],
  61. "TIM2_CH3" : [(1,1,3)],
  62. "TIM2_CH4" : [(1,6,3),(1,7,3)],
  63. "TIM2_UP" : [(1,1,3),(1,7,3)],
  64. "TIM3_CH1" : [(1,4,5)],
  65. "TIM3_CH2" : [(1,5,5)],
  66. "TIM3_CH3" : [(1,7,5)],
  67. "TIM3_CH4" : [(1,2,5)],
  68. "TIM3_TRIG" : [(1,4,5)],
  69. "TIM3_UP" : [(1,2,5)],
  70. "TIM4_CH1" : [(1,0,2)],
  71. "TIM4_CH2" : [(1,3,2)],
  72. "TIM4_CH3" : [(1,7,2)],
  73. "TIM4_UP" : [(1,6,2)],
  74. "TIM5_CH1" : [(1,2,6)],
  75. "TIM5_CH2" : [(1,4,6)],
  76. "TIM5_CH3" : [(1,0,6)],
  77. "TIM5_CH4" : [(1,1,6),(1,3,6)],
  78. "TIM5_TRIG" : [(1,1,6),(1,3,6)],
  79. "TIM5_UP" : [(1,0,6),(1,6,6)],
  80. "TIM6_UP" : [(1,1,7)],
  81. "TIM7_UP" : [(1,2,1),(1,4,1)],
  82. "TIM8_CH1" : [(2,2,0),(2,2,7)],
  83. "TIM8_CH2" : [(2,2,0),(2,3,7)],
  84. "TIM8_CH3" : [(2,2,0),(2,4,7)],
  85. "TIM8_CH4" : [(2,7,7)],
  86. "TIM8_COM" : [(2,7,7)],
  87. "TIM8_TRIG" : [(2,7,7)],
  88. "TIM8_UP" : [(2,1,7)],
  89. "UART4_RX" : [(1,2,4)],
  90. "UART4_TX" : [(1,4,4)],
  91. "UART5_RX" : [(1,0,4)],
  92. "UART5_TX" : [(1,7,4)],
  93. "USART1_RX" : [(2,2,4),(2,5,4)],
  94. "USART1_TX" : [(2,7,4)],
  95. "USART2_RX" : [(1,5,4)],
  96. "USART2_TX" : [(1,6,4)],
  97. "USART3_RX" : [(1,1,4)],
  98. "USART3_TX" : [(1,3,4),(1,4,7)],
  99. "USART6_RX" : [(2,1,5),(2,2,5)],
  100. "USART6_TX" : [(2,6,5),(2,7,5)],
  101. }
  102. AltFunction_map = {
  103. # format is PIN:FUNCTION : AFNUM
  104. # extracted from tabula-AF-F427.csv
  105. "PA0:ETH_MII_CRS" : 11,
  106. "PA0:EVENTOUT" : 15,
  107. "PA0:TIM2_CH1" : 1,
  108. "PA0:TIM2_ETR" : 1,
  109. "PA0:TIM5_CH1" : 2,
  110. "PA0:TIM8_ETR" : 3,
  111. "PA0:UART4_TX" : 8,
  112. "PA0:USART2_CTS" : 7,
  113. "PA10:DCMI_D1" : 13,
  114. "PA10:EVENTOUT" : 15,
  115. "PA10:OTG_FS_ID" : 10,
  116. "PA10:TIM1_CH3" : 1,
  117. "PA10:USART1_RX" : 7,
  118. "PA11:CAN1_RX" : 9,
  119. "PA11:EVENTOUT" : 15,
  120. "PA11:LCD_R4" : 14,
  121. "PA11:OTG_FS_DM" : 10,
  122. "PA11:TIM1_CH4" : 1,
  123. "PA11:USART1_CTS" : 7,
  124. "PA12:CAN1_TX" : 9,
  125. "PA12:EVENTOUT" : 15,
  126. "PA12:LCD_R5" : 14,
  127. "PA12:OTG_FS_DP" : 10,
  128. "PA12:TIM1_ETR" : 1,
  129. "PA12:USART1_RTS" : 7,
  130. "PA13:EVENTOUT" : 15,
  131. "PA13:JTMS-SWDIO" : 0,
  132. "PA14:EVENTOUT" : 15,
  133. "PA14:JTCK-SWCLK" : 0,
  134. "PA15:EVENTOUT" : 15,
  135. "PA15:I2S3_WS" : 6,
  136. "PA15:JTDI" : 0,
  137. "PA15:SPI1_NSS" : 5,
  138. "PA15:SPI3_NSS" : 6,
  139. "PA15:TIM2_CH1" : 1,
  140. "PA15:TIM2_ETR" : 1,
  141. "PA1:ETH_MII_RX_CLK" : 11,
  142. "PA1:ETH_RMII_REF_CLK" : 11,
  143. "PA1:EVENTOUT" : 15,
  144. "PA1:TIM2_CH2" : 1,
  145. "PA1:TIM5_CH2" : 2,
  146. "PA1:UART4_RX" : 8,
  147. "PA1:USART2_RTS" : 7,
  148. "PA2:ETH_MDIO" : 11,
  149. "PA2:EVENTOUT" : 15,
  150. "PA2:TIM2_CH3" : 1,
  151. "PA2:TIM5_CH3" : 2,
  152. "PA2:TIM9_CH1" : 3,
  153. "PA2:USART2_TX" : 7,
  154. "PA3:ETH_MII_COL" : 11,
  155. "PA3:EVENTOUT" : 15,
  156. "PA3:LCD_B5" : 14,
  157. "PA3:OTG_HS_ULPI_D0" : 10,
  158. "PA3:TIM2_CH4" : 1,
  159. "PA3:TIM5_CH4" : 2,
  160. "PA3:TIM9_CH2" : 3,
  161. "PA3:USART2_RX" : 7,
  162. "PA4:DCMI_HSYNC" : 13,
  163. "PA4:EVENTOUT" : 15,
  164. "PA4:I2S3_WS" : 6,
  165. "PA4:LCD_VSYNC" : 14,
  166. "PA4:OTG_HS_SOF" : 12,
  167. "PA4:SPI1_NSS" : 5,
  168. "PA4:SPI3_NSS" : 6,
  169. "PA4:USART2_CK" : 7,
  170. "PA5:EVENTOUT" : 15,
  171. "PA5:OTG_HS_ULPI_CK" : 10,
  172. "PA5:SPI1_SCK" : 5,
  173. "PA5:TIM2_CH1" : 1,
  174. "PA5:TIM2_ETR" : 1,
  175. "PA5:TIM8_CH1N" : 3,
  176. "PA6:DCMI_PIXCLK" : 13,
  177. "PA6:EVENTOUT" : 15,
  178. "PA6:LCD_G2" : 14,
  179. "PA6:SPI1_MISO" : 5,
  180. "PA6:TIM13_CH1" : 9,
  181. "PA6:TIM1_BKIN" : 1,
  182. "PA6:TIM3_CH1" : 2,
  183. "PA6:TIM8_BKIN" : 3,
  184. "PA7:ETH_MII_RX_DV" : 11,
  185. "PA7:ETH_RMII_CRS_DV" : 11,
  186. "PA7:EVENTOUT" : 15,
  187. "PA7:SPI1_MOSI" : 5,
  188. "PA7:TIM14_CH1" : 9,
  189. "PA7:TIM1_CH1N" : 1,
  190. "PA7:TIM3_CH2" : 2,
  191. "PA7:TIM8_CH1N" : 3,
  192. "PA8:EVENTOUT" : 15,
  193. "PA8:I2C3_SCL" : 4,
  194. "PA8:LCD_R6" : 14,
  195. "PA8:MCO1" : 0,
  196. "PA8:OTG_FS_SOF" : 10,
  197. "PA8:TIM1_CH1" : 1,
  198. "PA8:USART1_CK" : 7,
  199. "PA9:DCMI_D0" : 13,
  200. "PA9:EVENTOUT" : 15,
  201. "PA9:I2C3_SMBA" : 4,
  202. "PA9:TIM1_CH2" : 1,
  203. "PA9:USART1_TX" : 7,
  204. "PB0:ETH_MII_RXD2" : 11,
  205. "PB0:EVENTOUT" : 15,
  206. "PB0:LCD_R3" : 9,
  207. "PB0:OTG_HS_ULPI_D1" : 10,
  208. "PB0:TIM1_CH2N" : 1,
  209. "PB0:TIM3_CH3" : 2,
  210. "PB0:TIM8_CH2N" : 3,
  211. "PB10:ETH_MII_RX_ER" : 11,
  212. "PB10:EVENTOUT" : 15,
  213. "PB10:I2C2_SCL" : 4,
  214. "PB10:I2S2_CK" : 5,
  215. "PB10:LCD_G4" : 14,
  216. "PB10:OTG_HS_ULPI_D3" : 10,
  217. "PB10:SPI2_SCK" : 5,
  218. "PB10:TIM2_CH3" : 1,
  219. "PB10:USART3_TX" : 7,
  220. "PB11:ETH_MII_TX_EN" : 11,
  221. "PB11:ETH_RMII_TX_EN" : 11,
  222. "PB11:EVENTOUT" : 15,
  223. "PB11:I2C2_SDA" : 4,
  224. "PB11:LCD_G5" : 14,
  225. "PB11:OTG_HS_ULPI_D4" : 10,
  226. "PB11:TIM2_CH4" : 1,
  227. "PB11:USART3_RX" : 7,
  228. "PB12:CAN2_RX" : 9,
  229. "PB12:ETH_MII_TXD0" : 11,
  230. "PB12:ETH_RMII_TXD0" : 11,
  231. "PB12:EVENTOUT" : 15,
  232. "PB12:I2C2_SMBA" : 4,
  233. "PB12:I2S2_WS" : 5,
  234. "PB12:OTG_HS_ID" : 12,
  235. "PB12:OTG_HS_ULPI_D5" : 10,
  236. "PB12:SPI2_NSS" : 5,
  237. "PB12:TIM1_BKIN" : 1,
  238. "PB12:USART3_CK" : 7,
  239. "PB13:CAN2_TX" : 9,
  240. "PB13:ETH_MII_TXD1" : 11,
  241. "PB13:ETH_RMII_TXD1" : 11,
  242. "PB13:EVENTOUT" : 15,
  243. "PB13:I2S2_CK" : 5,
  244. "PB13:OTG_HS_ULPI_D6" : 10,
  245. "PB13:SPI2_SCK" : 5,
  246. "PB13:TIM1_CH1N" : 1,
  247. "PB13:USART3_CTS" : 7,
  248. "PB14:EVENTOUT" : 15,
  249. "PB14:I2S2EXT_SD" : 6,
  250. "PB14:OTG_HS_DM" : 12,
  251. "PB14:SPI2_MISO" : 5,
  252. "PB14:TIM12_CH1" : 9,
  253. "PB14:TIM1_CH2N" : 1,
  254. "PB14:TIM8_CH2N" : 3,
  255. "PB14:USART3_RTS" : 7,
  256. "PB15:EVENTOUT" : 15,
  257. "PB15:I2S2_SD" : 5,
  258. "PB15:OTG_HS_DP" : 12,
  259. "PB15:RTC_REFIN" : 0,
  260. "PB15:SPI2_MOSI" : 5,
  261. "PB15:TIM12_CH2" : 9,
  262. "PB15:TIM1_CH3N" : 1,
  263. "PB15:TIM8_CH3N" : 3,
  264. "PB1:ETH_MII_RXD3" : 11,
  265. "PB1:EVENTOUT" : 15,
  266. "PB1:LCD_R6" : 9,
  267. "PB1:OTG_HS_ULPI_D2" : 10,
  268. "PB1:TIM1_CH3N" : 1,
  269. "PB1:TIM3_CH4" : 2,
  270. "PB1:TIM8_CH3N" : 3,
  271. "PB2:EVENTOUT" : 15,
  272. "PB3:EVENTOUT" : 15,
  273. "PB3:I2S3_CK" : 6,
  274. "PB3:JTDO" : 0,
  275. "PB3:SPI1_SCK" : 5,
  276. "PB3:SPI3_SCK" : 6,
  277. "PB3:TIM2_CH2" : 1,
  278. "PB3:TRACESWO" : 0,
  279. "PB4:EVENTOUT" : 15,
  280. "PB4:I2S3EXT_SD" : 7,
  281. "PB4:NJTRST" : 0,
  282. "PB4:SPI1_MISO" : 5,
  283. "PB4:SPI3_MISO" : 6,
  284. "PB4:TIM3_CH1" : 2,
  285. "PB5:CAN2_RX" : 9,
  286. "PB5:DCMI_D10" : 13,
  287. "PB5:ETH_PPS_OUT" : 11,
  288. "PB5:EVENTOUT" : 15,
  289. "PB5:FMC_SDCKE1" : 12,
  290. "PB5:I2C1_SMBA" : 4,
  291. "PB5:I2S3_SD" : 6,
  292. "PB5:OTG_HS_ULPI_D7" : 10,
  293. "PB5:SPI1_MOSI" : 5,
  294. "PB5:SPI3_MOSI" : 6,
  295. "PB5:TIM3_CH2" : 2,
  296. "PB6:CAN2_TX" : 9,
  297. "PB6:DCMI_D5" : 13,
  298. "PB6:EVENTOUT" : 15,
  299. "PB6:FMC_SDNE1" : 12,
  300. "PB6:I2C1_SCL" : 4,
  301. "PB6:TIM4_CH1" : 2,
  302. "PB6:USART1_TX" : 7,
  303. "PB7:DCMI_VSYNC" : 13,
  304. "PB7:EVENTOUT" : 15,
  305. "PB7:FMC_NL" : 12,
  306. "PB7:I2C1_SDA" : 4,
  307. "PB7:TIM4_CH2" : 2,
  308. "PB7:USART1_RX" : 7,
  309. "PB8:CAN1_RX" : 9,
  310. "PB8:DCMI_D6" : 13,
  311. "PB8:ETH_MII_TXD3" : 11,
  312. "PB8:EVENTOUT" : 15,
  313. "PB8:I2C1_SCL" : 4,
  314. "PB8:LCD_B6" : 14,
  315. "PB8:SDIO_D4" : 12,
  316. "PB8:TIM10_CH1" : 3,
  317. "PB8:TIM4_CH3" : 2,
  318. "PB9:CAN1_TX" : 9,
  319. "PB9:DCMI_D7" : 13,
  320. "PB9:EVENTOUT" : 15,
  321. "PB9:I2C1_SDA" : 4,
  322. "PB9:I2S2_WS" : 5,
  323. "PB9:LCD_B7" : 14,
  324. "PB9:SDIO_D5" : 12,
  325. "PB9:SPI2_NSS" : 5,
  326. "PB9:TIM11_CH1" : 3,
  327. "PB9:TIM4_CH4" : 2,
  328. "PC0:EVENTOUT" : 15,
  329. "PC0:FMC_SDNWE" : 12,
  330. "PC0:OTG_HS_ULPI_STP" : 10,
  331. "PC10:DCMI_D8" : 13,
  332. "PC10:EVENTOUT" : 15,
  333. "PC10:I2S3_CK" : 6,
  334. "PC10:LCD_R2" : 14,
  335. "PC10:SDIO_D2" : 12,
  336. "PC10:SPI3_SCK" : 6,
  337. "PC10:UART4_TX" : 8,
  338. "PC10:USART3_TX" : 7,
  339. "PC11:DCMI_D4" : 13,
  340. "PC11:EVENTOUT" : 15,
  341. "PC11:I2S3EXT_SD" : 5,
  342. "PC11:SDIO_D3" : 12,
  343. "PC11:SPI3_MISO" : 6,
  344. "PC11:UART4_RX" : 8,
  345. "PC11:USART3_RX" : 7,
  346. "PC12:DCMI_D9" : 13,
  347. "PC12:EVENTOUT" : 15,
  348. "PC12:I2S3_SD" : 6,
  349. "PC12:SDIO_CK" : 12,
  350. "PC12:SPI3_MOSI" : 6,
  351. "PC12:UART5_TX" : 8,
  352. "PC12:USART3_CK" : 7,
  353. "PC13:EVENTOUT" : 15,
  354. "PC14:EVENTOUT" : 15,
  355. "PC15:EVENTOUT" : 15,
  356. "PC1:ETH_MDC" : 11,
  357. "PC1:EVENTOUT" : 15,
  358. "PC2:ETH_MII_TXD2" : 11,
  359. "PC2:EVENTOUT" : 15,
  360. "PC2:FMC_SDNE0" : 12,
  361. "PC2:I2S2EXT_SD" : 6,
  362. "PC2:OTG_HS_ULPI_DIR" : 10,
  363. "PC2:SPI2_MISO" : 5,
  364. "PC3:ETH_MII_TX_CLK" : 11,
  365. "PC3:EVENTOUT" : 15,
  366. "PC3:FMC_SDCKE0" : 12,
  367. "PC3:I2S2_SD" : 5,
  368. "PC3:OTG_HS_ULPI_NXT" : 10,
  369. "PC3:SPI2_MOSI" : 5,
  370. "PC4:ETH_MII_RXD0" : 11,
  371. "PC4:ETH_RMII_RXD0" : 11,
  372. "PC4:EVENTOUT" : 15,
  373. "PC5:ETH_MII_RXD1" : 11,
  374. "PC5:ETH_RMII_RXD1" : 11,
  375. "PC5:EVENTOUT" : 15,
  376. "PC6:DCMI_D0" : 13,
  377. "PC6:EVENTOUT" : 15,
  378. "PC6:I2S2_MCK" : 5,
  379. "PC6:LCD_HSYNC" : 14,
  380. "PC6:SDIO_D6" : 12,
  381. "PC6:TIM3_CH1" : 2,
  382. "PC6:TIM8_CH1" : 3,
  383. "PC6:USART6_TX" : 8,
  384. "PC7:DCMI_D1" : 13,
  385. "PC7:EVENTOUT" : 15,
  386. "PC7:I2S3_MCK" : 6,
  387. "PC7:LCD_G6" : 14,
  388. "PC7:SDIO_D7" : 12,
  389. "PC7:TIM3_CH2" : 2,
  390. "PC7:TIM8_CH2" : 3,
  391. "PC7:USART6_RX" : 8,
  392. "PC8:DCMI_D2" : 13,
  393. "PC8:EVENTOUT" : 15,
  394. "PC8:SDIO_D0" : 12,
  395. "PC8:TIM3_CH3" : 2,
  396. "PC8:TIM8_CH3" : 3,
  397. "PC8:USART6_CK" : 8,
  398. "PC9:DCMI_D3" : 13,
  399. "PC9:EVENTOUT" : 15,
  400. "PC9:I2C3_SDA" : 4,
  401. "PC9:I2S_CKIN" : 5,
  402. "PC9:MCO2" : 0,
  403. "PC9:SDIO_D1" : 12,
  404. "PC9:TIM3_CH4" : 2,
  405. "PC9:TIM8_CH4" : 3,
  406. "PD0:CAN1_RX" : 9,
  407. "PD0:EVENTOUT" : 15,
  408. "PD0:FMC_D2" : 12,
  409. "PD10:EVENTOUT" : 15,
  410. "PD10:FMC_D15" : 12,
  411. "PD10:LCD_B3" : 14,
  412. "PD10:USART3_CK" : 7,
  413. "PD11:EVENTOUT" : 15,
  414. "PD11:FMC_A16" : 12,
  415. "PD11:USART3_CTS" : 7,
  416. "PD12:EVENTOUT" : 15,
  417. "PD12:FMC_A17" : 12,
  418. "PD12:TIM4_CH1" : 2,
  419. "PD12:USART3_RTS" : 7,
  420. "PD13:EVENTOUT" : 15,
  421. "PD13:FMC_A18" : 12,
  422. "PD13:TIM4_CH2" : 2,
  423. "PD14:EVENTOUT" : 15,
  424. "PD14:FMC_D0" : 12,
  425. "PD14:TIM4_CH3" : 2,
  426. "PD15:EVENTOUT" : 15,
  427. "PD15:FMC_D1" : 12,
  428. "PD15:TIM4_CH4" : 2,
  429. "PD1:CAN1_TX" : 9,
  430. "PD1:EVENTOUT" : 15,
  431. "PD1:FMC_D3" : 12,
  432. "PD2:DCMI_D11" : 13,
  433. "PD2:EVENTOUT" : 15,
  434. "PD2:SDIO_CMD" : 12,
  435. "PD2:TIM3_ETR" : 2,
  436. "PD2:UART5_RX" : 8,
  437. "PD3:DCMI_D5" : 13,
  438. "PD3:EVENTOUT" : 15,
  439. "PD3:FMC_CLK" : 12,
  440. "PD3:I2S2_CK" : 5,
  441. "PD3:LCD_G7" : 14,
  442. "PD3:SPI2_SCK" : 5,
  443. "PD3:USART2_CTS" : 7,
  444. "PD4:EVENTOUT" : 15,
  445. "PD4:FMC_NOE" : 12,
  446. "PD4:USART2_RTS" : 7,
  447. "PD5:EVENTOUT" : 15,
  448. "PD5:FMC_NWE" : 12,
  449. "PD5:USART2_TX" : 7,
  450. "PD6:DCMI_D10" : 13,
  451. "PD6:EVENTOUT" : 15,
  452. "PD6:FMC_NWAIT" : 12,
  453. "PD6:I2S3_SD" : 5,
  454. "PD6:LCD_B2" : 14,
  455. "PD6:SAI1_SD_A" : 6,
  456. "PD6:SPI3_MOSI" : 5,
  457. "PD6:USART2_RX" : 7,
  458. "PD7:EVENTOUT" : 15,
  459. "PD7:FMC_NCE2" : 12,
  460. "PD7:FMC_NE1" : 12,
  461. "PD7:USART2_CK" : 7,
  462. "PD8:EVENTOUT" : 15,
  463. "PD8:FMC_D13" : 12,
  464. "PD8:USART3_TX" : 7,
  465. "PD9:EVENTOUT" : 15,
  466. "PD9:FMC_D14" : 12,
  467. "PD9:USART3_RX" : 7,
  468. "PE0:DCMI_D2" : 13,
  469. "PE0:EVENTOUT" : 15,
  470. "PE0:FMC_NBL0" : 12,
  471. "PE0:TIM4_ETR" : 2,
  472. "PE0:UART8_RX" : 8,
  473. "PE10:EVENTOUT" : 15,
  474. "PE10:FMC_D7" : 12,
  475. "PE10:TIM1_CH2N" : 1,
  476. "PE11:EVENTOUT" : 15,
  477. "PE11:FMC_D8" : 12,
  478. "PE11:LCD_G3" : 14,
  479. "PE11:SPI4_NSS" : 5,
  480. "PE11:TIM1_CH2" : 1,
  481. "PE12:EVENTOUT" : 15,
  482. "PE12:FMC_D9" : 12,
  483. "PE12:LCD_B4" : 14,
  484. "PE12:SPI4_SCK" : 5,
  485. "PE12:TIM1_CH3N" : 1,
  486. "PE13:EVENTOUT" : 15,
  487. "PE13:FMC_D10" : 12,
  488. "PE13:LCD_DE" : 14,
  489. "PE13:SPI4_MISO" : 5,
  490. "PE13:TIM1_CH3" : 1,
  491. "PE14:EVENTOUT" : 15,
  492. "PE14:FMC_D11" : 12,
  493. "PE14:LCD_CLK" : 14,
  494. "PE14:SPI4_MOSI" : 5,
  495. "PE14:TIM1_CH4" : 1,
  496. "PE15:" : 5,
  497. "PE15:EVENTOUT" : 15,
  498. "PE15:FMC_D12" : 12,
  499. "PE15:LCD_R7" : 14,
  500. "PE15:TIM1_BKIN" : 1,
  501. "PE1:DCMI_D3" : 13,
  502. "PE1:EVENTOUT" : 15,
  503. "PE1:FMC_NBL1" : 12,
  504. "PE1:UART8_TX" : 8,
  505. "PE2:ETH_MII_TXD3" : 11,
  506. "PE2:EVENTOUT" : 15,
  507. "PE2:FMC_A23" : 12,
  508. "PE2:SAI1_MCLK_A" : 6,
  509. "PE2:SPI4_SCK" : 5,
  510. "PE2:TRACECLK" : 0,
  511. "PE3:EVENTOUT" : 15,
  512. "PE3:FMC_A19" : 12,
  513. "PE3:SAI1_SD_B" : 6,
  514. "PE3:TRACED0" : 0,
  515. "PE4:DCMI_D4" : 13,
  516. "PE4:EVENTOUT" : 15,
  517. "PE4:FMC_A20" : 12,
  518. "PE4:LCD_B0" : 14,
  519. "PE4:SAI1_FS_A" : 6,
  520. "PE4:SPI4_NSS" : 5,
  521. "PE4:TRACED1" : 0,
  522. "PE5:DCMI_D6" : 13,
  523. "PE5:EVENTOUT" : 15,
  524. "PE5:FMC_A21" : 12,
  525. "PE5:LCD_G0" : 14,
  526. "PE5:SAI1_SCK_A" : 6,
  527. "PE5:SPI4_MISO" : 5,
  528. "PE5:TIM9_CH1" : 3,
  529. "PE5:TRACED2" : 0,
  530. "PE6:DCMI_D7" : 13,
  531. "PE6:EVENTOUT" : 15,
  532. "PE6:FMC_A22" : 12,
  533. "PE6:LCD_G1" : 14,
  534. "PE6:SAI1_SD_A" : 6,
  535. "PE6:SPI4_MOSI" : 5,
  536. "PE6:TIM9_CH2" : 3,
  537. "PE6:TRACED3" : 0,
  538. "PE7:EVENTOUT" : 15,
  539. "PE7:FMC_D4" : 12,
  540. "PE7:TIM1_ETR" : 1,
  541. "PE7:UART7_RX" : 8,
  542. "PE8:EVENTOUT" : 15,
  543. "PE8:FMC_D5" : 12,
  544. "PE8:TIM1_CH1N" : 1,
  545. "PE8:UART7_TX" : 8,
  546. "PE9:EVENTOUT" : 15,
  547. "PE9:FMC_D6" : 12,
  548. "PE9:TIM1_CH1" : 1,
  549. "PF0:EVENTOUT" : 15,
  550. "PF0:FMC_A0" : 12,
  551. "PF0:I2C2_SDA" : 4,
  552. "PF10:DCMI_D11" : 13,
  553. "PF10:EVENTOUT" : 15,
  554. "PF10:FMC_INTR" : 12,
  555. "PF10:LCD_DE" : 14,
  556. "PF11:DCMI_D12" : 13,
  557. "PF11:EVENTOUT" : 15,
  558. "PF11:FMC_SDNRAS" : 12,
  559. "PF11:SPI5_MOSI" : 5,
  560. "PF12:EVENTOUT" : 15,
  561. "PF12:FMC_A6" : 12,
  562. "PF13:EVENTOUT" : 15,
  563. "PF13:FMC_A7" : 12,
  564. "PF14:EVENTOUT" : 15,
  565. "PF14:FMC_A8" : 12,
  566. "PF15:EVENTOUT" : 15,
  567. "PF15:FMC_A9" : 12,
  568. "PF1:" : 3,
  569. "PF1:EVENTOUT" : 15,
  570. "PF1:FMC_A1" : 12,
  571. "PF1:I2C2_SCL" : 4,
  572. "PF2:EVENTOUT" : 15,
  573. "PF2:FMC_A2" : 12,
  574. "PF2:I2C2_SMBA" : 4,
  575. "PF3:" : 4,
  576. "PF3:EVENTOUT" : 15,
  577. "PF3:FMC_A3" : 12,
  578. "PF4:" : 4,
  579. "PF4:EVENTOUT" : 15,
  580. "PF4:FMC_A4" : 12,
  581. "PF5:" : 4,
  582. "PF5:EVENTOUT" : 15,
  583. "PF5:FMC_A5" : 12,
  584. "PF6:EVENTOUT" : 15,
  585. "PF6:FMC_NIORD" : 12,
  586. "PF6:SAI1_SD_B" : 6,
  587. "PF6:SPI5_NSS" : 5,
  588. "PF6:TIM10_CH1" : 3,
  589. "PF6:UART7_RX" : 8,
  590. "PF7:EVENTOUT" : 15,
  591. "PF7:FMC_NREG" : 12,
  592. "PF7:SAI1_MCLK_B" : 6,
  593. "PF7:SPI5_SCK" : 5,
  594. "PF7:TIM11_CH1" : 3,
  595. "PF7:UART7_TX" : 8,
  596. "PF8:EVENTOUT" : 15,
  597. "PF8:FMC_NIOWR" : 12,
  598. "PF8:SAI1_SCK_B" : 6,
  599. "PF8:SPI5_MISO" : 5,
  600. "PF8:TIM13_CH1" : 9,
  601. "PF9:EVENTOUT" : 15,
  602. "PF9:FMC_CD" : 12,
  603. "PF9:SAI1_FS_B" : 6,
  604. "PF9:SPI5_MOSI" : 5,
  605. "PF9:TIM14_CH1" : 9,
  606. "PG0:EVENTOUT" : 15,
  607. "PG0:FMC_A10" : 12,
  608. "PG10:DCMI_D2" : 13,
  609. "PG10:EVENTOUT" : 15,
  610. "PG10:FMC_NCE4_1" : 12,
  611. "PG10:FMC_NE3" : 12,
  612. "PG10:LCD_B2" : 14,
  613. "PG10:LCD_G3" : 9,
  614. "PG11:DCMI_D3" : 13,
  615. "PG11:ETH_MII_TX_EN" : 11,
  616. "PG11:ETH_RMII_TX_EN" : 11,
  617. "PG11:EVENTOUT" : 15,
  618. "PG11:FMC_NCE4_2" : 12,
  619. "PG11:LCD_B3" : 14,
  620. "PG12:EVENTOUT" : 15,
  621. "PG12:FMC_NE4" : 12,
  622. "PG12:LCD_B1" : 14,
  623. "PG12:LCD_B4" : 9,
  624. "PG12:SPI6_MISO" : 5,
  625. "PG12:USART6_RTS" : 8,
  626. "PG13:ETH_MII_TXD0" : 11,
  627. "PG13:ETH_RMII_TXD0" : 11,
  628. "PG13:EVENTOUT" : 15,
  629. "PG13:FMC_A24" : 12,
  630. "PG13:SPI6_SCK" : 5,
  631. "PG13:USART6_CTS" : 8,
  632. "PG14:ETH_MII_TXD1" : 11,
  633. "PG14:ETH_RMII_TXD1" : 11,
  634. "PG14:EVENTOUT" : 15,
  635. "PG14:FMC_A25" : 12,
  636. "PG14:SPI6_MOSI" : 5,
  637. "PG14:USART6_TX" : 8,
  638. "PG15:DCMI_D13" : 13,
  639. "PG15:EVENTOUT" : 15,
  640. "PG15:FMC_SDNCAS" : 12,
  641. "PG15:USART6_CTS" : 8,
  642. "PG1:EVENTOUT" : 15,
  643. "PG1:FMC_A11" : 12,
  644. "PG2:EVENTOUT" : 15,
  645. "PG2:FMC_A12" : 12,
  646. "PG3:EVENTOUT" : 15,
  647. "PG3:FMC_A13" : 12,
  648. "PG4:EVENTOUT" : 15,
  649. "PG4:FMC_A14" : 12,
  650. "PG4:FMC_BA0" : 12,
  651. "PG5:EVENTOUT" : 15,
  652. "PG5:FMC_A15" : 12,
  653. "PG5:FMC_BA1" : 12,
  654. "PG6:DCMI_D12" : 13,
  655. "PG6:EVENTOUT" : 15,
  656. "PG6:FMC_INT2" : 12,
  657. "PG6:LCD_R7" : 14,
  658. "PG7:DCMI_D13" : 13,
  659. "PG7:EVENTOUT" : 15,
  660. "PG7:FMC_INT3" : 12,
  661. "PG7:LCD_CLK" : 14,
  662. "PG7:USART6_CK" : 8,
  663. "PG8:ETH_PPS_OUT" : 11,
  664. "PG8:EVENTOUT" : 15,
  665. "PG8:FMC_SDCLK" : 12,
  666. "PG8:SPI6_NSS" : 5,
  667. "PG8:USART6_RTS" : 8,
  668. "PG9:DCMI_VSYNC(1)" : 13,
  669. "PG9:EVENTOUT" : 15,
  670. "PG9:FMC_NCE3" : 12,
  671. "PG9:FMC_NE2" : 12,
  672. "PG9:USART6_RX" : 8,
  673. "PH0:EVENTOUT" : 15,
  674. "PH10:DCMI_D1" : 13,
  675. "PH10:EVENTOUT" : 15,
  676. "PH10:FMC_D18" : 12,
  677. "PH10:LCD_R4" : 14,
  678. "PH10:TIM5_CH1" : 2,
  679. "PH11:DCMI_D2" : 13,
  680. "PH11:EVENTOUT" : 15,
  681. "PH11:FMC_D19" : 12,
  682. "PH11:LCD_R5" : 14,
  683. "PH11:TIM5_CH2" : 2,
  684. "PH12:DCMI_D3" : 13,
  685. "PH12:EVENTOUT" : 15,
  686. "PH12:FMC_D20" : 12,
  687. "PH12:LCD_R6" : 14,
  688. "PH12:TIM5_CH3" : 2,
  689. "PH13:CAN1_TX" : 9,
  690. "PH13:EVENTOUT" : 15,
  691. "PH13:FMC_D21" : 12,
  692. "PH13:LCD_G2" : 14,
  693. "PH13:TIM8_CH1N" : 3,
  694. "PH14:DCMI_D4" : 13,
  695. "PH14:EVENTOUT" : 15,
  696. "PH14:FMC_D22" : 12,
  697. "PH14:LCD_G3" : 14,
  698. "PH14:TIM8_CH2N" : 3,
  699. "PH15:DCMI_D11" : 13,
  700. "PH15:EVENTOUT" : 15,
  701. "PH15:FMC_D23" : 12,
  702. "PH15:LCD_G4" : 14,
  703. "PH15:TIM8_CH3N" : 3,
  704. "PH1:EVENTOUT" : 15,
  705. "PH2:ETH_MII_CRS" : 11,
  706. "PH2:EVENTOUT" : 15,
  707. "PH2:FMC_SDCKE0" : 12,
  708. "PH2:LCD_R0" : 14,
  709. "PH3:ETH_MII_COL" : 11,
  710. "PH3:EVENTOUT" : 15,
  711. "PH3:FMC_SDNE0" : 12,
  712. "PH3:LCD_R1" : 14,
  713. "PH4:EVENTOUT" : 15,
  714. "PH4:I2C2_SCL" : 4,
  715. "PH4:OTG_HS_ULPI_NXT" : 10,
  716. "PH5:EVENTOUT" : 15,
  717. "PH5:FMC_SDNWE" : 12,
  718. "PH5:I2C2_SDA" : 4,
  719. "PH5:SPI5_NSS" : 5,
  720. "PH6:DCMI_D8" : 13,
  721. "PH6:FMC_SDNE1" : 12,
  722. "PH6:I2C2_SMBA" : 4,
  723. "PH6:SPI5_SCK" : 5,
  724. "PH6:TIM12_CH1" : 9,
  725. "PH7:DCMI_D9" : 13,
  726. "PH7:ETH_MII_RXD3" : 11,
  727. "PH7:FMC_SDCKE1" : 12,
  728. "PH7:I2C3_SCL" : 4,
  729. "PH7:SPI5_MISO" : 5,
  730. "PH8:DCMI_HSYNC" : 13,
  731. "PH8:EVENTOUT" : 15,
  732. "PH8:FMC_D16" : 12,
  733. "PH8:I2C3_SDA" : 4,
  734. "PH8:LCD_R2" : 14,
  735. "PH9:DCMI_D0" : 13,
  736. "PH9:EVENTOUT" : 15,
  737. "PH9:FMC_D17" : 12,
  738. "PH9:I2C3_SMBA" : 4,
  739. "PH9:LCD_R3" : 14,
  740. "PH9:TIM12_CH2" : 9,
  741. }
  742. ADC1_map = {
  743. # format is PIN : ADC1_CHAN
  744. # extracted from tabula-addfunc-F427.csv
  745. "PA0" : 0,
  746. "PA1" : 1,
  747. "PA2" : 2,
  748. "PA3" : 3,
  749. "PA4" : 4,
  750. "PA5" : 5,
  751. "PA6" : 6,
  752. "PA7" : 7,
  753. "PB0" : 8,
  754. "PB1" : 9,
  755. "PC0" : 10,
  756. "PC1" : 11,
  757. "PC2" : 12,
  758. "PC3" : 13,
  759. "PC4" : 14,
  760. "PC5" : 15,
  761. }