README.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. README
  2. ======
  3. This README file discusses the port of NuttX to the RX65N RSK2MB board. This board features the RX65N (R5F565NEHDFC 176pin)
  4. Contents
  5. ========
  6. - Board Features
  7. - Status/Open Issues
  8. - Serial Console
  9. - LEDs
  10. - Networking
  11. - RTC
  12. - USB Device
  13. - RSPI
  14. - RIIC
  15. - DTC
  16. - USB Host
  17. - USB Host Hub
  18. - Debugging
  19. Board Features
  20. ==============
  21. - Mounted devices: RX65N (R5F565NEDDFC: No Encrypt Function, Code Flash 2MB, Pin Count 176-pin),
  22. or RX65N (R5F565NEHDFC: Supported Encrypt Function, Code Flash 2MB, Pin Count 176-pin)
  23. - Mounts TFT Display. Graphic LCD controller can be evaluated
  24. - 1 channel Ethernet can be evaluated
  25. - RX65N builds in Trusted Secure IP. AES encryption function and robust key management can be evaluated (*)
  26. - Mounts SD slot. If an optional Wireless LAN expansion board package for RSK (RTK0ZZZZZZP00000BR#WS) is used,
  27. Wireless LAN can evaluated
  28. - 1 channel USB Function and 1 channel USB Host can be evaluated
  29. - In addition, CAN, RSPI, QSPI, etc. can be evaluated
  30. See the RX65N RSK2MB website for further information about this board:
  31. - https://www.renesas.com/br/en/products/software-tools/boards-and-kits/starter-kits/renesas-starter-kitplus-for-rx65n-2mb.html
  32. Serial Console
  33. ==============
  34. RX65N RSK2MB supports 12 serial ports (SCI0 - SCI12), however only 1 port can be tested(SCI8, which is the serial console). Only SCI8 port can be tested which is connected to USB Serial port.
  35. Serial ports SCI1, SCI2, SCI9-SCI12, cannot be tested because they are multiplexed to other Rx65N controller interfaces.
  36. Following SCI ports are configured w.r.t RX65N pin configuration
  37. SCI1 Pin Configuration :
  38. -----------
  39. RX65N RSK2MB
  40. Function
  41. -----------
  42. PF2 RXD1
  43. PF1 TXD1
  44. ------------
  45. SCI2 Pin Configuration :
  46. -----------
  47. RX65N RSK2MB
  48. Function
  49. -----------
  50. P52 RXD2
  51. P50 TXD2
  52. ------------
  53. SCI8 Pin Configuration :
  54. -----------
  55. RX65N RSK2MB
  56. Function
  57. -----------
  58. PJ1 RXD8
  59. PJ2 TXD8
  60. ------------
  61. Serial Connection Configuration
  62. -------------------------------
  63. 1. RSK2MB board needs to be connected to PC, using USB cable(One end of which is connected to PC, other end
  64. connected to USB serial port on H/W board).
  65. 2. RSK USB Serial Driver needs to be downloaded on PC side.
  66. 3. Configure Teraterm to 115200 baud.
  67. LEDs
  68. ====
  69. The RX65N RSK2MB board has 2 Power LED's(PowerLED5 LED_G, PowerLED3 LED_G) and 4 user LED's (LED_G, LED_O, LED_R, LED_R).
  70. If enabled 4 User LED's are simply turned on when the board boots
  71. successfully, and is blinking on panic / assertion failed.
  72. Networking
  73. ==========
  74. Ethernet Connections
  75. --------------------
  76. ------ ---------
  77. RX65N
  78. RSK2MB Ethernet
  79. Pin Function
  80. ------ ---------
  81. PC4 ET0_TX_CLK
  82. P76 ET0_RX_CLK
  83. P80 ET0_TX_EN
  84. PC6 ET0_ETXD3
  85. PC5 ET0_ETXD2
  86. P82 ET0_ETXD1
  87. P81 ET0_ETXD0
  88. PC3 ET0_TX_ER
  89. PC2 ET0_RX_DV
  90. PC0 ET0_ERXD3
  91. PC1 ET0_ERXD2
  92. P74 ET0_ERXD1
  93. P75 ET0_ERXD0
  94. P77 ET0_RX_ER
  95. P83 ET0_CRS
  96. PC7 ET0_COL
  97. P72 ET0_MDC
  98. P71 ET0_MDIO
  99. P54 ET0_LINKSTA
  100. ------ ---------
  101. USB Device
  102. -----------
  103. For the RX65N RSK2MB board, to be used as USB Device, the following Jumper settings need to be done
  104. J7 Short Pin 2 & Pin 3
  105. J16 Short Pin 1 & Pin 2
  106. NuttX Configurations
  107. --------------------
  108. The following configurations, need to be enabled for network.
  109. CONFIG_RX65N_EMAC=y : Enable the EMAC Peripheral for RX65N
  110. CONFIG_RX65N_EMAC0=y : Enable the EMAC Peripheral for RX65N
  111. CONFIG_RX65N_EMAC0_PHYSR=30 : Address of PHY status register
  112. CONFIG_RX65N_EMAC0_PHYSR_100FD=0x18 : Needed for PHY CHIP
  113. CONFIG_RX65N_EMAC0_PHYSR_100HD=0x08 : " " " " " "
  114. CONFIG_RX65N_EMAC0_PHYSR_10FD=0x14 : " " " " " "
  115. CONFIG_RX65N_EMAC0_PHYSR_10HD=0x04 : " " " " " "
  116. CONFIG_RX65N_EMAC0_PHYSR_ALTCONFIG=y : " " " " " "
  117. CONFIG_RX65N_EMAC0_PHYSR_ALTMODE=0x1c : " " " " " "
  118. CONFIG_RX65N_EMAC0_RMII=y
  119. CONFIG_RX65N_EMAC0_PHYADDR=0 : PHY is at address 1
  120. CONFIG_SCHED_WORKQUEUE=y : Work queue support is needed
  121. CONFIG_SCHED_HPWORK=y : High Priority Work queue support
  122. CONFIG_SCHED_LPWORK=y : Low Priority Work queue support
  123. Using the network with NSH
  124. --------------------------
  125. The IP address is configured using DHCP, using the below mentioned configurations :
  126. CONFIG_NETUTILS_DHCPC=y
  127. CONFIG_NETUTILS_DHCPD=y
  128. CONFIG_NSH_DHCPC=y
  129. CONFIG_NETINIT_DHCPC=y
  130. nsh> ifconfig
  131. eth0 HWaddr 00:e0:de:ad:be:ef at UP
  132. IPaddr:10.75.24.53 DRaddr:10.75.24.1 Mask:255.255.254.0
  133. You can use ping to test for connectivity to the host (Careful,
  134. Window firewalls usually block ping-related ICMP traffic). On the
  135. target side, you can:
  136. nsh> ping 10.75.24.250
  137. PING 10.75.24.250 56 bytes of data
  138. 56 bytes from 10.75.24.250: icmp_seq=1 time=0 ms
  139. 56 bytes from 10.75.24.250: icmp_seq=2 time=0 ms
  140. 56 bytes from 10.75.24.250: icmp_seq=3 time=0 ms
  141. 56 bytes from 10.75.24.250: icmp_seq=4 time=0 ms
  142. 56 bytes from 10.75.24.250: icmp_seq=5 time=0 ms
  143. 56 bytes from 10.75.24.250: icmp_seq=6 time=0 ms
  144. 56 bytes from 10.75.24.250: icmp_seq=7 time=0 ms
  145. 56 bytes from 10.75.24.250: icmp_seq=8 time=0 ms
  146. 56 bytes from 10.75.24.250: icmp_seq=9 time=0 ms
  147. 56 bytes from 10.75.24.250: icmp_seq=10 time=0 ms
  148. 10 packets transmitted, 10 received, 0% packet loss, time 10100 ms
  149. On the host side, you should also be able to ping the RX65N-RSK2MB:
  150. $ ping 10.75.24.53
  151. Configure UDP blaster application as mentioned below :
  152. CONFIG_EXAMPLES_UDPBLASTER_HOSTIP=0x0a4b1801 (10.75.24.1) ------> Gateway IP
  153. CONFIG_EXAMPLES_UDPBLASTER_NETMASK=0xfffffe00 (255.255.254.0) --------> Netmask
  154. CONFIG_EXAMPLES_UDPBLASTER_TARGETIP=0x0a4b189b (10.75.24.155) ---------> Target IP
  155. RSPI
  156. -----------
  157. For RX65N RSK2MB board, Following pin is configured for all channels in JA3.
  158. Channel0: Pin number 7 and 8 in JA3 is used for MOSIA and MISOA respectively
  159. Channel1: Pin number 35 and 36 in JA3 is used for MOSIB and MISOB respectively
  160. Channel2: Pin number 18 and 19 in JA3 is used for MOSIC and MISOC respectively
  161. and for enabling these pin need to select DSW-SEL0 by making off SW4-4
  162. USB Host
  163. =============
  164. For the RX65N RSK2MB board, to be used as USB Device, the following Jumper settings need to be done
  165. J7 Short Pin 1 & Pin 2
  166. J16 Short Pin 2 & Pin 3
  167. USB Device
  168. =============
  169. For the RX65N RSK2MB board, to be used as USB Device, the following Jumper settings need to be done
  170. J7 Short Pin 2 & Pin 3
  171. J16 Short Pin 1 & Pin 2
  172. RTC
  173. ==========
  174. NuttX Configurations
  175. ---------------
  176. The configurations listed in Renesas_RX65N_NuttX_RTC_Design.doc need to be enabled.
  177. RTC Testing
  178. ------------------
  179. The test cases mentioned in Renesas_RX65N_RTC_Test_Cases.xls are to be executed
  180. as part of RTC testing.
  181. The following configurations are to be enabled as part of testing RTC examples.
  182. CONFIG_EXAMPLES_ALARM
  183. CONFIG_EXAMPLES_PERIODIC
  184. CONFIG_EXAMPLES_CARRY
  185. USB Device Configurations
  186. --------------------------
  187. The following configurations need to be enabled for USB Device
  188. CONFIG_USBDEV
  189. CONFIG_CDCACM
  190. CONFIG_STDIO_BUFFER_SIZE=64
  191. CONFIG_STDIO_LINEBUFFER
  192. USB Device Testing
  193. ------------------------
  194. The following testing is executed as part of USB Device testing on RX65N target for GRROSE board
  195. echo "This is a test for USB Device" > /dev/ttyACM0
  196. xd 0 0x20000 > /dev/ttyACM0
  197. The output of the commands mentioned above should be seen on the USB Device COM port on teraterm
  198. RSPI Configurations
  199. --------------------------
  200. The following configurations need to be enabled for RSPI
  201. CONFIG_SYSTEM_SPITOOL=y
  202. RSPI Testing
  203. ------------------------
  204. The following testing is executed as part of RSPI testing on RX65N target for RSK2MB board
  205. On RSK2MB board, all three channels 0, 1 and 2 has been brought out and tested.
  206. Following command can be used for testing RSPI communication to slave device.
  207. spi exch -b 0 -x 4 aabbccdd
  208. where b is bus number and x is Number of word to exchange.
  209. RIIC Configurations
  210. --------------------------
  211. The following configurations need to be enabled for RIIC.
  212. CONFIG_SYSTEM_I2CTOOL=y
  213. RIIC Testing
  214. ------------------------
  215. The following testing is executed as part of RIIC testing on RX65N target for RSK2MB board
  216. On RSK2MB board only channel 0 can be tested.
  217. Following command can be used for testing RIIC communication with slave device.
  218. i2c set -b 0 -a 53 -r 0 10
  219. where b is bus number, a is the slave address, r is the register address and 10 is the value to be written.
  220. DTC Configurations
  221. --------------------------
  222. The following configurations need to be enabled for DTC.
  223. CONFIG_SYSTEM_SPITOOL=y
  224. DTC Testing
  225. ------------------------
  226. DTC has been tested using RSPI driver.
  227. USB Host Configurations
  228. --------------------------
  229. The following configurations need to be enabled for USB Host Mode driver to
  230. support USB HID Keyboard class and MSC Class.
  231. CONFIG_USBHOST=y
  232. CONFIG_USBHOST_HIDKBD=y
  233. CONFIG_FS_FAT=y
  234. CONFIG_EXAMPLES_HIDKBD=y
  235. USB Host Driver Testing
  236. ------------------------
  237. The Following Class Drivers were tested as mentioned below :
  238. - USB HID Keyboard Class
  239. On the NuttX Console "hidkbd" application was executed
  240. nsh> hidkbd
  241. The characters typed from the keyboard were executed correctly.
  242. - USB MSC Class
  243. The MSC device is enumerated as sda in /dev directory.
  244. The block device is mounted using the command as mentioned below :
  245. mount -t vfat /dev/sda /mnt
  246. The MSC device is mounted in /dev directory
  247. The copy command is executed to test the Read/Write functionality
  248. cp /mnt/<file.txt> /mnt/file_copy.txt
  249. USB Host Hub Configurations
  250. --------------------------
  251. The following configurations need to be enabled for USB Host Mode driver to
  252. support USB HID Keyboard class and MSC Class.
  253. CONFIG_RX65N_USBHOST=y
  254. CONFIG_USBHOST_HUB=y
  255. CONFIG_USBHOST_ASYNCH=y
  256. CONFIG_USBHOST=y
  257. CONFIG_USBHOST_HIDKBD=y
  258. CONFIG_FS_FAT=y
  259. CONFIG_EXAMPLES_HIDKBD=y
  260. USB Host Hub Driver Testing
  261. ------------------------
  262. The Following Class Drivers were tested as mentioned below :
  263. - USB HID Keyboard Class
  264. On the NuttX Console "hidkbd" application was executed
  265. nsh> hidkbd
  266. The characters typed from the keyboard were executed correctly.
  267. - USB MSC Class
  268. The MSC device is enumerated as sda in /dev directory.
  269. The block device is mounted using the command as mentioned below :
  270. mount -t vfat /dev/sda /mnt
  271. The MSC device is mounted in /dev directory
  272. The copy command is executed to test the Read/Write functionality
  273. cp /mnt/<file.txt> /mnt/file_copy.txt
  274. Debugging
  275. ==========
  276. 1. NuttX needs to be compiled in Cygwin environment on Windows.
  277. The following Configuration needs to be set, in order to do source level debugging.
  278. CONFIG_DEBUG_SYMBOLS = y (Set this option, using menuconfig only, DO NOT Enable this as default configuration).
  279. 2. Download & Install Renesas e2studio IDE
  280. 3. Load the project(NuttX built on Cygwin) as Makefile project with existing code
  281. 4. Right click on the project, and select Debug Configurations
  282. 5. The binary(NuttX) needs to be loaded using E1/E2 Emulator
  283. 6. Select the Device name as R5F565NE and Emulator as E1/E2(whichever is being used)
  284. 7. Select Connection type as JTAG
  285. 8. Load and run the binary
  286. Flashing NuttX
  287. ===============
  288. Alternatively, NuttX binary can be flashed using Renesas flash programmer tool without using e2 studio/Cygwin
  289. Below are the steps mentioned to flash NuttX binary using Renesas flash programmer tool(RFP).
  290. 1.In order to flash using Renesas flash programmer tool, nuttx.mot file should be generated.
  291. 2. Add the following lines in tools/Makefile.unix file :
  292. ifeq ($(CONFIG_MOTOROLA_SREC),y)
  293. @echo "CP: nuttx.mot"
  294. $(Q) $(OBJCOPY) $(OBJCOPYARGS) $(BIN) -O srec -I elf32-rx-be-ns nuttx.mot
  295. endif
  296. 3. Add CONFIG_MOTOROLA_SREC=y in defconfig file or choose make menucofig->Build Setup-> Binary Output Format->
  297. Select Motorola SREC format.
  298. 4. Download Renesas flash programmer tool from https://www.renesas.com/in/en/products/software-tools/tools/programmer/renesas-flash-programmer-programming-gui.html#downloads
  299. 5. Refer to the user manual document, for steps to flash NuttX binary using RFP tool.