STM32F745xx.py 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917
  1. #!/usr/bin/env python
  2. '''
  3. these tables are generated from the STM32 datasheets for the
  4. STM32F74x
  5. '''
  6. # additional build information for ChibiOS
  7. build = {
  8. "CHIBIOS_STARTUP_MK" : "os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk",
  9. "CHIBIOS_PLATFORM_MK" : "os/hal/ports/STM32/STM32F7xx/platform.mk"
  10. }
  11. # MCU parameters
  12. mcu = {
  13. # location of MCU serial number
  14. 'UDID_START' : 0x1FF0F420,
  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. (0x20010000, 256, 0), # main memory, not DMA safe
  20. (0x20000000, 64, 1), # DTCM memory, DMA safe
  21. ]
  22. }
  23. DMA_Map = {
  24. # format is (DMA_TABLE, StreamNum, Channel)
  25. # extracted from tabula-STM32F745-222.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,1,1),(1,2,3)],
  40. "I2C3_TX" : [(1,4,3)],
  41. "I2C4" : [(1,2,2),(1,5,2)],
  42. "QUADSPI" : [(2,7,3)],
  43. "SAI1_A" : [(2,1,0),(2,3,0)],
  44. "SAI1_B" : [(2,5,0),(2,4,1)],
  45. "SAI2_A" : [(2,4,3)],
  46. "SAI2_B" : [(2,7,0),(2,6,3)],
  47. "SDMMC1" : [(2,3,4),(2,6,4)],
  48. "SPDIFRX_CS" : [(1,6,0)],
  49. "SPDIFRX_DT" : [(1,1,0)],
  50. "SPI1_RX" : [(2,0,3),(2,2,3)],
  51. "SPI1_TX" : [(2,3,3),(2,5,3)],
  52. "SPI2_RX" : [(1,3,0)],
  53. "SPI2_TX" : [(1,4,0)],
  54. "SPI3_RX" : [(1,0,0),(1,2,0)],
  55. "SPI3_TX" : [(1,5,0),(1,7,0)],
  56. "SPI4_RX" : [(2,0,4),(2,3,5)],
  57. "SPI4_TX" : [(2,1,4),(2,4,5)],
  58. "SPI5_RX" : [(2,3,2),(2,5,7)],
  59. "SPI5_TX" : [(2,4,2),(2,6,7)],
  60. "SPI6_RX" : [(2,6,1)],
  61. "SPI6_TX" : [(2,5,1)],
  62. "TIM1_CH1" : [(2,6,0),(2,1,6),(2,3,6)],
  63. "TIM1_CH2" : [(2,6,0),(2,2,6)],
  64. "TIM1_CH3" : [(2,6,0),(2,6,6)],
  65. "TIM1_CH4" : [(2,4,6)],
  66. "TIM1_COM" : [(2,4,6)],
  67. "TIM1_TRIG" : [(2,0,6),(2,4,6)],
  68. "TIM1_UP" : [(2,5,6)],
  69. "TIM2_CH1" : [(1,5,3)],
  70. "TIM2_CH2" : [(1,6,3)],
  71. "TIM2_CH3" : [(1,1,3)],
  72. "TIM2_CH4" : [(1,6,3),(1,7,3)],
  73. "TIM2_UP" : [(1,1,3),(1,7,3)],
  74. "TIM3_CH1" : [(1,4,5)],
  75. "TIM3_CH2" : [(1,5,5)],
  76. "TIM3_CH3" : [(1,7,5)],
  77. "TIM3_CH4" : [(1,2,5)],
  78. "TIM3_TRIG" : [(1,4,5)],
  79. "TIM3_UP" : [(1,2,5)],
  80. "TIM4_CH1" : [(1,0,2)],
  81. "TIM4_CH2" : [(1,3,2)],
  82. "TIM4_CH3" : [(1,7,2)],
  83. "TIM4_UP" : [(1,6,2)],
  84. "TIM5_CH1" : [(1,2,6)],
  85. "TIM5_CH2" : [(1,4,6)],
  86. "TIM5_CH3" : [(1,0,6)],
  87. "TIM5_CH4" : [(1,1,6),(1,3,6)],
  88. "TIM5_TRIG" : [(1,1,6),(1,3,6)],
  89. "TIM5_UP" : [(1,0,6),(1,6,6)],
  90. "TIM6_UP" : [(1,1,7)],
  91. "TIM7_UP" : [(1,2,1),(1,4,1)],
  92. "TIM8_CH1" : [(2,2,0),(2,2,7)],
  93. "TIM8_CH2" : [(2,2,0),(2,3,7)],
  94. "TIM8_CH3" : [(2,2,0),(2,4,7)],
  95. "TIM8_CH4" : [(2,7,7)],
  96. "TIM8_COM" : [(2,7,7)],
  97. "TIM8_TRIG" : [(2,7,7)],
  98. "TIM8_UP" : [(2,1,7)],
  99. "UART4_RX" : [(1,2,4)],
  100. "UART4_TX" : [(1,4,4)],
  101. "UART5_RX" : [(1,0,4)],
  102. "UART5_TX" : [(1,7,4)],
  103. "UART7_RX" : [(1,3,5)],
  104. "UART7_TX" : [(1,1,5)],
  105. "UART8_RX" : [(1,6,5)],
  106. "UART8_TX" : [(1,0,5)],
  107. "USART1_RX" : [(2,2,4),(2,5,4)],
  108. "USART1_TX" : [(2,7,4)],
  109. "USART2_RX" : [(1,5,4)],
  110. "USART2_TX" : [(1,6,4)],
  111. "USART3_RX" : [(1,1,4)],
  112. "USART3_TX" : [(1,3,4),(1,4,7)],
  113. "USART6_RX" : [(2,1,5),(2,2,5)],
  114. "USART6_TX" : [(2,6,5),(2,7,5)],
  115. "_RX" : [(1,2,2),(1,5,2)],
  116. }
  117. AltFunction_map = {
  118. # format is PIN:FUNCTION : AFNUM
  119. # extracted from tabula-AF-F745.csv
  120. "PA0:ETH_MII_CRS" : 11,
  121. "PA0:EVENTOUT" : 15,
  122. "PA0:SAI2_SD_B" : 10,
  123. "PA0:TIM2_CH1" : 1,
  124. "PA0:TIM2_ETR" : 1,
  125. "PA0:TIM5_CH1" : 2,
  126. "PA0:TIM8_ETR" : 3,
  127. "PA0:UART4_TX" : 8,
  128. "PA0:USART2_CTS" : 7,
  129. "PA1:ETH_MII_RX_CLK" : 11,
  130. "PA1:ETH_RMII_REF_CLK" : 11,
  131. "PA1:EVENTOUT" : 15,
  132. "PA1:LCD_R2" : 14,
  133. "PA1:QUADSPI_BK1_IO3" : 9,
  134. "PA1:SAI2_MCK_B" : 10,
  135. "PA1:TIM2_CH2" : 1,
  136. "PA1:TIM5_CH2" : 2,
  137. "PA1:UART4_RX" : 8,
  138. "PA1:USART2_RTS" : 7,
  139. "PA2:ETH_MDIO" : 11,
  140. "PA2:EVENTOUT" : 15,
  141. "PA2:LCD_R1" : 14,
  142. "PA2:SAI2_SCK_B" : 8,
  143. "PA2:TIM2_CH3" : 1,
  144. "PA2:TIM5_CH3" : 2,
  145. "PA2:TIM9_CH1" : 3,
  146. "PA2:USART2_TX" : 7,
  147. "PA3:ETH_MII_COL" : 11,
  148. "PA3:EVENTOUT" : 15,
  149. "PA3:LCD_B5" : 14,
  150. "PA3:OTG_HS_ULPI_D0" : 10,
  151. "PA3:TIM2_CH4" : 1,
  152. "PA3:TIM5_CH4" : 2,
  153. "PA3:TIM9_CH2" : 3,
  154. "PA3:USART2_RX" : 7,
  155. "PA4:DCMI_HSYNC" : 13,
  156. "PA4:EVENTOUT" : 15,
  157. "PA4:I2S1_WS" : 5,
  158. "PA4:I2S3_WS" : 6,
  159. "PA4:LCD_VSYNC" : 14,
  160. "PA4:OTG_HS_SOF" : 12,
  161. "PA4:SPI1_NSS" : 5,
  162. "PA4:SPI3_NSS" : 6,
  163. "PA4:USART2_CK" : 7,
  164. "PA5:EVENTOUT" : 15,
  165. "PA5:I2S1_CK" : 5,
  166. "PA5:LCD_R4" : 14,
  167. "PA5:OTG_HS_ULPI_CK" : 10,
  168. "PA5:SPI1_SCK" : 5,
  169. "PA5:TIM2_CH1" : 1,
  170. "PA5:TIM2_ETR" : 1,
  171. "PA5:TIM8_CH1N" : 3,
  172. "PA6:DCMI_PIXCLK" : 13,
  173. "PA6:EVENTOUT" : 15,
  174. "PA6:LCD_G2" : 14,
  175. "PA6:SPI1_MISO" : 5,
  176. "PA6:TIM13_CH1" : 9,
  177. "PA6:TIM1_BKIN" : 1,
  178. "PA6:TIM3_CH1" : 2,
  179. "PA6:TIM8_BKIN" : 3,
  180. "PA7:ETH_MII_RX_DV" : 11,
  181. "PA7:ETH_RMII_CRS_DV" : 11,
  182. "PA7:EVENTOUT" : 15,
  183. "PA7:FMC_SDNWE" : 12,
  184. "PA7:I2S1_SD" : 5,
  185. "PA7:SPI1_MOSI" : 5,
  186. "PA7:TIM14_CH1" : 9,
  187. "PA7:TIM1_CH1N" : 1,
  188. "PA7:TIM3_CH2" : 2,
  189. "PA7:TIM8_CH1N" : 3,
  190. "PA8:EVENTOUT" : 15,
  191. "PA8:I2C3_SCL" : 4,
  192. "PA8:LCD_R6" : 14,
  193. "PA8:MCO1" : 0,
  194. "PA8:OTG_FS_SOF" : 10,
  195. "PA8:TIM1_CH1" : 1,
  196. "PA8:TIM8_BKIN2" : 3,
  197. "PA8:USART1_CK" : 7,
  198. "PA9:DCMI_D0" : 13,
  199. "PA9:EVENTOUT" : 15,
  200. "PA9:I2C3_SMBA" : 4,
  201. "PA9:I2S2_CK" : 5,
  202. "PA9:SPI2_SCK" : 5,
  203. "PA9:TIM1_CH2" : 1,
  204. "PA9:USART1_TX" : 7,
  205. "PA10:DCMI_D1" : 13,
  206. "PA10:EVENTOUT" : 15,
  207. "PA10:OTG_FS_ID" : 10,
  208. "PA10:TIM1_CH3" : 1,
  209. "PA10:USART1_RX" : 7,
  210. "PA11:CAN1_RX" : 9,
  211. "PA11:EVENTOUT" : 15,
  212. "PA11:LCD_R4" : 14,
  213. "PA11:OTG_FS_DM" : 10,
  214. "PA11:TIM1_CH4" : 1,
  215. "PA11:USART1_CTS" : 7,
  216. "PA12:CAN1_TX" : 9,
  217. "PA12:EVENTOUT" : 15,
  218. "PA12:LCD_R5" : 14,
  219. "PA12:OTG_FS_DP" : 10,
  220. "PA12:SAI2_FS_B" : 8,
  221. "PA12:TIM1_ETR" : 1,
  222. "PA12:USART1_RTS" : 7,
  223. "PA13:EVENTOUT" : 15,
  224. "PA13:JTMS-SWDIO" : 0,
  225. "PA14:EVENTOUT" : 15,
  226. "PA14:JTCK-SWCLK" : 0,
  227. "PA15:EVENTOUT" : 15,
  228. "PA15:HDMI-CEC" : 4,
  229. "PA15:I2S1_WS" : 5,
  230. "PA15:I2S3_WS" : 6,
  231. "PA15:JTDI" : 0,
  232. "PA15:SPI1_NSS" : 5,
  233. "PA15:SPI3_NSS" : 6,
  234. "PA15:TIM2_CH1" : 1,
  235. "PA15:TIM2_ETR" : 1,
  236. "PA15:UART4_RTS" : 8,
  237. "PB0:ETH_MII_RXD2" : 11,
  238. "PB0:EVENTOUT" : 15,
  239. "PB0:LCD_R3" : 9,
  240. "PB0:OTG_HS_ULPI_D1" : 10,
  241. "PB0:TIM1_CH2N" : 1,
  242. "PB0:TIM3_CH3" : 2,
  243. "PB0:TIM8_CH2N" : 3,
  244. "PB0:UART4_CTS" : 8,
  245. "PB1:ETH_MII_RXD3" : 11,
  246. "PB1:EVENTOUT" : 15,
  247. "PB1:LCD_R6" : 9,
  248. "PB1:OTG_HS_ULPI_D2" : 10,
  249. "PB1:TIM1_CH3N" : 1,
  250. "PB1:TIM3_CH4" : 2,
  251. "PB1:TIM8_CH3N" : 3,
  252. "PB2:EVENTOUT" : 15,
  253. "PB2:I2S3_SD" : 7,
  254. "PB2:QUADSPI_CLK" : 9,
  255. "PB2:SAI1_SD_A" : 6,
  256. "PB2:SPI3_MOSI" : 7,
  257. "PB3:EVENTOUT" : 15,
  258. "PB3:I2S1_CK" : 5,
  259. "PB3:I2S3_CK" : 6,
  260. "PB3:JTDO" : 0,
  261. "PB3:SPI1_SCK" : 5,
  262. "PB3:SPI3_SCK" : 6,
  263. "PB3:TIM2_CH2" : 1,
  264. "PB3:TRACESWO" : 0,
  265. "PB4:EVENTOUT" : 15,
  266. "PB4:I2S2_WS" : 7,
  267. "PB4:NJTRST" : 0,
  268. "PB4:SPI1_MISO" : 5,
  269. "PB4:SPI2_NSS" : 7,
  270. "PB4:SPI3_MISO" : 6,
  271. "PB4:TIM3_CH1" : 2,
  272. "PB5:CAN2_RX" : 9,
  273. "PB5:DCMI_D10" : 13,
  274. "PB5:ETH_PPS_OUT" : 11,
  275. "PB5:EVENTOUT" : 15,
  276. "PB5:FMC_SDCKE1" : 12,
  277. "PB5:I2C1_SMBA" : 4,
  278. "PB5:I2S1_SD" : 5,
  279. "PB5:I2S3_SD" : 6,
  280. "PB5:OTG_HS_ULPI_D7" : 10,
  281. "PB5:SPI1_MOSI" : 5,
  282. "PB5:SPI3_MOSI" : 6,
  283. "PB5:TIM3_CH2" : 2,
  284. "PB6:CAN2_TX" : 9,
  285. "PB6:DCMI_D5" : 13,
  286. "PB6:EVENTOUT" : 15,
  287. "PB6:FMC_SDNE1" : 12,
  288. "PB6:HDMI-CEC" : 3,
  289. "PB6:I2C1_SCL" : 4,
  290. "PB6:QUADSPI_BK1_NCS" : 10,
  291. "PB6:TIM4_CH1" : 2,
  292. "PB6:USART1_TX" : 7,
  293. "PB7:DCMI_VSYNC" : 13,
  294. "PB7:EVENTOUT" : 15,
  295. "PB7:FMC_NL" : 12,
  296. "PB7:I2C1_SDA" : 4,
  297. "PB7:TIM4_CH2" : 2,
  298. "PB7:USART1_RX" : 7,
  299. "PB8:CAN1_RX" : 9,
  300. "PB8:DCMI_D6" : 13,
  301. "PB8:ETH_MII_TXD3" : 11,
  302. "PB8:EVENTOUT" : 15,
  303. "PB8:I2C1_SCL" : 4,
  304. "PB8:LCD_B6" : 14,
  305. "PB8:SDMMC1_D4" : 12,
  306. "PB8:TIM10_CH1" : 3,
  307. "PB8:TIM4_CH3" : 2,
  308. "PB9:CAN1_TX" : 9,
  309. "PB9:DCMI_D7" : 13,
  310. "PB9:EVENTOUT" : 15,
  311. "PB9:I2C1_SDA" : 4,
  312. "PB9:I2S2_WS" : 5,
  313. "PB9:LCD_B7" : 14,
  314. "PB9:SDMMC1_D5" : 12,
  315. "PB9:SPI2_NSS" : 5,
  316. "PB9:TIM11_CH1" : 3,
  317. "PB9:TIM4_CH4" : 2,
  318. "PB10:ETH_MII_RX_ER" : 11,
  319. "PB10:EVENTOUT" : 15,
  320. "PB10:I2C2_SCL" : 4,
  321. "PB10:I2S2_CK" : 5,
  322. "PB10:LCD_G4" : 14,
  323. "PB10:OTG_HS_ULPI_D3" : 10,
  324. "PB10:SPI2_SCK" : 5,
  325. "PB10:TIM2_CH3" : 1,
  326. "PB10:USART3_TX" : 7,
  327. "PB11:ETH_MII_TX_EN" : 11,
  328. "PB11:ETH_RMII_TX_EN" : 11,
  329. "PB11:EVENTOUT" : 15,
  330. "PB11:I2C2_SDA" : 4,
  331. "PB11:LCD_G5" : 14,
  332. "PB11:OTG_HS_ULPI_D4" : 10,
  333. "PB11:TIM2_CH4" : 1,
  334. "PB11:USART3_RX" : 7,
  335. "PB12:CAN2_RX" : 9,
  336. "PB12:ETH_MII_TXD0" : 11,
  337. "PB12:ETH_RMII_TXD0" : 11,
  338. "PB12:EVENTOUT" : 15,
  339. "PB12:I2C2_SMBA" : 4,
  340. "PB12:I2S2_WS" : 5,
  341. "PB12:OTG_HS_ID" : 12,
  342. "PB12:OTG_HS_ULPI_D5" : 10,
  343. "PB12:SPI2_NSS" : 5,
  344. "PB12:TIM1_BKIN" : 1,
  345. "PB12:USART3_CK" : 7,
  346. "PB13:CAN2_TX" : 9,
  347. "PB13:ETH_MII_TXD1" : 11,
  348. "PB13:ETH_RMII_TXD1" : 11,
  349. "PB13:EVENTOUT" : 15,
  350. "PB13:I2S2_CK" : 5,
  351. "PB13:OTG_HS_ULPI_D6" : 10,
  352. "PB13:SPI2_SCK" : 5,
  353. "PB13:TIM1_CH1N" : 1,
  354. "PB13:USART3_CTS" : 7,
  355. "PB14:EVENTOUT" : 15,
  356. "PB14:OTG_HS_DM" : 12,
  357. "PB14:SPI2_MISO" : 5,
  358. "PB14:TIM12_CH1" : 9,
  359. "PB14:TIM1_CH2N" : 1,
  360. "PB14:TIM8_CH2N" : 3,
  361. "PB14:USART3_RTS" : 7,
  362. "PB15:EVENTOUT" : 15,
  363. "PB15:I2S2_SD" : 5,
  364. "PB15:OTG_HS_DP" : 12,
  365. "PB15:RTC_REFIN" : 0,
  366. "PB15:SPI2_MOSI" : 5,
  367. "PB15:TIM12_CH2" : 9,
  368. "PB15:TIM1_CH3N" : 1,
  369. "PB15:TIM8_CH3N" : 3,
  370. "PC0:EVENTOUT" : 15,
  371. "PC0:FMC_SDNWE" : 12,
  372. "PC0:LCD_R5" : 14,
  373. "PC0:OTG_HS_ULPI_STP" : 10,
  374. "PC0:SAI2_FS_B" : 8,
  375. "PC1:ETH_MDC" : 11,
  376. "PC1:EVENTOUT" : 15,
  377. "PC1:I2S2_SD" : 5,
  378. "PC1:SAI1_SD_A" : 6,
  379. "PC1:SPI2_MOSI" : 5,
  380. "PC1:TRACED0" : 0,
  381. "PC2:ETH_MII_TXD2" : 11,
  382. "PC2:EVENTOUT" : 15,
  383. "PC2:FMC_SDNE0" : 12,
  384. "PC2:OTG_HS_ULPI_DIR" : 10,
  385. "PC2:SPI2_MISO" : 5,
  386. "PC3:ETH_MII_TX_CLK" : 11,
  387. "PC3:EVENTOUT" : 15,
  388. "PC3:FMC_SDCKE0" : 12,
  389. "PC3:I2S2_SD" : 5,
  390. "PC3:OTG_HS_ULPI_NXT" : 10,
  391. "PC3:SPI2_MOSI" : 5,
  392. "PC4:ETH_MII_RXD0" : 11,
  393. "PC4:ETH_RMII_RXD0" : 11,
  394. "PC4:EVENTOUT" : 15,
  395. "PC4:FMC_SDNE0" : 12,
  396. "PC4:I2S1_MCK" : 5,
  397. "PC4:SPDIFRX_IN2" : 8,
  398. "PC5:ETH_MII_RXD1" : 11,
  399. "PC5:ETH_RMII_RXD1" : 11,
  400. "PC5:EVENTOUT" : 15,
  401. "PC5:FMC_SDCKE0" : 12,
  402. "PC5:SPDIFRX_IN3" : 8,
  403. "PC6:DCMI_D0" : 13,
  404. "PC6:EVENTOUT" : 15,
  405. "PC6:I2S2_MCK" : 5,
  406. "PC6:LCD_HSYNC" : 14,
  407. "PC6:SDMMC1_D6" : 12,
  408. "PC6:TIM3_CH1" : 2,
  409. "PC6:TIM8_CH1" : 3,
  410. "PC6:USART6_TX" : 8,
  411. "PC7:DCMI_D1" : 13,
  412. "PC7:EVENTOUT" : 15,
  413. "PC7:I2S3_MCK" : 6,
  414. "PC7:LCD_G6" : 14,
  415. "PC7:SDMMC1_D7" : 12,
  416. "PC7:TIM3_CH2" : 2,
  417. "PC7:TIM8_CH2" : 3,
  418. "PC7:USART6_RX" : 8,
  419. "PC8:DCMI_D2" : 13,
  420. "PC8:EVENTOUT" : 15,
  421. "PC8:SDMMC1_D0" : 12,
  422. "PC8:TIM3_CH3" : 2,
  423. "PC8:TIM8_CH3" : 3,
  424. "PC8:TRACED1" : 0,
  425. "PC8:UART5_RTS" : 7,
  426. "PC8:USART6_CK" : 8,
  427. "PC9:DCMI_D3" : 13,
  428. "PC9:EVENTOUT" : 15,
  429. "PC9:I2C3_SDA" : 4,
  430. "PC9:I2S_CKIN" : 5,
  431. "PC9:MCO2" : 0,
  432. "PC9:QUADSPI_BK1_IO0" : 9,
  433. "PC9:SDMMC1_D1" : 12,
  434. "PC9:TIM3_CH4" : 2,
  435. "PC9:TIM8_CH4" : 3,
  436. "PC9:UART5_CTS" : 7,
  437. "PC10:DCMI_D8" : 13,
  438. "PC10:EVENTOUT" : 15,
  439. "PC10:I2S3_CK" : 6,
  440. "PC10:LCD_R2" : 14,
  441. "PC10:QUADSPI_BK1_IO1" : 9,
  442. "PC10:SDMMC1_D2" : 12,
  443. "PC10:SPI3_SCK" : 6,
  444. "PC10:UART4_TX" : 8,
  445. "PC10:USART3_TX" : 7,
  446. "PC11:DCMI_D4" : 13,
  447. "PC11:EVENTOUT" : 15,
  448. "PC11:QUADSPI_BK2_NCS" : 9,
  449. "PC11:SDMMC1_D3" : 12,
  450. "PC11:SPI3_MISO" : 6,
  451. "PC11:UART4_RX" : 8,
  452. "PC11:USART3_RX" : 7,
  453. "PC12:DCMI_D9" : 13,
  454. "PC12:EVENTOUT" : 15,
  455. "PC12:I2S3_SD" : 6,
  456. "PC12:SDMMC1_CK" : 12,
  457. "PC12:SPI3_MOSI" : 6,
  458. "PC12:TRACED3" : 0,
  459. "PC12:UART5_TX" : 8,
  460. "PC12:USART3_CK" : 7,
  461. "PC13:EVENTOUT" : 15,
  462. "PC14:EVENTOUT" : 15,
  463. "PC15:EVENTOUT" : 15,
  464. "PD0:CAN1_RX" : 9,
  465. "PD0:EVENTOUT" : 15,
  466. "PD0:FMC_D2" : 12,
  467. "PD1:CAN1_TX" : 9,
  468. "PD1:EVENTOUT" : 15,
  469. "PD1:FMC_D3" : 12,
  470. "PD2:DCMI_D11" : 13,
  471. "PD2:EVENTOUT" : 15,
  472. "PD2:SDMMC1_CMD" : 12,
  473. "PD2:TIM3_ETR" : 2,
  474. "PD2:TRACED2" : 0,
  475. "PD2:UART5_RX" : 8,
  476. "PD3:DCMI_D5" : 13,
  477. "PD3:EVENTOUT" : 15,
  478. "PD3:FMC_CLK" : 12,
  479. "PD3:I2S2_CK" : 5,
  480. "PD3:LCD_G7" : 14,
  481. "PD3:SPI2_SCK" : 5,
  482. "PD3:USART2_CTS" : 7,
  483. "PD4:EVENTOUT" : 15,
  484. "PD4:FMC_NOE" : 12,
  485. "PD4:USART2_RTS" : 7,
  486. "PD5:EVENTOUT" : 15,
  487. "PD5:FMC_NWE" : 12,
  488. "PD5:USART2_TX" : 7,
  489. "PD6:DCMI_D10" : 13,
  490. "PD6:EVENTOUT" : 15,
  491. "PD6:FMC_NWAIT" : 12,
  492. "PD6:I2S3_SD" : 5,
  493. "PD6:LCD_B2" : 14,
  494. "PD6:SAI1_SD_A" : 6,
  495. "PD6:SPI3_MOSI" : 5,
  496. "PD6:USART2_RX" : 7,
  497. "PD7:EVENTOUT" : 15,
  498. "PD7:FMC_NE1" : 12,
  499. "PD7:SPDIFRX_IN0" : 8,
  500. "PD7:USART2_CK" : 7,
  501. "PD8:EVENTOUT" : 15,
  502. "PD8:FMC_D13" : 12,
  503. "PD8:SPDIFRX_IN1" : 8,
  504. "PD8:USART3_TX" : 7,
  505. "PD9:EVENTOUT" : 15,
  506. "PD9:FMC_D14" : 12,
  507. "PD9:USART3_RX" : 7,
  508. "PD10:EVENTOUT" : 15,
  509. "PD10:FMC_D15" : 12,
  510. "PD10:LCD_B3" : 14,
  511. "PD10:USART3_CK" : 7,
  512. "PD11:EVENTOUT" : 15,
  513. "PD11:FMC_A16" : 12,
  514. "PD11:FMC_CLE" : 12,
  515. "PD11:I2C4_SMBA" : 4,
  516. "PD11:QUADSPI_BK1_IO0" : 9,
  517. "PD11:SAI2_SD_A" : 10,
  518. "PD11:USART3_CTS" : 7,
  519. "PD12:EVENTOUT" : 15,
  520. "PD12:FMC_A17" : 12,
  521. "PD12:FMC_ALE" : 12,
  522. "PD12:I2C4_SCL" : 4,
  523. "PD12:LPTIM1_IN1" : 3,
  524. "PD12:QUADSPI_BK1_IO1" : 9,
  525. "PD12:SAI2_FS_A" : 10,
  526. "PD12:TIM4_CH1" : 2,
  527. "PD12:USART3_RTS" : 7,
  528. "PD13:EVENTOUT" : 15,
  529. "PD13:FMC_A18" : 12,
  530. "PD13:I2C4_SDA" : 4,
  531. "PD13:LPTIM1_OUT" : 3,
  532. "PD13:QUADSPI_BK1_IO3" : 9,
  533. "PD13:SAI2_SCK_A" : 10,
  534. "PD13:TIM4_CH2" : 2,
  535. "PD14:EVENTOUT" : 15,
  536. "PD14:FMC_D0" : 12,
  537. "PD14:TIM4_CH3" : 2,
  538. "PD14:UART8_CTS" : 8,
  539. "PD15:EVENTOUT" : 15,
  540. "PD15:FMC_D1" : 12,
  541. "PD15:TIM4_CH4" : 2,
  542. "PD15:UART8_RTS" : 8,
  543. "PE0:DCMI_D2" : 13,
  544. "PE0:EVENTOUT" : 15,
  545. "PE0:FMC_NBL0" : 12,
  546. "PE0:LPTIM1_ETR" : 3,
  547. "PE0:SAI2_MCK_A" : 10,
  548. "PE0:TIM4_ETR" : 2,
  549. "PE0:UART8_RX" : 8,
  550. "PE1:DCMI_D3" : 13,
  551. "PE1:EVENTOUT" : 15,
  552. "PE1:FMC_NBL1" : 12,
  553. "PE1:LPTIM1_IN2" : 3,
  554. "PE1:UART8_TX" : 8,
  555. "PE2:ETH_MII_TXD3" : 11,
  556. "PE2:EVENTOUT" : 15,
  557. "PE2:FMC_A23" : 12,
  558. "PE2:QUADSPI_BK1_IO2" : 9,
  559. "PE2:SAI1_MCLK_A" : 6,
  560. "PE2:SPI4_SCK" : 5,
  561. "PE2:TRACECLK" : 0,
  562. "PE3:EVENTOUT" : 15,
  563. "PE3:FMC_A19" : 12,
  564. "PE3:SAI1_SD_B" : 6,
  565. "PE3:TRACED0" : 0,
  566. "PE4:DCMI_D4" : 13,
  567. "PE4:EVENTOUT" : 15,
  568. "PE4:FMC_A20" : 12,
  569. "PE4:LCD_B0" : 14,
  570. "PE4:SAI1_FS_A" : 6,
  571. "PE4:SPI4_NSS" : 5,
  572. "PE4:TRACED1" : 0,
  573. "PE5:DCMI_D6" : 13,
  574. "PE5:EVENTOUT" : 15,
  575. "PE5:FMC_A21" : 12,
  576. "PE5:LCD_G0" : 14,
  577. "PE5:SAI1_SCK_A" : 6,
  578. "PE5:SPI4_MISO" : 5,
  579. "PE5:TIM9_CH1" : 3,
  580. "PE5:TRACED2" : 0,
  581. "PE6:DCMI_D7" : 13,
  582. "PE6:EVENTOUT" : 15,
  583. "PE6:FMC_A22" : 12,
  584. "PE6:LCD_G1" : 14,
  585. "PE6:SAI1_SD_A" : 6,
  586. "PE6:SAI2_MCK_B" : 10,
  587. "PE6:SPI4_MOSI" : 5,
  588. "PE6:TIM1_BKIN2" : 1,
  589. "PE6:TIM9_CH2" : 3,
  590. "PE6:TRACED3" : 0,
  591. "PE7:EVENTOUT" : 15,
  592. "PE7:FMC_D4" : 12,
  593. "PE7:QUADSPI_BK2_IO0" : 10,
  594. "PE7:TIM1_ETR" : 1,
  595. "PE7:UART7_RX" : 8,
  596. "PE8:EVENTOUT" : 15,
  597. "PE8:FMC_D5" : 12,
  598. "PE8:QUADSPI_BK2_IO1" : 10,
  599. "PE8:TIM1_CH1N" : 1,
  600. "PE8:UART7_TX" : 8,
  601. "PE9:EVENTOUT" : 15,
  602. "PE9:FMC_D6" : 12,
  603. "PE9:QUADSPI_BK2_IO2" : 10,
  604. "PE9:TIM1_CH1" : 1,
  605. "PE9:UART7_RTS" : 8,
  606. "PE10:EVENTOUT" : 15,
  607. "PE10:FMC_D7" : 12,
  608. "PE10:QUADSPI_BK2_IO3" : 10,
  609. "PE10:TIM1_CH2N" : 1,
  610. "PE10:UART7_CTS" : 8,
  611. "PE11:EVENTOUT" : 15,
  612. "PE11:FMC_D8" : 12,
  613. "PE11:LCD_G3" : 14,
  614. "PE11:SAI2_SD_B" : 10,
  615. "PE11:SPI4_NSS" : 5,
  616. "PE11:TIM1_CH2" : 1,
  617. "PE12:EVENTOUT" : 15,
  618. "PE12:FMC_D9" : 12,
  619. "PE12:LCD_B4" : 14,
  620. "PE12:SAI2_SCK_B" : 10,
  621. "PE12:SPI4_SCK" : 5,
  622. "PE12:TIM1_CH3N" : 1,
  623. "PE13:EVENTOUT" : 15,
  624. "PE13:FMC_D10" : 12,
  625. "PE13:LCD_DE" : 14,
  626. "PE13:SAI2_FS_B" : 10,
  627. "PE13:SPI4_MISO" : 5,
  628. "PE13:TIM1_CH3" : 1,
  629. "PE14:EVENTOUT" : 15,
  630. "PE14:FMC_D11" : 12,
  631. "PE14:LCD_CLK" : 14,
  632. "PE14:SAI2_MCK_B" : 10,
  633. "PE14:SPI4_MOSI" : 5,
  634. "PE14:TIM1_CH4" : 1,
  635. "PE15:EVENTOUT" : 15,
  636. "PE15:FMC_D12" : 12,
  637. "PE15:LCD_R7" : 14,
  638. "PE15:TIM1_BKIN" : 1,
  639. "PF0:EVENTOUT" : 15,
  640. "PF0:FMC_A0" : 12,
  641. "PF0:I2C2_SDA" : 4,
  642. "PF1:EVENTOUT" : 15,
  643. "PF1:FMC_A1" : 12,
  644. "PF1:I2C2_SCL" : 4,
  645. "PF2:EVENTOUT" : 15,
  646. "PF2:FMC_A2" : 12,
  647. "PF2:I2C2_SMBA" : 4,
  648. "PF3:EVENTOUT" : 15,
  649. "PF3:FMC_A3" : 12,
  650. "PF4:EVENTOUT" : 15,
  651. "PF4:FMC_A4" : 12,
  652. "PF5:EVENTOUT" : 15,
  653. "PF5:FMC_A5" : 12,
  654. "PF6:EVENTOUT" : 15,
  655. "PF6:QUADSPI_BK1_IO3" : 9,
  656. "PF6:SAI1_SD_B" : 6,
  657. "PF6:SPI5_NSS" : 5,
  658. "PF6:TIM10_CH1" : 3,
  659. "PF6:UART7_RX" : 8,
  660. "PF7:EVENTOUT" : 15,
  661. "PF7:QUADSPI_BK1_IO2" : 9,
  662. "PF7:SAI1_MCLK_B" : 6,
  663. "PF7:SPI5_SCK" : 5,
  664. "PF7:TIM11_CH1" : 3,
  665. "PF7:UART7_TX" : 8,
  666. "PF8:EVENTOUT" : 15,
  667. "PF8:QUADSPI_BK1_IO0" : 10,
  668. "PF8:SAI1_SCK_B" : 6,
  669. "PF8:SPI5_MISO" : 5,
  670. "PF8:TIM13_CH1" : 9,
  671. "PF8:UART7_RTS" : 8,
  672. "PF9:EVENTOUT" : 15,
  673. "PF9:QUADSPI_BK1_IO1" : 10,
  674. "PF9:SAI1_FS_B" : 6,
  675. "PF9:SPI5_MOSI" : 5,
  676. "PF9:TIM14_CH1" : 9,
  677. "PF9:UART7_CTS" : 8,
  678. "PF10:DCMI_D11" : 13,
  679. "PF10:EVENTOUT" : 15,
  680. "PF10:LCD_DE" : 14,
  681. "PF11:DCMI_D12" : 13,
  682. "PF11:EVENTOUT" : 15,
  683. "PF11:FMC_SDNRAS" : 12,
  684. "PF11:SAI2_SD_B" : 10,
  685. "PF11:SPI5_MOSI" : 5,
  686. "PF12:EVENTOUT" : 15,
  687. "PF12:FMC_A6" : 12,
  688. "PF13:EVENTOUT" : 15,
  689. "PF13:FMC_A7" : 12,
  690. "PF13:I2C4_SMBA" : 4,
  691. "PF14:EVENTOUT" : 15,
  692. "PF14:FMC_A8" : 12,
  693. "PF14:I2C4_SCL" : 4,
  694. "PF15:EVENTOUT" : 15,
  695. "PF15:FMC_A9" : 12,
  696. "PF15:I2C4_SDA" : 4,
  697. "PG0:EVENTOUT" : 15,
  698. "PG0:FMC_A10" : 12,
  699. "PG1:EVENTOUT" : 15,
  700. "PG1:FMC_A11" : 12,
  701. "PG2:EVENTOUT" : 15,
  702. "PG2:FMC_A12" : 12,
  703. "PG3:EVENTOUT" : 15,
  704. "PG3:FMC_A13" : 12,
  705. "PG4:EVENTOUT" : 15,
  706. "PG4:FMC_A14" : 12,
  707. "PG4:FMC_BA0" : 12,
  708. "PG5:EVENTOUT" : 15,
  709. "PG5:FMC_A15" : 12,
  710. "PG5:FMC_BA1" : 12,
  711. "PG6:DCMI_D12" : 13,
  712. "PG6:EVENTOUT" : 15,
  713. "PG6:LCD_R7" : 14,
  714. "PG7:DCMI_D13" : 13,
  715. "PG7:EVENTOUT" : 15,
  716. "PG7:FMC_INT" : 12,
  717. "PG7:LCD_CLK" : 14,
  718. "PG7:USART6_CK" : 8,
  719. "PG8:ETH_PPS_OUT" : 11,
  720. "PG8:EVENTOUT" : 15,
  721. "PG8:FMC_SDCLK" : 12,
  722. "PG8:SPDIFRX_IN2" : 7,
  723. "PG8:SPI6_NSS" : 5,
  724. "PG8:USART6_RTS" : 8,
  725. "PG9:DCMI_VSYNC" : 13,
  726. "PG9:EVENTOUT" : 15,
  727. "PG9:FMC_NCE" : 12,
  728. "PG9:FMC_NE2" : 12,
  729. "PG9:QUADSPI_BK2_IO2" : 9,
  730. "PG9:SAI2_FS_B" : 10,
  731. "PG9:SPDIFRX_IN3" : 7,
  732. "PG9:USART6_RX" : 8,
  733. "PG10:DCMI_D2" : 13,
  734. "PG10:EVENTOUT" : 15,
  735. "PG10:FMC_NE3" : 12,
  736. "PG10:LCD_B2" : 14,
  737. "PG10:LCD_G3" : 9,
  738. "PG10:SAI2_SD_B" : 10,
  739. "PG11:DCMI_D3" : 13,
  740. "PG11:ETH_MII_TX_EN" : 11,
  741. "PG11:ETH_RMII_TX_EN" : 11,
  742. "PG11:EVENTOUT" : 15,
  743. "PG11:LCD_B3" : 14,
  744. "PG11:SPDIFRX_IN0" : 7,
  745. "PG12:EVENTOUT" : 15,
  746. "PG12:FMC_NE4" : 12,
  747. "PG12:LCD_B1" : 14,
  748. "PG12:LCD_B4" : 9,
  749. "PG12:LPTIM1_IN1" : 3,
  750. "PG12:SPDIFRX_IN1" : 7,
  751. "PG12:SPI6_MISO" : 5,
  752. "PG12:USART6_RTS" : 8,
  753. "PG13:ETH_MII_TXD0" : 11,
  754. "PG13:ETH_RMII_TXD0" : 11,
  755. "PG13:EVENTOUT" : 15,
  756. "PG13:FMC_A24" : 12,
  757. "PG13:LCD_R0" : 14,
  758. "PG13:LPTIM1_OUT" : 3,
  759. "PG13:SPI6_SCK" : 5,
  760. "PG13:TRACED0" : 0,
  761. "PG13:USART6_CTS" : 8,
  762. "PG14:ETH_MII_TXD1" : 11,
  763. "PG14:ETH_RMII_TXD1" : 11,
  764. "PG14:EVENTOUT" : 15,
  765. "PG14:FMC_A25" : 12,
  766. "PG14:LCD_B0" : 14,
  767. "PG14:LPTIM1_ETR" : 3,
  768. "PG14:QUADSPI_BK2_IO3" : 9,
  769. "PG14:SPI6_MOSI" : 5,
  770. "PG14:TRACED1" : 0,
  771. "PG14:USART6_TX" : 8,
  772. "PG15:DCMI_D13" : 13,
  773. "PG15:EVENTOUT" : 15,
  774. "PG15:FMC_SDNCAS" : 12,
  775. "PG15:USART6_CTS" : 8,
  776. "PH0:EVENTOUT" : 15,
  777. "PH1:EVENTOUT" : 15,
  778. "PH2:ETH_MII_CRS" : 11,
  779. "PH2:EVENTOUT" : 15,
  780. "PH2:FMC_SDCKE0" : 12,
  781. "PH2:LCD_R0" : 14,
  782. "PH2:LPTIM1_IN2" : 3,
  783. "PH2:QUADSPI_BK2_IO0" : 9,
  784. "PH2:SAI2_SCK_B" : 10,
  785. "PH3:ETH_MII_COL" : 11,
  786. "PH3:EVENTOUT" : 15,
  787. "PH3:FMC_SDNE0" : 12,
  788. "PH3:LCD_R1" : 14,
  789. "PH3:QUADSPI_BK2_IO1" : 9,
  790. "PH3:SAI2_MCK_B" : 10,
  791. "PH4:EVENTOUT" : 15,
  792. "PH4:I2C2_SCL" : 4,
  793. "PH4:OTG_HS_ULPI_NXT" : 10,
  794. "PH5:EVENTOUT" : 15,
  795. "PH5:FMC_SDNWE" : 12,
  796. "PH5:I2C2_SDA" : 4,
  797. "PH5:SPI5_NSS" : 5,
  798. "PH6:DCMI_D8" : 13,
  799. "PH6:ETH_MII_RXD2" : 11,
  800. "PH6:EVENTOUT" : 15,
  801. "PH6:FMC_SDNE1" : 12,
  802. "PH6:I2C2_SMBA" : 4,
  803. "PH6:SPI5_SCK" : 5,
  804. "PH6:TIM12_CH1" : 9,
  805. "PH7:DCMI_D9" : 13,
  806. "PH7:ETH_MII_RXD3" : 11,
  807. "PH7:EVENTOUT" : 15,
  808. "PH7:FMC_SDCKE1" : 12,
  809. "PH7:I2C3_SCL" : 4,
  810. "PH7:SPI5_MISO" : 5,
  811. "PH8:DCMI_HSYNC" : 13,
  812. "PH8:EVENTOUT" : 15,
  813. "PH8:FMC_D16" : 12,
  814. "PH8:I2C3_SDA" : 4,
  815. "PH8:LCD_R2" : 14,
  816. "PH9:DCMI_D0" : 13,
  817. "PH9:EVENTOUT" : 15,
  818. "PH9:FMC_D17" : 12,
  819. "PH9:I2C3_SMBA" : 4,
  820. "PH9:LCD_R3" : 14,
  821. "PH9:TIM12_CH2" : 9,
  822. "PH10:DCMI_D1" : 13,
  823. "PH10:EVENTOUT" : 15,
  824. "PH10:FMC_D18" : 12,
  825. "PH10:I2C4_SMBA" : 4,
  826. "PH10:LCD_R4" : 14,
  827. "PH10:TIM5_CH1" : 2,
  828. "PH11:DCMI_D2" : 13,
  829. "PH11:EVENTOUT" : 15,
  830. "PH11:FMC_D19" : 12,
  831. "PH11:I2C4_SCL" : 4,
  832. "PH11:LCD_R5" : 14,
  833. "PH11:TIM5_CH2" : 2,
  834. "PH12:DCMI_D3" : 13,
  835. "PH12:EVENTOUT" : 15,
  836. "PH12:FMC_D20" : 12,
  837. "PH12:I2C4_SDA" : 4,
  838. "PH12:LCD_R6" : 14,
  839. "PH12:TIM5_CH3" : 2,
  840. "PH13:CAN1_TX" : 9,
  841. "PH13:EVENTOUT" : 15,
  842. "PH13:FMC_D21" : 12,
  843. "PH13:LCD_G2" : 14,
  844. "PH13:TIM8_CH1N" : 3,
  845. "PH14:DCMI_D4" : 13,
  846. "PH14:EVENTOUT" : 15,
  847. "PH14:FMC_D22" : 12,
  848. "PH14:LCD_G3" : 14,
  849. "PH14:TIM8_CH2N" : 3,
  850. "PH15:DCMI_D11" : 13,
  851. "PH15:EVENTOUT" : 15,
  852. "PH15:FMC_D23" : 12,
  853. "PH15:LCD_G4" : 14,
  854. "PH15:TIM8_CH3N" : 3,
  855. }
  856. ADC1_map = {
  857. # format is PIN : ADC1_CHAN
  858. # extracted from tabula-addfunc-F745.csv
  859. "PA1" : 1,
  860. "PA2" : 2,
  861. "PA3" : 3,
  862. "PA4" : 4,
  863. "PA5" : 5,
  864. "PA6" : 6,
  865. "PA7" : 7,
  866. "PB0" : 8,
  867. "PB1" : 9,
  868. "PC0" : 10,
  869. "PC1" : 11,
  870. "PC2" : 12,
  871. "PC3" : 13,
  872. "PC4" : 14,
  873. "PC5" : 15,
  874. }
  875. if __name__ == '__main__':
  876. # test clock settings
  877. def check_range(name, value, minv, maxv):
  878. '''check range of a value'''
  879. import sys
  880. if value < minv:
  881. print("Error: %s=%u is under min of %u" % (name, value, minv))
  882. if value > maxv:
  883. print("Error: %s=%u is over max of %u" % (name, value, maxv))
  884. import sys
  885. STM32_LSECLK_MIN = 32768
  886. STM32_PLLIN_MAX = 2100000
  887. STM32_PLLIN_MIN = 950000
  888. STM32_PLLVCO_MAX = 432000000
  889. STM32_PLLVCO_MIN = 192000000
  890. STM32_PLLM_VALUE = 8
  891. STM32_PLLN_VALUE = 432
  892. STM32_PLLP_VALUE = 2
  893. STM32_PLLQ_VALUE = 9
  894. OSCILLATOR_HZ = int(sys.argv[1])
  895. STM32_HSECLK = OSCILLATOR_HZ
  896. STM32_PLLCLKIN = (STM32_HSECLK / STM32_PLLM_VALUE)
  897. STM32_PLLVCO = (STM32_PLLCLKIN * STM32_PLLN_VALUE)
  898. print('STM32_PLLCLKIN=%u' % STM32_PLLCLKIN)
  899. print('STM32_PLLVCO=%u' % STM32_PLLVCO)
  900. check_range('STM32_PLLCLKIN', STM32_PLLCLKIN, STM32_PLLIN_MIN, STM32_PLLIN_MAX)
  901. check_range('STM32_PLLVCO', STM32_PLLVCO, STM32_PLLVCO_MIN, STM32_PLLVCO_MAX)