README.txt 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. README
  2. ======
  3. This README discusses issues unique to NuttX configurations for the
  4. STM32F103C8T6 Minimum System Development Board for ARM Microcontroller.
  5. Contents
  6. ========
  7. - STM32F103C8T6 Minimum System Development Boards:
  8. - LEDs
  9. - UARTs
  10. - Timer Inputs/Outputs
  11. - Using 128KiB of Flash instead of 64KiB
  12. - Quadrature Encoder
  13. - SDCard support
  14. - SPI NOR Flash
  15. - Nokia 5110 LCD Display support
  16. - USB Console support
  17. - STM32F103 Minimum - specific Configuration Options
  18. - Configurations
  19. STM32F103C8T6 Minimum System Development Boards:
  20. ================================================
  21. This STM32F103C8T6 minimum system development board is available from
  22. several vendors on the net, and may be sold under different names or
  23. no name at all. It is based on a STM32F103C8T6 and has a DIP-40 form-
  24. factor.
  25. There are two versions of very similar boards: One is red and one is
  26. blue. See http://www.stm32duino.com/viewtopic.php?f=28&t=117
  27. The Red Board:
  28. Good things about the red board:
  29. - 1.5k pull up resistor on the PA12 pin (USB D+) which you can
  30. programatically drag down for automated USB reset.
  31. - large power capacitors and LDO power.
  32. Problems with the red board:
  33. - Silk screen is barely readable, the text is chopped off on some of
  34. the pins
  35. - USB connector only has two anchor points and it is directly soldered
  36. on the surface
  37. - Small reset button with hardly any resistance
  38. The Blue Board:
  39. Good things about the blue board:
  40. - Four soldered anchor point on the USB connector. What you can't tell
  41. from this picture is that there is a notch in the pcb board and the USB
  42. connector sits down inside it some. This provides some lateral stability
  43. that takes some of the stress off the solder points.
  44. - It has nice clear readable silkscreen printing.
  45. - It also a larger reset button.
  46. Problems with the blue board:
  47. - Probably won't work as a USB device if it has a 10k pull-up on PA12. You
  48. have to check the pull up on PA12 (USB D+). If it has a 10k pull-up
  49. resistor, you will need to replace it with a 1.5k one to use the native
  50. USB.
  51. - Puny voltage regulator probably 100mA.
  52. A schematic for the blue board is available here:
  53. http://www.stm32duino.com/download/file.php?id=276
  54. Both Boards:
  55. Nice features common to both:
  56. - SWD pins broken out and easily connected (VCC, GND, SWDIO, SWCLK)
  57. - USB 5V is broken out with easy access.
  58. - User LED on PC13
  59. - Power LED
  60. - You can probably use more flash (128k) than officially documented for
  61. the chip (stm32f103c8t6 64k), I was able to load 115k of flash on mine
  62. and it seemed to work.
  63. Problems with both boards:
  64. - No preloaded bootloader * to me this isn't really a problem as the
  65. entire 64k of flash is available for use
  66. - No user button
  67. This is the board pinout based on its form-factor for the Blue board:
  68. USB
  69. ___
  70. -----/ _ \-----
  71. |B12 GND|
  72. |B13 GND|
  73. |B14 3.3V|
  74. |B15 RST|
  75. |A8 B11|
  76. |A9 B10|
  77. |A10 B1|
  78. |A11 B0|
  79. |A12 A7|
  80. |A15 A6|
  81. |B3 A5|
  82. |B4 A4|
  83. |B5 A3|
  84. |B6 A2|
  85. |B7 A1|
  86. |B8 A0|
  87. |B9 C15|
  88. |5V C14|
  89. |GND C13|
  90. |3.3V VB|
  91. |_____________|
  92. LEDs
  93. ====
  94. The STM32F103 Minimum board has only one software controllable LED.
  95. This LED can be used by the board port when CONFIG_ARCH_LEDS option is
  96. enabled.
  97. If enabled the LED is simply turned on when the board boots
  98. succesfully, and is blinking on panic / assertion failed.
  99. UARTs
  100. =====
  101. UART/USART PINS
  102. ---------------
  103. USART1
  104. RX PA10
  105. TX PA9
  106. USART2
  107. CK PA4
  108. CTS PA0
  109. RTS PA1
  110. RX PA3
  111. TX PA2
  112. USART3
  113. CK PB12
  114. CTS PB13
  115. RTS PB14
  116. RX PB11
  117. TX PB10
  118. Default USART/UART Configuration
  119. --------------------------------
  120. USART1 (RX & TX only) is available through pins PA9 (TX) and PA10 (RX).
  121. Timer Inputs/Outputs
  122. ====================
  123. TIM1
  124. CH1 PA8
  125. CH2 PA9*
  126. CH3 PA10*
  127. CH4 PA11*
  128. TIM2
  129. CH1 PA0*, PA15, PA5
  130. CH2 PA1, PB3
  131. CH3 PA2, PB10*
  132. CH4 PA3, PB11
  133. TIM3
  134. CH1 PA6, PB4
  135. CH2 PA7, PB5*
  136. CH3 PB0
  137. CH4 PB1*
  138. TIM4
  139. CH1 PB6*
  140. CH2 PB7
  141. CH3 PB8
  142. CH4 PB9*
  143. * Indicates pins that have other on-board functions and should be used only
  144. with care (See board datasheet).
  145. Using 128KiB of Flash instead of 64KiB
  146. ======================================
  147. Some people figured out that the STM32F103C8T6 has 128KiB of internal memory
  148. instead of 64KiB as documented in the datasheet and reported by its internal
  149. register.
  150. In order to enable 128KiB you need modify the linker script to reflect this
  151. new size. Open the configs/stm32f103-minimum/scripts/ld.script and replace:
  152. flash (rx) : ORIGIN = 0x08000000, LENGTH = 64K
  153. with
  154. flash (rx) : ORIGIN = 0x08000000, LENGTH = 128K
  155. Enable many NuttX features (ie. many filesystems and applications) to get a
  156. large binary image with more than 64K.
  157. We will use OpenOCD to write the firmware in the STM32F103C8T6 Flash. Use a
  158. up to dated OpenOCD version (ie. openocd-0.9).
  159. You will need to create a copy of original openocd/scripts/target/stm32f1x.cfg
  160. to openocd/scripts/target/stm32f103c8t6.cfg and edit the later file replacing:
  161. flash bank $_FLASHNAME stm32f1x 0x08000000 0 0 0 $_TARGETNAME
  162. with
  163. flash bank $_FLASHNAME stm32f1x 0x08000000 0x20000 0 0 $_TARGETNAME
  164. We will use OpenOCD with STLink-V2 programmer, but it will work with other
  165. programmers (JLink, Versaloon, or some based on FTDI FT232, etc).
  166. Open a terminal and execute:
  167. $ sudo openocd -f interface/stlink-v2.cfg -f target/stm32f103c8t6.cfg
  168. Now in other terminal execute:
  169. $ telnet localhost 4444
  170. Trying 127.0.0.1...
  171. Connected to localhost.
  172. Escape character is '^]'.
  173. Open On-Chip Debugger
  174. > reset halt
  175. stm32f1x.cpu: target state: halted
  176. target halted due to debug-request, current mode: Thread
  177. xPSR: 0x01000000 pc: 0x080003ac msp: 0x20000d78
  178. > flash write_image erase nuttx.bin 0x08000000
  179. auto erase enabled
  180. device id = 0x20036410
  181. ignoring flash probed value, using configured bank size
  182. flash size = 128kbytes
  183. stm32f1x.cpu: target state: halted
  184. target halted due to breakpoint, current mode: Thread
  185. xPSR: 0x61000000 pc: 0x2000003a msp: 0x20000d78
  186. wrote 92160 bytes from file nuttx.bin in 4.942194s (18.211 KiB/s)
  187. > reset run
  188. > exit
  189. Now NuttX should start normally.
  190. Quadrature Encoder:
  191. ===================
  192. The nsh configuration has been used to test the Quadrture Encoder
  193. (QEncoder, QE) with the following modifications to the configuration
  194. file:
  195. - These setting enable support for the common QEncode upper half driver:
  196. CONFIG_SENSORS=y
  197. CONFIG_QENCODER=y
  198. - This is a board setting that selected timer 4 for use with the
  199. quadrature encode:
  200. CONFIG_STM32F103MINIMUM_QETIMER=4
  201. - These settings enable the STM32 Quadrature encoder on timer 4:
  202. CONFIG_STM32_TIM4_CAP=y
  203. CONFIG_STM32_TIM4_QE=y
  204. CONFIG_STM32_TIM4_QECLKOUT=2800000
  205. CONFIG_STM32_QENCODER_FILTER=y
  206. CONFIG_STM32_QENCODER_SAMPLE_EVENT_6=y
  207. CONFIG_STM32_QENCODER_SAMPLE_FDTS_4=y
  208. - These settings enable the test case at apps/examples/qencoder:
  209. CONFIG_EXAMPLES_QENCODER=y
  210. CONFIG_EXAMPLES_QENCODER_DELAY=100
  211. CONFIG_EXAMPLES_QENCODER_DEVPATH="/dev/qe0"
  212. In this configuration, the QEncoder inputs will be on the TIM4 inputs of
  213. PB6 and PB7.
  214. SPI NOR Flash support:
  215. ======================
  216. We can use an extern SPI NOR Flash with STM32F103-Minimum board. In this case
  217. we tested the Winboard W25Q32FV (32Mbit = 4MiB).
  218. You can connect the W25Q32FV module in the STM32F103 Minimum board this way:
  219. connect PA5 (SPI1 CLK) to CLK; PA7 (SPI1 MOSI) to DI; PA6 (SPI MISO) to DO;
  220. PA4 to /CS; Also connect 3.3V to VCC and GND to GND.
  221. You can start with default "stm32f103-minimum/nsh" configuration option and
  222. enable/disable these options using "make menuconfig" :
  223. System Type --->
  224. STM32 Peripheral Support --->
  225. [*] SPI1
  226. Board Selection --->
  227. [*] MTD driver for external 4Mbyte W25Q32FV FLASH on SPI1
  228. (0) Minor number for the FLASH /dev/smart entry
  229. [*] Enable partition support on FLASH
  230. (1024,1024,1024,1024) Flash partition size list
  231. RTOS Features --->
  232. Stack and heap information --->
  233. (512) Idle thread stack size
  234. (1024) Main thread stack size
  235. (256) Minimum pthread stack size
  236. (1024) Default pthread stack size
  237. Device Drivers --->
  238. -*- Memory Technology Device (MTD) Support --->
  239. [*] Support MTD partitions
  240. -*- SPI-based W25 FLASH
  241. (0) W25 SPI Mode
  242. (20000000) W25 SPI Frequency
  243. File Systems --->
  244. [ ] Disable pseudo-filesystem operations
  245. -*- SMART file system
  246. (0xff) FLASH erased state
  247. (16) Maximum file name length
  248. Memory Management --->
  249. [*] Small memory model
  250. Also change the configs/stm32f103-minimum/scripts/ld.script file to use 128KB
  251. of Flash instead 64KB (since this board has a hidden 64KB flash) :
  252. MEMORY
  253. {
  254. flash (rx) : ORIGIN = 0x08000000, LENGTH = 128K
  255. sram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
  256. }
  257. Then after compiling and flashing the file nuttx.bin you can format and mount
  258. the flash this way:
  259. nsh> mksmartfs /dev/smart0p0
  260. nsh> mksmartfs /dev/smart0p1
  261. nsh> mksmartfs /dev/smart0p2
  262. nsh> mksmartfs /dev/smart0p3
  263. nsh> mount -t smartfs /dev/smart0p0 /mnt
  264. nsh> ls /mnt
  265. /mnt:
  266. nsh> echo "Testing" > /mnt/file.txt
  267. nsh> ls /mnt
  268. /mnt:
  269. file.txt
  270. nsh> cat /mnt/file.txt
  271. Testing
  272. nsh>
  273. SDCard support:
  274. ===============
  275. Only STM32F103xx High-density devices has SDIO controller. STM32F103C8T6 is a
  276. Medium-density device, but we can use SDCard over SPI.
  277. You can do that enabling these options:
  278. CONFIG_FS_FAT=y
  279. CONFIG_FS_WRITABLE=y
  280. CONFIG_MMCSD=y
  281. CONFIG_MMCSD_NSLOTS=1
  282. CONFIG_MMCSD_SPI=y
  283. CONFIG_MMCSD_SPICLOCK=20000000
  284. CONFIG_MMCSD_SPIMODE=0
  285. CONFIG_STM32_SPI=y
  286. CONFIG_STM32_SPI1=y
  287. CONFIG_SPI=y
  288. CONFIG_SPI_CALLBACK=y
  289. CONFIG_SPI_EXCHANGE=y
  290. And connect a SDCard/SPI board on SPI1. Connect the CS pin to PA4, SCK to
  291. PA5, MOSI to PA7 and MISO to PA6. Note: some chinese boards use MOSO instead
  292. of MISO.
  293. Nokia 5110 LCD Display support:
  294. ===============================
  295. You can connect a low cost Nokia 5110 LCD display in the STM32F103 Minimum
  296. board this way: connect PA5 (SPI1 CLK) to CLK; PA7 (SPI1 MOSI) to DIN; PA4
  297. to CE; PA3 to RST; PA2 to DC. Also connect 3.3V to VCC and GND to GND.
  298. You can start with default "stm32f103-minimum/nsh" configuration option and
  299. enable these options using "make menuconfig" :
  300. System Type --->
  301. STM32 Peripheral Support --->
  302. [*] SPI1
  303. Device Drivers --->
  304. -*- SPI Driver Support --->
  305. [*] SPI exchange
  306. [*] SPI CMD/DATA
  307. Device Drivers --->
  308. LCD Driver Support --->
  309. [*] Graphic LCD Driver Support --->
  310. [*] Nokia 5110 LCD Display (Philips PCD8544)
  311. (1) Number of PCD8544 Devices
  312. (84) PCD8544 X Resolution
  313. (48) PCD8544 Y Resolution
  314. Graphics Support --->
  315. [*] NX Graphics
  316. (1) Number of Color Planes
  317. (0x0) Initial background color
  318. Supported Pixel Depths --->
  319. [ ] Disable 1 BPP
  320. [*] Packed MS First
  321. Font Selections --->
  322. (7) Bits in Character Set
  323. [*] Mono 5x8
  324. Application Configuration --->
  325. Examples --->
  326. [*] NX graphics "Hello, World!" example
  327. (1) Bits-Per-Pixel
  328. After compiling and flashing the nuttx.bin inside the board, reset it.
  329. You should see it:
  330. NuttShell (NSH)
  331. nsh> ?
  332. help usage: help [-v] [<cmd>]
  333. [ dd free mb sh usleep
  334. ? echo help mh sleep xd
  335. cat exec hexdump mw test
  336. cd exit kill pwd true
  337. cp false ls set unset
  338. Builtin Apps:
  339. nxhello
  340. Now just run nxhello and you should see "Hello World" in the display:
  341. nsh> nxhello
  342. USB Console support:
  343. ====================
  344. The STM32F103C8 has a USB Device controller, then we can use NuttX support
  345. to USB Device. We can the console over USB enabling these options:
  346. System Type --->
  347. STM32 Peripheral Support --->
  348. [*] USB Device
  349. It will enable: CONFIG_STM32_USB=y
  350. Board Selection --->
  351. -*- Enable boardctl() interface
  352. [*] Enable USB device controls
  353. It will enable: CONFIG_BOARDCTL_USBDEVCTRL=y
  354. Device Drivers --->
  355. -*- USB Device Driver Support --->
  356. [*] USB Modem (CDC/ACM) support --->
  357. It will enable: CONFIG_CDCACM=y and many default options.
  358. Device Drivers --->
  359. -*- USB Device Driver Support --->
  360. [*] USB Modem (CDC/ACM) support --->
  361. [*] CDC/ACM console device
  362. It will enable: CONFIG_CDCACM_CONSOLE=y
  363. Device Drivers --->
  364. [*] Serial Driver Support --->
  365. Serial console (No serial console) --->
  366. (X) No serial console
  367. It will enable: CONFIG_NO_SERIAL_CONSOLE=y
  368. After flashing the firmware in the board, unplug and plug it in the computer
  369. and it will create a /dev/ttyACM0 device in the Linux. Use minicom with this
  370. device to get access to NuttX NSH console (press Enter three times to start)
  371. STM32F103 Minimum - specific Configuration Options
  372. ==================================================
  373. CONFIG_ARCH - Identifies the arch/ subdirectory. This should
  374. be set to:
  375. CONFIG_ARCH=arm
  376. CONFIG_ARCH_family - For use in C code:
  377. CONFIG_ARCH_ARM=y
  378. CONFIG_ARCH_architecture - For use in C code:
  379. CONFIG_ARCH_CORTEXM3=y
  380. CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory
  381. CONFIG_ARCH_CHIP=stm32
  382. CONFIG_ARCH_CHIP_name - For use in C code to identify the exact
  383. chip:
  384. CONFIG_ARCH_CHIP_STM32F103C8=y
  385. CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG - Enables special STM32 clock
  386. configuration features.
  387. CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG=n
  388. CONFIG_ARCH_BOARD - Identifies the configs subdirectory and
  389. hence, the board that supports the particular chip or SoC.
  390. CONFIG_ARCH_BOARD=stm32f103-minium
  391. CONFIG_ARCH_BOARD_name - For use in C code
  392. CONFIG_ARCH_BOARD_STM32_MINIMUM=y
  393. CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation
  394. of delay loops
  395. CONFIG_ENDIAN_BIG - define if big endian (default is little
  396. endian)
  397. CONFIG_RAM_SIZE - Describes the installed DRAM (SRAM in this case):
  398. CONFIG_RAM_SIZE=20480 (20Kb)
  399. CONFIG_RAM_START - The start address of installed DRAM
  400. CONFIG_RAM_START=0x20000000
  401. CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to boards that
  402. have LEDs
  403. CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt
  404. stack. If defined, this symbol is the size of the interrupt
  405. stack in bytes. If not defined, the user task stacks will be
  406. used during interrupt handling.
  407. CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
  408. CONFIG_ARCH_CALIBRATION - Enables some build in instrumentation that
  409. cause a 100 second delay during boot-up. This 100 second delay
  410. serves no purpose other than it allows you to calibratre
  411. CONFIG_ARCH_LOOPSPERMSEC. You simply use a stop watch to measure
  412. the 100 second delay then adjust CONFIG_ARCH_LOOPSPERMSEC until
  413. the delay actually is 100 seconds.
  414. Individual subsystems can be enabled:
  415. AHB
  416. ---
  417. CONFIG_STM32_CRC
  418. CONFIG_STM32_BKPSRAM
  419. APB1
  420. ----
  421. CONFIG_STM32_TIM2
  422. CONFIG_STM32_TIM3
  423. CONFIG_STM32_TIM4
  424. CONFIG_STM32_WWDG
  425. CONFIG_STM32_IWDG
  426. CONFIG_STM32_SPI2
  427. CONFIG_STM32_USART2
  428. CONFIG_STM32_USART3
  429. CONFIG_STM32_I2C1
  430. CONFIG_STM32_I2C2
  431. CONFIG_STM32_CAN1
  432. CONFIG_STM32_PWR -- Required for RTC
  433. APB2
  434. ----
  435. CONFIG_STM32_TIM1
  436. CONFIG_STM32_USART1
  437. CONFIG_STM32_ADC1
  438. CONFIG_STM32_ADC2
  439. CONFIG_STM32_SPI1
  440. Timer devices may be used for different purposes. One special purpose is
  441. to generate modulated outputs for such things as motor control. If CONFIG_STM32_TIMn
  442. is defined (as above) then the following may also be defined to indicate that
  443. the timer is intended to be used for pulsed output modulation or ADC conversion.
  444. Note that ADC require two definitions: Not only do you have
  445. to assign the timer (n) for used by the ADC, but then you also have to
  446. configure which ADC (m) it is assigned to.
  447. CONFIG_STM32_TIMn_PWM Reserve timer n for use by PWM, n=1,..,14
  448. CONFIG_STM32_TIMn_ADC Reserve timer n for use by ADC, n=1,..,14
  449. CONFIG_STM32_TIMn_ADCm Reserve timer n to trigger ADCm, n=1,..,14, m=1,..,3
  450. For each timer that is enabled for PWM usage, we need the following additional
  451. configuration settings:
  452. CONFIG_STM32_TIMx_CHANNEL - Specifies the timer output channel {1,..,4}
  453. NOTE: The STM32 timers are each capable of generating different signals on
  454. each of the four channels with different duty cycles. That capability is
  455. not supported by this driver: Only one output channel per timer.
  456. JTAG Enable settings (by default only SW-DP is enabled):
  457. CONFIG_STM32_JTAG_FULL_ENABLE - Enables full SWJ (JTAG-DP + SW-DP)
  458. CONFIG_STM32_JTAG_NOJNTRST_ENABLE - Enables full SWJ (JTAG-DP + SW-DP)
  459. but without JNTRST.
  460. CONFIG_STM32_JTAG_SW_ENABLE - Set JTAG-DP disabled and SW-DP enabled
  461. STM32F103 Minimum specific device driver settings
  462. CONFIG_U[S]ARTn_SERIAL_CONSOLE - selects the USARTn (n=1,2,3)
  463. for the console and ttys0 (default is the USART1).
  464. CONFIG_U[S]ARTn_RXBUFSIZE - Characters are buffered as received.
  465. This specific the size of the receive buffer
  466. CONFIG_U[S]ARTn_TXBUFSIZE - Characters are buffered before
  467. being sent. This specific the size of the transmit buffer
  468. CONFIG_U[S]ARTn_BAUD - The configure BAUD of the UART. Must be
  469. CONFIG_U[S]ARTn_BITS - The number of bits. Must be either 7 or 8.
  470. CONFIG_U[S]ARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
  471. CONFIG_U[S]ARTn_2STOP - Two stop bits
  472. STM32F103 Minimum CAN Configuration
  473. CONFIG_CAN - Enables CAN support (one or both of CONFIG_STM32_CAN1 or
  474. CONFIG_STM32_CAN2 must also be defined)
  475. CONFIG_CAN_EXTID - Enables support for the 29-bit extended ID. Default
  476. Standard 11-bit IDs.
  477. CONFIG_CAN_FIFOSIZE - The size of the circular buffer of CAN messages.
  478. Default: 8
  479. CONFIG_CAN_NPENDINGRTR - The size of the list of pending RTR requests.
  480. Default: 4
  481. CONFIG_CAN_LOOPBACK - A CAN driver may or may not support a loopback
  482. mode for testing. The STM32 CAN driver does support loopback mode.
  483. CONFIG_CAN1_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN1 is defined.
  484. CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
  485. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6
  486. CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7
  487. CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an
  488. dump of all CAN registers.
  489. STM32F103 Minimum SPI Configuration
  490. CONFIG_STM32_SPI_INTERRUPTS - Select to enable interrupt driven SPI
  491. support. Non-interrupt-driven, poll-waiting is recommended if the
  492. interrupt rate would be to high in the interrupt driven case.
  493. CONFIG_STM32_SPI_DMA - Use DMA to improve SPI transfer performance.
  494. Cannot be used with CONFIG_STM32_SPI_INTERRUPT.
  495. Configurations
  496. ==============
  497. Instantiating Configurations
  498. ----------------------------
  499. Each STM32F103 Minimum configuration is maintained in a sub-directory and
  500. can be selected as follow:
  501. cd tools
  502. ./configure.sh STM32F103 Minimum/<subdir>
  503. cd -
  504. Where <subdir> is one of the following:
  505. Configuration Directories
  506. -------------------------
  507. nsh:
  508. ---
  509. Configures the NuttShell (nsh) located at apps/examples/nsh. This
  510. configuration enables a console on UART1. Support for
  511. builtin applications is enabled, but in the base configuration no
  512. builtin applications are selected.
  513. jlx12864g:
  514. ---------
  515. This is a config example to use the JLX12864G-086 LCD module. To use this
  516. LCD you need to connect PA5 (SPI1 CLK) to SCK; PA7 (SPI1 MOSI) to SDA; PA4
  517. to CS; PA3 to RST; PA2 to RS.
  518. nrf24:
  519. ---------
  520. This is a config example to test the nrf24 terminal example. You will need
  521. two stm32f103-minimum board each one with a nRF24L01 module connected this
  522. way: connect PB1 to nRF24 CE pin; PA4 to CSN; PA5 (SPI1 CLK) to SCK; PA7
  523. (SPI1 MOSI) to MOSI; PA6 (SPI1 MISO) to MISO; PA0 to IRQ.
  524. usbnsh:
  525. -------
  526. This is another NSH example. If differs from other 'nsh' configurations
  527. in that this configurations uses a USB serial device for console I/O.
  528. NOTES:
  529. 1. This configuration uses the mconf-based configuration tool. To
  530. change this configuration using that tool, you should:
  531. a. Build and install the kconfig-mconf tool. See nuttx/README.txt
  532. see additional README.txt files in the NuttX tools repository.
  533. b. Execute 'make menuconfig' in nuttx/ in order to start the
  534. reconfiguration process.
  535. 2. By default, this configuration uses the CodeSourcery toolchain
  536. for Windows and builds under Cygwin (or probably MSYS). That
  537. can easily be reconfigured, of course.
  538. CONFIG_HOST_WINDOWS=y : Builds under Windows
  539. CONFIG_WINDOWS_CYGWIN=y : Using Cygwin
  540. CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery for Windows
  541. 3. This configuration does have UART2 output enabled and set up as
  542. the system logging device:
  543. CONFIG_SYSLOG_CHAR=y : Use a character device for system logging
  544. CONFIG_SYSLOG_DEVPATH="/dev/ttyS0" : UART2 will be /dev/ttyS0
  545. However, there is nothing to generate SYLOG output in the default
  546. configuration so nothing should appear on UART2 unless you enable
  547. some debug output or enable the USB monitor.
  548. 4. Enabling USB monitor SYSLOG output. If tracing is enabled, the USB
  549. device will save encoded trace output in in-memory buffer; if the
  550. USB monitor is enabled, that trace buffer will be periodically
  551. emptied and dumped to the system loggin device (UART2 in this
  552. configuraion):
  553. CONFIG_USBDEV_TRACE=y : Enable USB trace feature
  554. CONFIG_USBDEV_TRACE_NRECORDS=128 : Buffer 128 records in memory
  555. CONFIG_NSH_USBDEV_TRACE=n : No builtin tracing from NSH
  556. CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
  557. CONFIG_USBMONITOR=y : Enable the USB monitor daemon
  558. CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
  559. CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
  560. CONFIG_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
  561. CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
  562. CONFIG_USBMONITOR_TRACECLASS=y
  563. CONFIG_USBMONITOR_TRACETRANSFERS=y
  564. CONFIG_USBMONITOR_TRACECONTROLLER=y
  565. CONFIG_USBMONITOR_TRACEINTERRUPTS=y
  566. 5. By default, this project assumes that you are *NOT* using the DFU
  567. bootloader.
  568. Using the Prolifics PL2303 Emulation
  569. ------------------------------------
  570. You could also use the non-standard PL2303 serial device instead of
  571. the standard CDC/ACM serial device by changing:
  572. CONFIG_CDCACM=y : Disable the CDC/ACM serial device class
  573. CONFIG_CDCACM_CONSOLE=y : The CDC/ACM serial device is NOT the console
  574. CONFIG_PL2303=y : The Prolifics PL2303 emulation is enabled
  575. CONFIG_PL2303_CONSOLE=y : The PL2303 serial device is the console
  576. veml6070:
  577. --------
  578. This is a config example to use the Vishay VEML6070 UV-A sensor. To use this
  579. sensor you need to connect PB6 (I2C1 CLK) to SCL; PB7 (I2C1 SDA) to SDA of
  580. sensor module. I used a GY-VEML6070 module to test this driver.