README.txt 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775
  1. README
  2. ======
  3. This README discusses issues unique to NuttX configurations for the
  4. ViewTool STM32F103/F107 V1.2 board. This board may be fitted with either
  5. - STM32F107VCT6, or
  6. - STM32F103VCT6
  7. The board is vary modular with connectors for a variety of peripherals.
  8. Features on the base board include:
  9. - User and Wake-Up Keys
  10. - LEDs
  11. See http://www.viewtool.com/ for further information.
  12. Contents
  13. ========
  14. o User and Wake-Up keys
  15. o LEDs
  16. o Serial Console
  17. - Console Configuration
  18. - J5 - USART1
  19. - PL-2013 USB-to-Serial Interface
  20. - RS-232 Module
  21. o USB Interface
  22. o microSD Card Interface
  23. o ViewTool DP83848 Ethernet Module
  24. o Freescale MPL115A barometer sensor
  25. o LCD/Touchscreen Interface
  26. o Toolchains
  27. - NOTE about Windows native toolchains
  28. o Configurations
  29. - Information Common to All Configurations
  30. - Configuration Sub-directories
  31. User and Wake-Up keys
  32. =====================
  33. All pulled high and will be sensed low when depressed.
  34. SW2 PC11 Needs J42 closed
  35. SW3 PC12 Needs J43 closed
  36. SW4 PA0 Needs J44 closed
  37. LEDs
  38. ====
  39. There are four LEDs on the ViewTool STM32F103/F107 board that can be controlled
  40. by software: LED1 through LED4. All pulled high and can be illuminated by
  41. driving the output to low
  42. LED1 PA6
  43. LED2 PA7
  44. LED3 PB12
  45. LED4 PB13
  46. These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
  47. defined. In that case, the usage by the board port is defined in
  48. include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related
  49. events as follows:
  50. SYMBOL Meaning LED state
  51. LED1 LED2 LED3 LED4
  52. ----------------- ----------------------- ---- ---- ---- ----
  53. LED_STARTED NuttX has been started ON OFF OFF OFF
  54. LED_HEAPALLOCATE Heap has been allocated OFF ON OFF OFF
  55. LED_IRQSENABLED Interrupts enabled ON ON OFF OFF
  56. LED_STACKCREATED Idle stack created OFF OFF ON OFF
  57. LED_INIRQ In an interrupt N/C N/C N/C Soft glow
  58. LED_SIGNAL In a signal handler N/C N/C N/C Soft glow
  59. LED_ASSERTION An assertion failed N/C N/C N/C Soft glow
  60. LED_PANIC The system has crashed N/C N/C N/C 2Hz Flashing
  61. LED_IDLE MCU is is sleep mode Not used
  62. After booting, LED1-3 are not longer used by the system and can be used for
  63. other purposes by the application (Of course, all LEDs are available to the
  64. application if CONFIG_ARCH_LEDS is not defined.
  65. Serial Console
  66. ==============
  67. Console Configuration
  68. ---------------------
  69. The NuttX console is configured by default on USART1 at 115200 BAUD 8N1
  70. (8-bits, not parity, one stop bit). These setting can, of course, easily
  71. be changed by reconfiguring NuttX.
  72. J5 - USART1
  73. -----------
  74. The boards come with a PL-2303 based USB-to-serial board. Also available
  75. as an option is an RS-232 board. Both have the same pin out on a 6-pin
  76. connector that mates with the upper row of J5.
  77. PIN MODULE BOARD J5
  78. --- ------ ---------------------------
  79. 1 5V 1 POWER Power jumper
  80. 2 GND 3 GND Ground
  81. 3 TXD 5 RXD1 PA10 USART1_RXD
  82. 4 RXD 7 TXD1 PA9 USART1_TXD
  83. 5 RTS? 9 CTS? PA12 USART1_RTS
  84. 6 CTS? 11 RTS? PA11 USART1_CTS
  85. PL-2013 USB-to-Serial Interface
  86. -------------------------------
  87. J37 - CON4. Jumper Settings:
  88. 1 <-> 3 : Connects PA9 to the RXD1 output pin
  89. 2 <-> 4 : Connects PA10 to the TXD1 input pin
  90. J35 - CON2. Jumper Setting:
  91. Open. the PL2303 adapter receives its power from the USB host.
  92. RS-232 Module
  93. -------------
  94. J37 - CON4. Jumper Settings:
  95. 1 <-> 3 : Connects PA9 to the RXD1 output pin
  96. 2 <-> 4 : Connects PA10 to the TXD1 input pin
  97. J35 - CON2. Jumper Setting:
  98. 1 <-> 2 : Proves 3.3V to the RS-232 module.
  99. USB Interface
  100. =============
  101. USB Connector
  102. -------------
  103. The Viewtool base board has a USB Mini-B connector. Only USB device can
  104. be supported with this connector.
  105. ------------------------- ------------------------------------
  106. USB Connector
  107. J10 mini-USB GPIO CONFIGURATION(s)
  108. --- --------- ----------- ------------------------------------
  109. Pin Signal
  110. --- --------- ----------- ------------------------------------
  111. 1 USB_VBUS VDD_USB (No sensing available)
  112. 2 OTG_DM PA11 GPIO_OTGFS_DM (F107) GPIO_USB_DM (F103)
  113. 3 OTG_DP PA12 GPIO_OTGFS_DP (F107) GPIO_USB_DP (F103)
  114. 4 OTG_ID PA10 GPIO_OTGFS_ID (F107)
  115. 5 Shield N/A N/A
  116. 6 Shield N/A N/A
  117. 7 Shield N/A N/A
  118. 8 Shield N/A N/A
  119. 9 Shield N/A N/A
  120. PE11 USB_EN GPIO controlled soft pull-up (if J51 closed)
  121. NOTES:
  122. 1. GPIO_OTGFS_VBUS (F107) should not be configured. No VBUS sensing
  123. 2. GPIO_OTGFS_SOF (F107) is not used
  124. 3. The OTG FS module has is own, internal soft pull-up logic. J51 should
  125. be open so that PE11 activity does effect USB.
  126. STM32F103 Configuration
  127. -----------------------
  128. System Type -> STM32 Peripheral Support
  129. CONFIG_STM32_USB=y : Enable USB FS device
  130. Device Drivers
  131. CONFIG_USBDEV : USB device support
  132. STATUS: All of the code is in place, but no testing has been performed.
  133. STM32F107 Configuration
  134. -----------------------
  135. System Type -> STM32 Peripheral Support
  136. CONFIG_STM32_OTGFS=y : Enable OTG FS
  137. Device Drivers
  138. CONFIG_USBDEV : USB device support
  139. STATUS: All of the code is in place, but USB is not yet functional.
  140. CDC/ACM Configuration
  141. ---------------------
  142. This will select the CDC/ACM serial device. Defaults for the other
  143. options should be okay.
  144. Device Drivers -> USB Device Driver Support
  145. CONFIG_CDCACM=y : Enable the CDC/ACM device
  146. The following setting enables an example that can can be used to control
  147. the CDC/ACM device. It will add two new NSH commands:
  148. a. sercon will connect the USB serial device (creating /dev/ttyACM0), and
  149. b. serdis which will disconnect the USB serial device (destroying
  150. /dev/ttyACM0).
  151. Application Configuration -> Examples:
  152. CONFIG_SYSTEM_CDCACM=y : Enable an CDC/ACM example
  153. USB MSC Configuration
  154. ---------------------
  155. [WARNING: This configuration has not yet been verified]
  156. The Mass Storage Class (MSC) class driver can be selected in order to
  157. export the microSD card to the host computer. MSC support is selected:
  158. Device Drivers -> USB Device Driver Support
  159. CONFIG_USBMSC=y : Enable the USB MSC class driver
  160. CONFIG_USBMSC_EPBULKOUT=1 : Use EP1 for the BULK OUT endpoint
  161. CONFIG_USBMSC_EPBULKIN=2 : Use EP2 for the BULK IN endpoint
  162. The following setting enables an add-on that can can be used to control
  163. the USB MSC device. It will add two new NSH commands:
  164. a. msconn will connect the USB serial device and export the microSD
  165. card to the host, and
  166. b. msdis which will disconnect the USB serial device.
  167. Application Configuration -> System Add-Ons:
  168. CONFIG_SYSTEM_USBMSC=y : Enable the USBMSC add-on
  169. CONFIG_SYSTEM_USBMSC_NLUNS=1 : One LUN
  170. CONFIG_SYSTEM_USBMSC_DEVMINOR1=0 : Minor device zero
  171. CONFIG_SYSTEM_USBMSC_DEVPATH1="/dev/mmcsd0"
  172. : Use a single, LUN: The microSD
  173. : block driver.
  174. NOTES:
  175. a. To prevent file system corruption, make sure that the microSD is un-
  176. mounted *before* exporting the mass storage device to the host:
  177. nsh> umount /mnt/sdcard
  178. nsh> mscon
  179. The microSD can be re-mounted after the mass storage class is disconnected:
  180. nsh> msdis
  181. nsh> mount -t vfat /dev/mtdblock0 /mnt/at25
  182. microSD Card Interface
  183. ======================
  184. microSD Connector
  185. -----------------
  186. ----------------------------- ------------------------- --------------------------------
  187. Connector J17 GPIO CONFIGURATION(s)
  188. PIN SIGNAL LEGEND (no remapping) DP83848C Board
  189. --- ------------- ----------- ------------------------- --------------------------------
  190. 1 VDD 3.3 N/A N/A 3.3
  191. 2 GND N/A N/A GND
  192. 3 PC8 SDIO_D0 GPIO_SDIO_D0 D0
  193. 4 PD2 SDIO_CMD GPIO_SDIO_CMD CMD
  194. 5 PC12 SDIO_CLK GPIO_SDIO_CK CLK
  195. 6 PC11 SDIO_D3 GPIO_SDIO_D3 D3
  196. 7 PC10 SDIO_D2 GPIO_SDIO_D2 D2
  197. 8 PC9 SDIO_D1 GPIO_SDIO_D1 D1
  198. 9 PA8 CD Board-specific GPIO input CD
  199. --- ------------- ----------- ------------------------- --------------------------------
  200. NOTES:
  201. 1. The STM32F107 does not support the SDIO/memory card interface. So the SD card
  202. cannot be used with the STM32F107 (unless the pin-out just happens to match up
  203. with an SPI-based card interface???)
  204. Configuration (STM32F103 only)
  205. ------------------------------
  206. [WARNING: This configuration has not yet been verified]
  207. Enabling SDIO-based MMC/SD support:
  208. System Type->STM32 Peripheral Support
  209. CONFIG_STM32_SDIO=y : Enable SDIO support
  210. CONFIG_STM32_DMA2=y : DMA2 is needed by the driver
  211. Device Drivers -> MMC/SD Driver Support
  212. CONFIG_MMCSD=y : Enable MMC/SD support
  213. CONFIG_MMSCD_NSLOTS=1 : One slot per driver instance
  214. CONFIG_MMCSD_HAVECARDDETECT=y : Supports card-detect PIOs
  215. CONFIG_MMCSD_MMCSUPPORT=n : Interferes with some SD cards
  216. CONFIG_MMCSD_SPI=n : No SPI-based MMC/SD support
  217. CONFIG_MMCSD_SDIO=y : SDIO-based MMC/SD support
  218. CONFIG_SDIO_DMA=y : Use SDIO DMA
  219. CONFIG_SDIO_BLOCKSETUP=y : Needs to know block sizes
  220. Library Routines
  221. CONFIG_SCHED_WORKQUEUE=y : Driver needs work queue support
  222. Application Configuration -> NSH Library
  223. CONFIG_NSH_ARCHINIT=y : NSH board-initialization
  224. Using the SD card
  225. -----------------
  226. 1) After booting, an SDIO device will appear as /dev/mmcsd0
  227. 2) If you try mounting an SD card with nothing in the slot, the
  228. mount will fail:
  229. nsh> mount -t vfat /dev/mmcsd1 /mnt/sd1
  230. nsh: mount: mount failed: 19
  231. STATUS: All of the code is in place, but no testing has been performed.
  232. ViewTool DP83848 Ethernet Module
  233. ================================
  234. Ethernet Connector
  235. ------------------
  236. ----------------------------- ------------------------ --------------------------------
  237. Connector J2 GPIO CONFIGURATION(s)
  238. PIN SIGNAL LEGEND (no remapping) DP83848C Board
  239. --- ------------- ----------- ------------------------ --------------------------------
  240. 1 PA0 MII_CRS N/A N/C
  241. 2 PB11/SDA2 COM_TX_EN GPIO_ETH_RMII_TX_EN TX_EN
  242. 3 PA3/LED_G2 MII_COL N/A N/C
  243. 4 PB12/NSS2 COM_TXD0 GPIO_ETH_RMII_TXD0 TXD0
  244. 5 PA1 MII_RX_CLK GPIO_ETH_RMII_REF_CLK OSCIN
  245. 6 PB13/SCK2 COM_TXD1 GPIO_ETH_RMII_TXD1 TXD1
  246. 7 PB1/CD_RESET MII_RXD3 N/A N/C
  247. 8 PC4/LCDTP COM_RXD0 GPIO_ETH_RMII_RXD0 RXD0
  248. 9 PB0/BL_PWM MII_RXD2 N/A N/C
  249. 10 PC5 COM_RXD1 GPIO_ETH_RMII_RXD1 RXD1
  250. 11 PB8/CAN1_RX MII_TXD3 N/A N/C
  251. 12 PC1/LED_R1 COM_MDC GPIO_ETH_MDC MDC
  252. 13 PC2/LED_R2 MII_TXD2 N/A N/C
  253. 14 PA2/LED_G1 COM_MDIO GPIO_ETH_MDIO MDIO
  254. 15 PC3/ONEW MII_TX_CLK N/A N/C
  255. 16 PB10/SCL2 RX_ER N/A N/C
  256. 17 PD2 GPIO1 N/A N/C
  257. 18 PA7/MOSI1 COM_RX_DV GPIO_ETH_RMII_CRS_DV CRS_DIV
  258. 19 PD3 GPIO2 N/A N/C
  259. 20 PB5 COM_PPS_OUT N/A N/C
  260. 21 VDD 3.3 VDD_3.3 N/A 3.3V
  261. 22 VDD 3.3 VDD_3.3 N/A 3.3V
  262. 23 GND GND N/A GND
  263. 24 GND GND N/A GND
  264. --- ------------- ----------- ------------------------ --------------------------------
  265. NOTES:
  266. 1. RMII interface is used
  267. 2. There is a 50MHz clock on board the DP83848. No MCO clock need be provided.
  268. Configuration
  269. -------------
  270. System Type -> STM32 Peripheral Support
  271. CONFIG_STM32_ETHMAC=y : Enable Ethernet driver
  272. System Type -> Ethernet MAC Configuration
  273. CONFIG_STM32_RMII=y : Configuration RM-II DP83848C PHY
  274. CONFIG_STM32_AUTONEG=y
  275. CONFIG_STM32_PHYADDR=1
  276. CONFIG_STM32_PHYSR=16
  277. CONFIG_STM32_PHYSR_SPEED=0x0002
  278. CONFIG_STM32_PHYSR_100MBPS=0x0000
  279. CONFIG_STM32_PHYSR_MODE=0x0004
  280. CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004
  281. CONFIG_STM32_RMII_EXTCLK=y
  282. Device Drivers -> Networking Devices
  283. CONFIG_NETDEVICES=y : More PHY stuff
  284. CONFIG_ETH0_PHY_DP83848C=y
  285. Networking (required)
  286. CONFIG_NET=y : Enabled networking support
  287. CONFIG_NSH_NOMAC=y
  288. Networking (recommended/typical)
  289. CONFIG_NSOCKET_DESCRIPTORS=10 : Socket-related
  290. CONFIG_NET_SOCKOPTS=y
  291. CONFIG_NET_ETH_MTU=650 : Maximum packet size
  292. CONFIG_NET_ETH_TCP_RECVWNDO=650
  293. CONFIG_NET_TCP_READAHEAD=y : Enable read-ahead buffering
  294. CONFIG_NET_TCP_READAHEAD_BUFSIZE=650
  295. CONFIG_NET_TCP=y : TCP support
  296. CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
  297. CONFIG_NET_UDP=y : UDP support
  298. CONFIG_NET_UDP_CONNS=8
  299. CONFIG_NET_ICMP=y : ICMP support
  300. CONFIG_NET_ICMP_PING=y
  301. CONFIG_NSH_DRIPADDR=0x0a000001 : Network identity
  302. CONFIG_NSH_IPADDR=0x0a000002
  303. CONFIG_NSH_NETMASK=0xffffff00
  304. Network Utilities (basic)
  305. CONFIG_NETUTILS_TFTPC=y : Needed by NSH unless to disable TFTP commands
  306. CONFIG_NETUTILS_DHCPC=y : Fun stuff
  307. CONFIG_NETUTILS_TELNETD=y : Support for a Telnet NSH console
  308. CONFIG_NSH_TELNET=y
  309. (also FTP, TFTP, WGET, NFS, etc. if you also have a mass storage
  310. device).
  311. Freescale MPL115A barometer sensor
  312. ==================================
  313. This board support package includes hooks that can be used to enable
  314. testing of a Freescale MPL115A barometer sensor connected via SPI3 with
  315. chip select on PB6,
  316. Here are the configuration settings that would have to be included to
  317. enabled support for the barometer:
  318. System Type -> Peripherals
  319. CONFIG_STM32_SPI3=y
  320. Drivers -> SPI
  321. CONFIG_SPI=y
  322. CONFIG_SPI_EXCHANGE=y
  323. Drivers -> Sensors
  324. CONFIG_SENSORS=y
  325. CONFIG_MPL115A=y
  326. CONFIG_NSH_ARCHINIT=y
  327. Note: this driver uses SPI3 then since PB3 pin is also use to JTAG TDO you
  328. need to disable JTAG support to get this driver working:
  329. System Type
  330. CONFIG_STM32_JTAG_DISABLE=y
  331. LCD/Touchscreen Interface
  332. =========================
  333. An LCD may be connected via J11. Only the STM32F103 supports the FSMC signals
  334. needed to drive the LCD.
  335. The LCD features an (1) HY32D module with built-in SSD1289 LCD controller, and (a)
  336. a XPT2046 touch screen controller.
  337. LCD Connector
  338. -------------
  339. ----------------------------- ------------------------ --------------------------------
  340. Connector J11 GPIO CONFIGURATION(s)
  341. PIN SIGNAL LEGEND (F103 only) LCD Module
  342. --- ------------- ----------- ------------------------ --------------------------------
  343. 1 VDD_5 NC N/A 5V ---
  344. 2 GND GND N/A GND ---
  345. 3 PD14 DATA0 GPIO_NPS_D0 D0 HY32D
  346. 4 PD15 DATA1 GPIO_NPS_D1 D1 HY32D
  347. 5 PD0 DATA2 GPIO_NPS_D2 D2 HY32D
  348. 6 PD1 DATA3 GPIO_NPS_D3 D3 HY32D
  349. 7 PE7 DATA4 GPIO_NPS_D4 D4 HY32D
  350. 8 PE8 DATA5 GPIO_NPS_D5 D5 HY32D
  351. 9 PE9 DATA6 GPIO_NPS_D6 D6 HY32D
  352. 10 PE10 DATA7 GPIO_NPS_D7 D7 HY32D
  353. 11 PE11 DATA8 GPIO_NPS_D8 D8 HY32D
  354. 12 PE12 DATA9 GPIO_NPS_D9 D9 HY32D
  355. 13 PE13 DATA10 GPIO_NPS_D10 D10 HY32D
  356. 14 PE14 DATA11 GPIO_NPS_D11 D11 HY32D
  357. 15 PE15 DATA12 GPIO_NPS_D12 D12 HY32D
  358. 16 PD8 DATA13 GPIO_NPS_D13 D13 HY32D
  359. 17 PD9 DATA14 GPIO_NPS_D14 D14 HY32D
  360. 18 PD10 DATA15 GPIO_NPS_D15 D15 HY32D
  361. 19 (3) LCD_CS GPIO_NPS_NE1 CS HY32D
  362. 20 PD11 LCD_RS GPIO_NPS_A16 RS HY32D
  363. 21 PD5 LCD_R/W GPIO_NPS_NWE WR HY32D
  364. 22 PD4 LCD_RD GPIO_NPS_NOE RD HY32D
  365. 23 PB1 LCD_RESET (GPIO) RESET HY32D
  366. 24 N/C NC N/A TE (unused?)
  367. 25 VDD_3.3 BL_VCC N/A BLVDD CA6219 (Drives LCD backlight)
  368. 26 GND BL_GND N/A BLGND CA6219
  369. 27 PB0 BL_PWM GPIO_TIM3_CH3OUT(2) BL_CNT CA6219
  370. 28 PC5 LCDTP_IRQ (GPIO) TP_IRQ XPT2046
  371. 29 PC4 LCDTP_CS (GPIO) TP_CS XPT2046
  372. 30 PB13 LCDTP_CLK GPIO_SPI2_SCK TP_SCK XPT2046
  373. 31 PB15 LCDTP_DIN GPIO_SPI2_MOSI TP_SI XPT2046
  374. 32 PB14 LCDTP_DOUT GPIO_SPI2_MISO TP_SO XPT2046
  375. 33 VDD_3.3 VDD_3.3 N/A 3.3V ---
  376. 34 GND GND N/A GND ---
  377. --- ------------- ----------- ------------------------ --------------------------------
  378. NOTES:
  379. 1) Only the F103 version of the board supports the FSMC
  380. 2) No remap
  381. 3) LCD_CS is controlled by J13 JUMPER4 (under the LCD unfortunately):
  382. 1->2 : PD7 (GPIO_NPS_NE1) enables the multiplexor : 1E\ enable input (active LOW)
  383. 3->4 : PD13 provides 1A0 input (1A1 is grounded). : 1A0 address input
  384. So will chip enable to either LCD_CS or
  385. Flash_CS.
  386. 5->6 : 1Y0 output to LCD_CS : 1Y0 address output
  387. 7->8 : 1Y1 output to Flash_CE : 1Y1 address output
  388. Truth Table:
  389. 1E\ 1A0 1A1 1Y0 1Y1
  390. --- --- --- --- ---
  391. HI N/A N/A HI HI
  392. LO LO LO LO HI
  393. LO HI LO HI LO
  394. Toolchains
  395. ==========
  396. NOTE about Windows native toolchains
  397. ------------------------------------
  398. There are several limitations to using a Windows based toolchain in a
  399. Cygwin environment. The three biggest are:
  400. 1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
  401. performed automatically in the Cygwin makefiles using the 'cygpath'
  402. utility but you might easily find some new path problems. If so, check
  403. out 'cygpath -w'
  404. 2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic
  405. links are used in Nuttx (e.g., include/arch). The make system works
  406. around these problems for the Windows tools by copying directories
  407. instead of linking them. But this can also cause some confusion for
  408. you: For example, you may edit a file in a "linked" directory and find
  409. that your changes had no effect. That is because you are building the
  410. copy of the file in the "fake" symbolic directory. If you use a\
  411. Windows toolchain, you should get in the habit of making like this:
  412. make clean_context all
  413. An alias in your .bashrc file might make that less painful.
  414. Configurations
  415. ==============
  416. Information Common to All Configurations
  417. ----------------------------------------
  418. Each SAM3U-EK configuration is maintained in a sub-directory and
  419. can be selected as follow:
  420. cd tools
  421. ./configure.sh viewtool-stm32f107/<subdir>
  422. cd -
  423. Before starting the build, make sure that your PATH environment variable
  424. includes the correct path to your toolchain.
  425. And then build NuttX by simply typing the following. At the conclusion of
  426. the make, the nuttx binary will reside in an ELF file called, simply, nuttx.
  427. make
  428. The <subdir> that is provided above as an argument to the tools/configure.sh
  429. must be is one of the following.
  430. NOTES:
  431. 1. These configurations use the mconf-based configuration tool. To
  432. change any of these configurations using that tool, you should:
  433. a. Build and install the kconfig-mconf tool. See nuttx/README.txt
  434. see additional README.txt files in the NuttX tools repository.
  435. b. Execute 'make menuconfig' in nuttx/ in order to start the
  436. reconfiguration process.
  437. 2. Unless stated otherwise, all configurations generate console
  438. output on USART1.
  439. 3. Unless otherwise stated, the configurations are setup for
  440. Cygwin under Windows:
  441. Build Setup:
  442. CONFIG_HOST_WINDOWS=y : Windows operating system
  443. CONFIG_WINDOWS_CYGWIN=y : POSIX environment under windows
  444. 4. All of these configurations use the CodeSourcery for Windows toolchain
  445. (unless stated otherwise in the description of the configuration). That
  446. toolchain selection can easily be reconfigured using 'make menuconfig'.
  447. Here are the relevant current settings:
  448. System Type -> Toolchain:
  449. CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : GNU EABI toolchain for windows
  450. See also the "NOTE about Windows native toolchains" in the section call
  451. "GNU Toolchain Options" above.
  452. 4. These configurations all assume that the STM32F107VCT6 is mounted on
  453. board. This is configurable; you can select the STM32F103VCT6 as an
  454. alternative.
  455. 5. These configurations all assume that you are loading code using
  456. something like the ST-Link v2 JTAG. None of these configurations are
  457. setup to use the DFU bootloader but should be easily reconfigured to
  458. use that bootloader is so desired.
  459. Configuration Sub-directories
  460. -----------------------------
  461. netnsh:
  462. This configuration directory provide the NuttShell (NSH) with
  463. networking support.
  464. NOTES:
  465. 1. This configuration will work only on the version the viewtool
  466. board with the STM32F107VCT6 installed. If you have a board
  467. with the STM32F103VCT6 installed, please use the nsh configuration
  468. described below.
  469. 2. There is no PHY on the base viewtool stm32f107 board. You must
  470. also have the "ViewTool DP83848 Ethernet Module" installed on J2
  471. in order to support networking.
  472. 3. Since networking is enabled, you will see some boot-up delays when
  473. the network connection is established. These delays can be quite
  474. large if no network is attached (A production design to bring up the
  475. network asynchronously to avoid these start up delays).
  476. 4. This configuration uses the default USART1 serial console. That
  477. is easily changed by reconfiguring to (1) enable a different
  478. serial peripheral, and (2) selecting that serial peripheral as
  479. the console device.
  480. 5. By default, this configuration is set up to build on Windows
  481. under either a Cygwin or MSYS environment using a recent, Windows-
  482. native, generic ARM EABI GCC toolchain (such as the CodeSourcery
  483. toolchain). Both the build environment and the toolchain
  484. selection can easily be changed by reconfiguring:
  485. CONFIG_HOST_WINDOWS=y : Windows operating system
  486. CONFIG_WINDOWS_CYGWIN=y : POSIX environment under windows
  487. CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery for Windows
  488. 6. USB support is disabled by default. See the section above entitled,
  489. "USB Interface"
  490. STATUS. The first time I build the configuration, I get some undefined
  491. external references. No idea why. Simply cleaning the apps/ directory
  492. and rebuilding fixes the problem:
  493. make apps_clean all
  494. nsh:
  495. This configuration directory provide the basic NuttShell (NSH).
  496. NOTES:
  497. 1. This configuration will work with either the version of the board
  498. with STM32F107VCT6 or STM32F103VCT6 installed. The default
  499. configuration is for the STM32F107VCT6. To use this configuration
  500. with a STM32F103VCT6, it would have to be modified as follows:
  501. System Type -> STM32 Configuration Options
  502. CONFIG_ARCH_CHIP_STM32F103VC=y
  503. CONFIG_ARCH_CHIP_STM32F107VC=n
  504. 2. This configuration uses the default USART1 serial console. That
  505. is easily changed by reconfiguring to (1) enable a different
  506. serial peripheral, and (2) selecting that serial peripheral as
  507. the console device.
  508. 3. By default, this configuration is set up to build on Windows
  509. under either a Cygwin or MSYS environment using a recent, Windows-
  510. native, generic ARM EABI GCC toolchain (such as the CodeSourcery
  511. toolchain). Both the build environment and the toolchain
  512. selection can easily be changed by reconfiguring:
  513. CONFIG_HOST_WINDOWS=y : Windows operating system
  514. CONFIG_WINDOWS_CYGWIN=y : POSIX environment under windows
  515. CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery for Windows
  516. 4. USB support is disabled by default. See the section above entitled,
  517. "USB Interface"
  518. 3. This configured can be re-configured to use either the Viewtool LCD
  519. module. NOTE: The LCD module can only be used on the STM32F103 version
  520. of the board. The LCD requires FSMC support.
  521. System Type -> STM32 Chip Selection:
  522. CONFIG_ARCH_CHIP_STM32F103VC=y : Select STM32F103VCT6
  523. System Type -> Peripherals:
  524. CONFIG_STM32_FSMC=y : Enable FSMC LCD interface
  525. Device Drivers -> LCD Driver Support
  526. CONFIG_LCD=y : Enable LCD support
  527. CONFIG_NX_LCDDRIVER=y : LCD graphics device
  528. CONFIG_LCD_MAXCONTRAST=1
  529. CONFIG_LCD_MAXPOWER=255
  530. CONFIG_LCD_LANDSCAPE=y : Landscape orientation
  531. CONFIG_LCD_SSD1289=y : Select the SSD1289
  532. CONFIG_SSD1289_PROFILE1=y
  533. Graphics Support
  534. CONFIG_NX=y
  535. Graphics Support -> Supported Pixel Depths
  536. CONFIG_NX_DISABLE_1BPP=y : Only 16BPP supported
  537. CONFIG_NX_DISABLE_2BPP=y
  538. CONFIG_NX_DISABLE_4BPP=y
  539. CONFIG_NX_DISABLE_8BPP=y
  540. CONFIG_NX_DISABLE_24BPP=y
  541. CONFIG_NX_DISABLE_32BPP=y
  542. Graphics Support -> Font Selections
  543. CONFIG_NXFONTS_CHARBITS=7
  544. CONFIG_NXFONT_SANS22X29B=y
  545. CONFIG_NXFONT_SANS23X27=y
  546. Application Configuration -> Examples
  547. CONFIG_EXAMPLES_NXLINES=y
  548. CONFIG_EXAMPLES_NXLINES_BGCOLOR=0x0320
  549. CONFIG_EXAMPLES_NXLINES_LINEWIDTH=16
  550. CONFIG_EXAMPLES_NXLINES_LINECOLOR=0xffe0
  551. CONFIG_EXAMPLES_NXLINES_BORDERWIDTH=4
  552. CONFIG_EXAMPLES_NXLINES_BORDERCOLOR=0xffe0
  553. CONFIG_EXAMPLES_NXLINES_CIRCLECOLOR=0xf7bb
  554. CONFIG_EXAMPLES_NXLINES_BPP=16
  555. STATUS: Not working; reads 0x8999 as device ID. This may perhaps
  556. be due to incorrect jumper settings
  557. 6. This configuration has been used for verifying the touchscreen on
  558. on the Viewtool LCD module. NOTE: The LCD module can really only
  559. be used on the STM32F103 version of the board. The LCD requires
  560. FSMC support (the touchscreen, however, does not but the touchscreen
  561. is not very meaningful with no LCD).
  562. System Type -> STM32 Chip Selection:
  563. CONFIG_ARCH_CHIP_STM32F103VC=y : Select STM32F103VCT6
  564. With the following modifications, you can include the touchscreen
  565. test program at apps/examples/touchscreen as an NSH built-in
  566. application. You can enable the touchscreen and test by modifying
  567. the default configuration in the following ways:
  568. Device Drivers
  569. CONFIG_SPI=y : Enable SPI support
  570. CONFIG_SPI_EXCHANGE=y : The exchange() method is supported
  571. CONFIG_INPUT=y : Enable support for input devices
  572. CONFIG_INPUT_ADS7843E=y : Enable support for the XPT2046
  573. CONFIG_ADS7843E_SPIDEV=2 : Use SPI2 for communication
  574. CONFIG_ADS7843E_SPIMODE=0 : Use SPI mode 0
  575. CONFIG_ADS7843E_FREQUENCY=1000000 : SPI BAUD 1MHz
  576. CONFIG_ADS7843E_SWAPXY=y : If landscape orientation
  577. CONFIG_ADS7843E_THRESHX=51 : These will probably need to be tuned
  578. CONFIG_ADS7843E_THRESHY=39
  579. System Type -> Peripherals:
  580. CONFIG_STM32_SPI2=y : Enable support for SPI2
  581. RTOS Features:
  582. CONFIG_DISABLE_SIGNALS=n : Signals are required
  583. Library Support:
  584. CONFIG_SCHED_WORKQUEUE=y : Work queue support required
  585. Applicaton Configuration:
  586. CONFIG_EXAMPLES_TOUCHSCREEN=y : Enable the touchscreen built-int test
  587. Defaults should be okay for related touchscreen settings. Touchscreen
  588. debug output on USART1 can be enabled with:
  589. Build Setup:
  590. CONFIG_DEBUG_FEATURES=y : Enable debug features
  591. CONFIG_DEBUG_INFO=y : Enable verbose debug output
  592. CONFIG_DEBUG_INPUT=y : Enable debug output from input devices
  593. STATUS: Working
  594. highpri:
  595. This configuration was used to verify the NuttX high priority, nested
  596. interrupt feature. This is a board-specific test and probably not
  597. of much interest now other than for reference.
  598. This configuration targets the viewtool board with the STM32F103VCT6
  599. mounted. It uses TIM6 to generated high rate interrupts for the test.