README.txt 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. README
  2. ======
  3. This is the README file for the port of NuttX to the Mikroe Clicker2 STM32
  4. board based on the STMicro STM32F407VGT6 MCU.
  5. Reference: https://shop.mikroe.com/development-boards/starter/clicker-2/stm32f4
  6. Contents
  7. ========
  8. o Serial Console
  9. o LEDs
  10. o Buttons
  11. o Using JTAG
  12. o Configurations
  13. Serial Console
  14. ==============
  15. The are no RS-232 drivers on-board. An RS-232 Click board is available:
  16. https://shop.mikroe.com/click/interface/rs232 or you can cannot an off-
  17. board TTL-to-RS-232 converter as follows:
  18. USART2: mikroBUS1 PD6/RX and PD5/TX
  19. USART3: mikroBUS2 PD9/RX and PD8TX
  20. GND, 3.3V, and 5V. Are also available
  21. By default, USART3 on mikroBUS2 is used as the serial console in each
  22. configuration unless stated otherwise in the description of the
  23. configuration.
  24. LEDs
  25. ====
  26. The Mikroe Clicker2 STM32 has two user controllable LEDs:
  27. LD1/PE12, Active high output illuminates
  28. LD2/PE15, Active high output illuminates
  29. If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any
  30. way. If CONFIG_ARCH_LEDs is defined, then NuttX will control the 2 LEDs on
  31. board the Clicker2 for STM32. The following definitions describe how NuttX
  32. controls the LEDs:
  33. SYMBOL Meaning LED state
  34. LD1 LD2
  35. ------------------- ----------------------- -------- --------
  36. LED_STARTED NuttX has been started OFF OFF
  37. LED_HEAPALLOCATE Heap has been allocated OFF OFF
  38. LED_IRQSENABLED Interrupts enabled OFF OFF
  39. LED_STACKCREATED Idle stack created ON OFF
  40. LED_INIRQ In an interrupt N/C ON
  41. LED_SIGNAL In a signal handler No change
  42. LED_ASSERTION An assertion failed No change
  43. LED_PANIC The system has crashed OFF Blinking
  44. LED_IDLE STM32 is is sleep mode Not used
  45. Thus is LD1 is illuminated, the Clicker2 has completed boot-up. IF LD2
  46. is glowly softly, then interrupts are being taken; the level of illumination
  47. depends amount of time processing interupts. If LD1 is off and LD2 is
  48. blinking at about 2Hz, then the system has crashed.
  49. Buttons
  50. =======
  51. The Mikroe Clicker2 STM32 has two buttons available to software:
  52. T2/E0, Low sensed when pressed
  53. T3/PA10, Low sensed when pressed
  54. Using JTAG
  55. ==========
  56. The Clicker2 comes with the mikroBootloader installed. That bootloader
  57. has not been used and is possibly incompatible with the Clicker2-STM32
  58. linker script at configs/clicker2-stm32/scripts/flash.ld. Often code must
  59. be built to execute at an offset in to FLASH when a bootloader is used.
  60. Certainly that is the case for the ST-Micro DFU bootloader but I am not
  61. aware of the requirements for use with the mikroBootloader.
  62. JTAG has been used in the development of this board support. The
  63. Clicker2-STM32 board offers a 2x5 JTAG connector. You may use Dupont
  64. jumpers to connect this port to JTAG as described here:
  65. https://www.mikroe.com/how-to-use-st-link-v2-with-clicker-2-for-stm32-a-detailed-walkthrough/
  66. http://www.playembedded.org/blog/en/2016/02/06/mikroe-clicker-2-for-stm32-and-stlink-v2/
  67. NOTE that the FLASH probably has read protection enabled locked. You may
  68. need to follow the instructions at the second link to unlock it. You can
  69. also use the STM32 ST-Link CLI tool on Windows to remove the read protection
  70. using the -OB command:
  71. $ ./ST-LINK_CLI.exe -c SN=53FF6F064966545035320387 SWD LPM
  72. STM32 ST-LINK CLI v2.3.0
  73. STM32 ST-LINK Command Line Interface
  74. ST-LINK SN : 53FF6F064966545035320387
  75. ST-LINK Firmware version : V2J24S4
  76. Connected via SWD.
  77. SWD Frequency = 4000K.
  78. Target voltage = 3.2 V.
  79. Connection mode : Normal.
  80. Debug in Low Power mode enabled.
  81. Device ID:0x413
  82. Device family :STM32F40xx/F41xx
  83. $ ./ST-LINK_CLI.exe -OB RDP=0
  84. STM32 ST-LINK CLI v2.3.0
  85. STM32 ST-LINK Command Line Interface
  86. ST-LINK SN : 53FF6F064966545035320387
  87. ST-LINK Firmware version : V2J24S4
  88. Connected via SWD.
  89. SWD Frequency = 4000K.
  90. Target voltage = 3.2 V.
  91. Connection mode : Normal.
  92. Device ID:0x413
  93. Device family :STM32F40xx/F41xx
  94. Updating option bytes...
  95. Option bytes updated successfully.
  96. NOTE:
  97. 1. You can get the ST-Link Utilies here:
  98. http://www.st.com/en/embedded-software/stsw-link004.html
  99. 2. The ST-LINK Utility command line interface is located at:
  100. [Install_Directory]\STM32 ST-LINK Utility\ST-LINK Utility\ST-LINK_CLI.exe
  101. 3. You can get a summary of all of the command options by running
  102. ST-LINK_CLI.exe with no arguments.
  103. 4. You can get the serial number of the ST-Link when from the information
  104. window if you connect via the ST-Link Utility:
  105. 11:04:28 : ST-LINK SN : 53FF6F064966545035320387
  106. 11:04:28 : ST-LINK Firmware version : V2J24S4
  107. 11:04:28 : Connected via SWD.
  108. 11:04:28 : SWD Frequency = 100 KHz.
  109. 11:04:28 : Connection mode : Normal.
  110. 11:04:28 : Debug in Low Power mode enabled.
  111. 11:04:30 : Device ID:0x413
  112. 11:04:30 : Device family :STM32F40xx/F41xx
  113. 11:04:30 : Can not read memory!
  114. Disable Read Out Protection and retry.
  115. You can avoid the mess of jumpers using the mikroProg to ST-Link v2 adapter
  116. along with a 2x5, 10-wire ribbon cable connector:
  117. https://shop.mikroe.com/add-on-boards/adapter/mikroprog-st-link-v2-adapter
  118. Then you can use the ST-Link Utility or other debugger software to write
  119. the NuttX binary to FLASH. OpenOCD can be used with the ST-Link to provide
  120. a debug environment. The debug adaptor is NOT compatible with other JTAG
  121. debuggers such as the Segger J-Link.
  122. Configurations
  123. ==============
  124. Information Common to All Configurations
  125. ----------------------------------------
  126. Each Clicker2 configuration is maintained in a sub-directory and can be
  127. selected as follow:
  128. cd tools
  129. ./configure.sh clicker2-stm32/<subdir>
  130. cd -
  131. Before building, make sure the PATH environment variable includes the
  132. correct path to the directory than holds your toolchain binaries.
  133. And then build NuttX by simply typing the following. At the conclusion of
  134. the make, the nuttx binary will reside in an ELF file called, simply, nuttx.
  135. make oldconfig
  136. make
  137. The <subdir> that is provided above as an argument to the tools/configure.sh
  138. must be is one of the following.
  139. NOTES:
  140. 1. These configurations use the mconf-based configuration tool. To
  141. change any of these configurations using that tool, you should:
  142. a. Build and install the kconfig-mconf tool. See nuttx/README.txt
  143. see additional README.txt files in the NuttX tools repository.
  144. b. Execute 'make menuconfig' in nuttx/ in order to start the
  145. reconfiguration process.
  146. 2. Unless stated otherwise, all configurations generate console
  147. output on USART3, channel 0) as described above under "Serial
  148. Console". The relevant configuration settings are listed below:
  149. CONFIG_STM32_USART3=y
  150. CONFIG_STM32_USART3_SERIALDRIVER=y
  151. CONFIG_STM32_USART=y
  152. CONFIG_USART3_SERIALDRIVER=y
  153. CONFIG_USART3_SERIAL_CONSOLE=y
  154. CONFIG_USART3_RXBUFSIZE=256
  155. CONFIG_USART3_TXBUFSIZE=256
  156. CONFIG_USART3_BAUD=115200
  157. CONFIG_USART3_BITS=8
  158. CONFIG_USART3_PARITY=0
  159. CONFIG_USART3_2STOP=0
  160. 3. All of these configurations are set up to build under Linux using the
  161. "GNU Tools for ARM Embedded Processors" that is maintained by ARM
  162. (unless stated otherwise in the description of the configuration).
  163. https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
  164. That toolchain selection can easily be reconfigured using
  165. 'make menuconfig'. Here are the relevant current settings:
  166. Build Setup:
  167. CONFIG_HOST_LINUX =y : Linux environment
  168. System Type -> Toolchain:
  169. CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y : GNU ARM EABI toolchain
  170. Configuration sub-directories
  171. -----------------------------
  172. knsh:
  173. This is identical to the nsh configuration below except that NuttX
  174. is built as a protected mode, monolithic module and the user applications
  175. are built separately.
  176. It is recommends to use a special make command; not just 'make' but make
  177. with the following two arguments:
  178. make pass1 pass2
  179. In the normal case (just 'make'), make will attempt to build both user-
  180. and kernel-mode blobs more or less interleaved. This actual works!
  181. However, for me it is very confusing so I prefer the above make command:
  182. Make the user-space binaries first (pass1), then make the kernel-space
  183. binaries (pass2)
  184. NOTES:
  185. 1. At the end of the build, there will be several files in the top-level
  186. NuttX build directory:
  187. PASS1:
  188. nuttx_user.elf - The pass1 user-space ELF file
  189. nuttx_user.hex - The pass1 Intel HEX format file (selected in defconfig)
  190. User.map - Symbols in the user-space ELF file
  191. PASS2:
  192. nuttx - The pass2 kernel-space ELF file
  193. nuttx.hex - The pass2 Intel HEX file (selected in defconfig)
  194. System.map - Symbols in the kernel-space ELF file
  195. The J-Link programmer will accept files in .hex, .mot, .srec, and .bin
  196. formats. The St-Link programmer will accept files in hex and .bin
  197. formats.
  198. 2. Combining .hex files. If you plan to use the .hex files with your
  199. debugger or FLASH utility, then you may need to combine the two hex
  200. files into a single .hex file. Here is how you can do that.
  201. a. The 'tail' of the nuttx.hex file should look something like this
  202. (with my comments added):
  203. $ tail nuttx.hex
  204. # 00, data records
  205. ...
  206. :10 9DC0 00 01000000000800006400020100001F0004
  207. :10 9DD0 00 3B005A0078009700B500D400F300110151
  208. :08 9DE0 00 30014E016D0100008D
  209. # 05, Start Linear Address Record
  210. :04 0000 05 0800 0419 D2
  211. # 01, End Of File record
  212. :00 0000 01 FF
  213. Use an editor such as vi to remove the 05 and 01 records.
  214. b. The 'head' of the nuttx_user.hex file should look something like
  215. this (again with my comments added):
  216. $ head nuttx_user.hex
  217. # 04, Extended Linear Address Record
  218. :02 0000 04 0801 F1
  219. # 00, data records
  220. :10 8000 00 BD89 01084C800108C8110208D01102087E
  221. :10 8010 00 0010 00201C1000201C1000203C16002026
  222. :10 8020 00 4D80 01085D80010869800108ED83010829
  223. ...
  224. Nothing needs to be done here. The nuttx_user.hex file should
  225. be fine.
  226. c. Combine the edited nuttx.hex and un-edited nuttx_user.hex
  227. file to produce a single combined hex file:
  228. $ cat nuttx.hex nuttx_user.hex >combined.hex
  229. Then use the combined.hex file with the to write the FLASH image.
  230. If you do this a lot, you will probably want to invest a little time
  231. to develop a tool to automate these steps.
  232. mrf24j40-mac
  233. This is a version of nsh that was used for testing the MRF24J40 MAC be
  234. as a character device. The most important configuration differences are
  235. summarized below:
  236. 1. Support for the BEE click and SPI are in enabled in the mikroBUS1 slot:
  237. CONFIG_CLICKER2_STM32_MB1_BEE=y
  238. CONFIG_CLICKER2_STM32_MB1_SPI=y
  239. 2. SPI support and STM32 SPI3, in particular, are enabled:
  240. CONFIG_SPI=y
  241. CONFIG_SPI_EXCHANGE=y
  242. CONFIG_STM32_SPI=y
  243. CONFIG_STM32_SPI3=y
  244. 4. Support for the IEEE802.15.4 "upper half" character driver is enabled:
  245. CONFIG_WIRELESS=y
  246. CONFIG_WIRELESS_IEEE802154=y
  247. CONFIG_IEEE802154_MAC_DEV=y
  248. CONFIG_IEEE802154_NTXDESC=3
  249. CONFIG_IEEE802154_IND_PREALLOC=20
  250. CONFIG_IEEE802154_IND_IRQRESERVE=10
  251. CONFIG_IEEE802154_DEFAULT_EADDR=0x00fade00deadbeef
  252. 5. Support for the lower half MRF24J40 character driver is enabled
  253. CONFIG_DRIVERS_WIRELESS=y
  254. CONFIG_DRIVERS_IEEE802154=y
  255. CONFIG_IEEE802154_MRF24J40=y
  256. 6. Support for the i8sak test program at apps/ieee802154 is enabled:
  257. CONFIG_IEEE802154_LIBMAC=y
  258. CONFIG_IEEE802154_LIBUTILS=y
  259. CONFIG_IEEE802154_I8SAK=y
  260. CONFIG_IEEE802154_I8SAK_PRIORITY=100
  261. CONFIG_IEEE802154_I8SAK_STACKSIZE=2048
  262. 7. Initialization hooks are provided to enable the MRF24J40 and to
  263. register the radio character driver.
  264. CONFIG_NSH_ARCHINIT=y
  265. 8. Configuration instructions: WPAN configuration must be performed
  266. using the i8sak program. Detailed instructions are provided in a
  267. README.txt file at apps/wireless/ieee802154/i8sak. You should make
  268. sure that you are familiar with the content of that README.txt file.
  269. Here is a quick "cheat sheet" for associated to setting up a
  270. coordinator and associating wth the WPAN:
  271. 1. Configure the Coordinator. On coordinator device do:
  272. nsh> i8 /dev/ieee0 startpan
  273. nsh> i8 acceptassoc
  274. 2. Assocate an endpoint device with the WPAN. On the endpoint
  275. device:
  276. nsh> i8 /dev/ieee0 assoc
  277. mrf24j40-6lowpan
  278. This is another version of nsh that is very similar to the mrf24j40-mac
  279. configuration but is focused on testing the IEEE 802.15.4 MAC
  280. integration with the 6LoWPAN network stack. It derives directly from the
  281. mrf24j40-mac and all NOTES provided there apply. Additional differences
  282. are summarized below:
  283. NOTES:
  284. 1. You must have two clicker2-stm32 boards each with an MRF24J40 click
  285. board in order to run these tests.
  286. 2. This configuration differs from the mrf24j40-mac configuration in
  287. that this configuration, like the usbnsh configuration, uses a USB
  288. serial device for console I/O. Such a configuration is useful on the
  289. Clicker2 STM32 which has no builtin RS-232 drivers and eliminates the
  290. tangle of cables and jumpers needed to debug multi-board setups.
  291. Most other NOTES for the usbnsh configuration should apply. Specific
  292. differences between the usbnsh or mrf24j40-mac configurations and this
  293. configuration are listed in these NOTES.
  294. 3. On most serial terminal programs that I have used, the USB
  295. connection will be lost when the target board is reset. When that
  296. happens, you may have to reset your serial terminal program to adapt
  297. to the new USB connection. Using TeraTerm, I actually have to exit
  298. the serial program and restart it in order to detect and select the
  299. re-established USB serial connection.
  300. 4. This configuration does NOT have USART3 output enabled. This
  301. configuration supports logging of debug output to a circular
  302. buffer in RAM. This feature is discussed fully in this Wiki page:
  303. http://nuttx.org/doku.php?id=wiki:howtos:syslog . Relevant
  304. configuration settings are summarized below:
  305. Device Drivers:
  306. CONFIG_RAMLOG=y : Enable the RAM-based logging feature.
  307. CONFIG_RAMLOG_CONSOLE=n : (We don't use the RAMLOG console)
  308. CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the
  309. system logger.
  310. CONFIG_RAMLOG_NONBLOCKING=y : Needs to be non-blocking for dmesg
  311. CONFIG_RAMLOG_BUFSIZE=8192 : Buffer size is 8KiB
  312. NOTE: This RAMLOG feature is really only of value if debug output
  313. is enabled. But, by default, no debug output is disabled in this
  314. configuration. Therefore, there is no logic that will add anything
  315. to the RAM buffer. This feature is configured and in place only
  316. to support any future debugging needs that you may have.
  317. If you don't plan on using the debug features, then by all means
  318. disable this feature and save 8KiB of RAM!
  319. NOTE: There is an issue with capturing data in the RAMLOG: If
  320. the system crashes, all of the crash dump information will go into
  321. the RAMLOG and you will be unable to access it! You can tell that
  322. the system has crashed because (a) it will be unresponsive and (b)
  323. the LD2 will be blinking at about 2Hz.
  324. 5. IPv6 networking is enabled with TCP/IP, UDP, 6LoWPAN, and NSH
  325. Telnet support.
  326. 6. Configuration instructions: Basic PAN configuration is the same as
  327. for the ieee802154-mac configuration with the exception that after
  328. the PAN has been configured with the i8sak utility, you must
  329. explicity bring the network up on each node:
  330. nsh> ifup wpan0
  331. 7. examples/udp is enabled. This will allow two MRF24J40 nodes to
  332. exchange UDP packets. Basic instructions:
  333. On the server node:
  334. nsh> ifconfig
  335. nsh> udpserver &
  336. The ifconfig command will show the IP address of the server. Then on
  337. the client node use this IP address to start the client:
  338. nsh> udpclient <server-ip> &
  339. Where <server-ip> is the IP address of the server that you got above.
  340. NOTE: There is no way to stop the UDP test once it has been started
  341. other than by resetting the board.
  342. Cheat Sheet. Here is a concise summary of all all the steps needed to
  343. run the UDP test (C=Coordinator; E=Endpoint):
  344. C: nsh> i8 /dev/ieee0 startpan
  345. C: nsh> 8 acceptassoc
  346. E: nsh> i8 assoc
  347. C: nsh> ifup wpan0
  348. C: nsh> ifconfig <-- To get the <server-ip>
  349. E: nsh> ifup wpan0
  350. C: nsh> udpserver &
  351. E: nsh> udpclient <server-ip> &
  352. The nsh> dmesg command can be use at any time on any node to see
  353. any debug output that you have selected.
  354. 8. examples/nettest is enabled. This will allow two MRF24J40 nodes to
  355. exchange TCP packets. Basic instructions:
  356. On the server node:
  357. nsh> ifconfig
  358. nsh> tcpserver &
  359. The ifconfig command will show the IP address of the server. Then on
  360. the client node use this IP address to start the client:
  361. nsh> tcpclient <server-ip> &
  362. Where <server-ip> is the IP address of the server that you got above.
  363. NOTE: Unlike the UDP test, there the TCP test will terminate
  364. automatically when the packet exchange is complete.
  365. Cheat Sheet. Here is a concise summary of all all the steps needed to
  366. run the TCP test (C=Coordinator; E=Endpoint):
  367. C: nsh> i8 /dev/ieee0 startpan
  368. C: nsh> 8 acceptassoc
  369. E: nsh> i8 assoc
  370. C: nsh> ifup wpan0
  371. C: nsh> ifconfig <-- To get the <server-ip>
  372. E: nsh> ifup wpan0
  373. C: nsh> tcpserver &
  374. E: nsh> tcpclient <server-ip> &
  375. The nsh> dmesg command can be use at any time on any node to see
  376. any debug output that you have selected.
  377. 9. The NSH Telnet deamon (server) is enabled. However, it cannot be
  378. started automatically. Rather, it must be started AFTER the network
  379. has been brought up using the NSH 'telnetd' command. You would want
  380. to start the Telent daemon only if you want the node to serve Telent
  381. connections to an NSH shell on the node.
  382. nsh> ifconfig
  383. nsh> telnetd
  384. Note the 'ifconfig' is executed to get the IP address of the node.
  385. This is necessary because the IP address is assigned by the the
  386. Coordinator and may not be known a priori.
  387. 10. This configuration also includes the Telnet client program. This
  388. will allow you to execute a NSH one a node from the command line on
  389. a different node. Like:
  390. nsh> telnet <server-ip>
  391. Where <server-ip> is the IP address of the server that you got for
  392. the ifconfig commna on the remote node. Once the telnet session
  393. has been started, you can end the session with:
  394. nsh> exit
  395. Cheat Sheet. Here is a concise summary of all all the steps needed to
  396. run the TCP test (C=Coordinator; E=Endpoint):
  397. C: nsh> i8 /dev/ieee0 startpan
  398. C: nsh> 8 acceptassoc
  399. E: nsh> i8 assoc
  400. C: nsh> ifup wpan0
  401. C: nsh> ifconfig <-- To get the <server-ip>
  402. E: nsh> ifup wpan0
  403. C: nsh> telnetd <-- Starts the Telnet daemon
  404. E: nsh> telnet <server-ip> <-- Runs the Telnet client
  405. STATUS:
  406. 2017-06-21: Basic UDP functionality has been achieved with HC06
  407. compression and short address. Additional testing is required for
  408. other configurations (see text matrix below).
  409. 2017-06-23: Added test for TCP functionality. As of yet unverified.
  410. 2017-06-24: There are significant problems with the 6LoWPAN TCP send
  411. logic. A major redesign was done to better handle ACKs and
  412. retransmissions, and to work with TCP dynamic windowing.
  413. 2017-05-25: After some rather extensive debug, the TCP test was made
  414. to with (HC06 and short addressing).
  415. 2017-06-26: Verified with HC06 and extended addressing and HC1 with
  416. both addressing modes.
  417. 2017-06-27: Added the Telnet client application to the configuration.
  418. Initial testing reveal a problem that required re-design of the
  419. Telnet daemon: It did not yet support IPv6! But after adding this
  420. support, Telnet worked just fine.
  421. Test Matrix:
  422. The following configurations have been tested:
  423. TEST DATE
  424. COMPRESSION ADDRESSING UDP TCP
  425. ----------- ---------- ---- ----
  426. hc06 short 6/21 6/25
  427. extended 6/22 6/26
  428. hc1 short 6/23 6/26
  429. extended 6/23 6/26
  430. ipv6 short --- ---
  431. extended --- ---
  432. telnet short N/A 6/27 (hc06)
  433. extended N/A ---
  434. Other configuration options have not been specifically addressed
  435. (such non-compressable ports, non-MAC based IPv6 addresses, etc.)
  436. One limitation of this test is that it only tests NuttX 6LoWPAN
  437. against NuttX 6LoWPAN. It does not prove that NuttX 6LoWPAN is
  438. compatible with other implementations of 6LoWPAN. The tests could
  439. potentially be verifying only that the design is implemented
  440. incorrectly in compatible way on both the client and server sides.
  441. mrf24j40-starhub and mrf24j40-starpoint
  442. These two configurations implement hub and and star endpoint in a
  443. star topology. Both configurations derive from the mrf24j40-6lowpan
  444. configuration and most of the notes there apply here as well.
  445. 1. You must have three clicker2-stm32 boards each with an MRF24J40
  446. click board in order to run these tests: One that serves as the
  447. star hub and at least two star endpoints.
  448. 2. The star point configuration differs from the primarily in the
  449. mrf24j40-6lowpan in following is also set:
  450. CONFIG_NET_STAR=y
  451. CONFIG_NET_STARPOINT=y
  452. The CONFIG_NET_STARPOINT selection informs the endpoint that it
  453. must send all frames to the hub of the star, rather than directly
  454. to the recipient.
  455. The star hub configuration, on the other hand, differs from the
  456. mrf24j40-6lowpan in these fundamental ways:
  457. CONFIG_NET_STAR=y
  458. CONFIG_NET_STARHUB=y
  459. CONFIG_NET_IPFORWARD=y
  460. The CONFIG_NET_IPFORWARD selection informs the hub that if it
  461. receives any packets that are not destined for the hub, it should
  462. forward those packets appropriately.
  463. 3. Telnet: The star point configuration supports the Telnet daemon,
  464. but not the Telnet client; the star hub configuration supports
  465. the Telnet client, but not the Telnet daemon. Therefore, the
  466. star hub can Telnet to any point in the star, the star endpoints
  467. cannot initiate telnet sessions.
  468. 4. TCP and UDP Tests: The same TCP and UDP tests as described for
  469. the mrf24j40-6lowpan coniguration are supported on the star
  470. endpoints, but NOT on the star hub. Therefore, all network testing
  471. is between endpoints with the hub acting, well, only like a hub.
  472. The modified usage of the TCP test is show below with E1 E2
  473. representing the two star endpoints and C: representing the
  474. coordinator/hub.
  475. C: nsh> i8 /dev/ieee0 startpan
  476. C: nsh> 8 acceptassoc
  477. E1: nsh> i8 assoc
  478. E2: nsh> i8 assoc
  479. C: nsh> ifup wpan0
  480. E1: nsh> ifup wpan0
  481. E1: nsh> ifconfig <-- To get the IP address of E1 endpoint
  482. E1: nsh> telnetd <-- Starts the Telnet daemon
  483. E2: nsh> ifup wpan0
  484. E2: nsh> ifconfig <-- To get the IP address of E2 endpoint
  485. E2: nsh> telnetd <-- Starts the Telnet daemon
  486. E1: nsh> tcpserver &
  487. E2: nsh> tcpclient <server-ip> &
  488. Where <server-ip> is the IP address of the E1 endpoint.
  489. Similarly for the UDP test:
  490. E1: nsh> udpserver &
  491. E2: nsh> udpclient <server-ip> &
  492. The nsh> dmesg command can be use at any time on any node to see
  493. any debug output that you have selected.
  494. Telenet sessions may be initiated only from the hub to a star
  495. endpoint:
  496. C: nsh> telnet <server-ip> <-- Runs the Telnet client
  497. Where <server-ip> is the IP address of either the E1 or E2 endpoints.
  498. STATUS:
  499. 2017-06-29: Configurations added. Initial testing indicates that
  500. the TCP Telnet client can successfully establish sessions with
  501. the two star endpoints. When testing communications between the
  502. two star endpoints via the hub, the frames are correctly directed
  503. to the hub. However, they are not being forwarded to the other
  504. endpoint.
  505. 2017-06-30: The failure to forward is understood: When the star
  506. endpoint sent the IPv6 destination address, the HC06 compression
  507. logic elided the address -- meaning that it could be reconstructed
  508. based on the receiver's assigned short address. However, when
  509. intercepted by the hub, the uncompressed address does not know
  510. the short address of the recipient and instead uses the short
  511. address of the hub. This means two things: (1) it looks like
  512. the hub address is the destination address, and (2) the
  513. uncompressed UDP packet has a bad checksum.
  514. This required a change to assure that the destination IPv6 address
  515. is not elided in the case of the star endpoint configuration. After
  516. some additional fixes for byte ordering in 16-bit and 64-bit
  517. compressed IPv6 addresses, then all tests are working as expected:
  518. TCP, UDP, Telnet.
  519. 2017-08-5: It looks like I have lost one of my Clicker2-STM32 boards.
  520. This means that I will not be able to do any regression testing as
  521. changes are made to the radio interfaces and 6LoWPAN :(
  522. nsh:
  523. Configures the NuttShell (nsh) located at examples/nsh. This
  524. configuration is focused on low level, command-line driver testing. It
  525. has no network.
  526. NOTES:
  527. 1. Support for NSH built-in applications is provided:
  528. Binary Formats:
  529. CONFIG_BUILTIN=y : Enable support for built-in programs
  530. Application Configuration:
  531. CONFIG_NSH_BUILTIN_APPS=y : Enable starting apps from NSH command line
  532. No built applications are enabled in the base configuration, however.
  533. 2. C++ support for applications is enabled:
  534. CONFIG_HAVE_CXX=y
  535. CONFIG_HAVE_CXXINITIALIZE=y
  536. CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y
  537. usbnsh:
  538. This is another NSH example. If differs from other 'nsh' configurations
  539. in that this configurations uses a USB serial device for console I/O.
  540. Such a configuration is useful on the Clicker2 STM32 which has no
  541. builtin RS-232 drivers.
  542. NOTES:
  543. 1. One most serial terminal programs that I have used, the USB
  544. connection will be lost when the target board is reset. When that
  545. happens, you may have to reset your serial terminal program to adapt
  546. to the new USB connection. Using TeraTerm, I actually have to exit
  547. the serial program and restart it in order to detect and select the
  548. re-established USB serial connection.
  549. 2. This configuration does have USART3 output enabled and set up as
  550. the system logging device:
  551. CONFIG_SYSLOG_CHAR=y : Use a character device for system logging
  552. CONFIG_SYSLOG_DEVPATH="/dev/ttyS0" : USART3 will be /dev/ttyS0
  553. However, there is nothing to generate SYLOG output in the default
  554. configuration so nothing should appear on USART3 unless you enable
  555. some debug output or enable the USB monitor.
  556. 3. Enabling USB monitor SYSLOG output. If tracing is enabled, the USB
  557. device will save encoded trace output in in-memory buffer; if the
  558. USB monitor is enabled, that trace buffer will be periodically
  559. emptied and dumped to the system logging device (USART3 in this
  560. configuration):
  561. CONFIG_USBDEV_TRACE=y : Enable USB trace feature
  562. CONFIG_USBDEV_TRACE_NRECORDS=128 : Buffer 128 records in memory
  563. CONFIG_NSH_USBDEV_TRACE=n : No builtin tracing from NSH
  564. CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
  565. CONFIG_USBMONITOR=y : Enable the USB monitor daemon
  566. CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
  567. CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
  568. CONFIG_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
  569. CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
  570. CONFIG_USBMONITOR_TRACECLASS=y
  571. CONFIG_USBMONITOR_TRACETRANSFERS=y
  572. CONFIG_USBMONITOR_TRACECONTROLLER=y
  573. CONFIG_USBMONITOR_TRACEINTERRUPTS=y
  574. Using the Prolifics PL2303 Emulation
  575. ------------------------------------
  576. You could also use the non-standard PL2303 serial device instead of
  577. the standard CDC/ACM serial device by changing:
  578. CONFIG_CDCACM=n : Disable the CDC/ACM serial device class
  579. CONFIG_CDCACM_CONSOLE=n : The CDC/ACM serial device is NOT the console
  580. CONFIG_PL2303=y : The Prolifics PL2303 emulation is enabled
  581. CONFIG_PL2303_CONSOLE=y : The PL2303 serial device is the console