README.txt 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183
  1. boards/mips/pic32mx/pic32mx-starterkit README
  2. ===============================
  3. This README file discusses the port of NuttX to the Microchip PIC32 Ethernet
  4. Starter Kit (DM320004) with either
  5. 1) The Multimedia Expansion Board (MEB, DM320005), or
  6. 2) The Starter Kit I/O Expansion Board
  7. See www.microchip.com for further information.
  8. The PIC32 Ethernet Starter Kit includes:
  9. - PIC32MX795F512L 32-bit microcontroller.
  10. - PIC32MX795F512L USB microcontroller for on-board debugging.
  11. - Green power indicator LED.
  12. - Orange debug indicator LED.
  13. - Three user-defined indicator LEDs.
  14. - Ethernet 10/100 bus speed indicator LED.
  15. - Three push button switches for user-defined inputs.
  16. - On-board crystal for precision microcontroller clocking (8 MHz).
  17. - 50 MHz Ethernet PHY oscillator.
  18. - 32 kHz oscillator (optional).
  19. - USB connectivity for on-board debugger communications.
  20. - USB Host and OTG power supply for powering PIC32 USB applications.
  21. - USB Type A receptacle connectivity for PIC32 host-based applications.
  22. - USB Type micro-AB receptacle for OTG and USB device connectivity for PIC32
  23. OTG/device-based applications.
  24. - RJ-45 Ethernet port (External Ethernet PHY).
  25. The MEB adds:
  26. - 3.2 inch (8.1 cm) QVGA touch screen display with backlight
  27. - Solomon Systech Graphics Controller (SSD1926)
  28. - Five user-controlled LEDs
  29. - Power LED
  30. - Four-way joystick
  31. - Fire button
  32. - Headphone jack
  33. - Line output jack
  34. - Microphone input jack
  35. - microSD card slot.
  36. - Accelerometer and temperature sensor
  37. - 24LC08 EEPROM.
  38. - SPI Flash
  39. - 24-bit audio codec
  40. - CPLD for SPI and Chip Select configuration
  41. - Integrated 802.11 wireless connectivity
  42. The Starter Kit I/O Expansion Board:
  43. Mostly just brings out all of the pins from the tiny Starter Kit connector.
  44. Contents
  45. ========
  46. PIC32MX795F512L Pin Out
  47. MEB Connector
  48. PICtail
  49. Serial Output using the
  50. Toolchains
  51. Creating Compatible NuttX HEX files
  52. Serial Console: MEB
  53. Serial Console: Starter Kit I/O Expansion Board
  54. LEDs
  55. PIC32MX Configuration Options
  56. Configurations
  57. PIC32MX795F512L Pin Out
  58. =======================
  59. LEFT SIDE, TOP-TO-BOTTOM (if pin 1 is in upper left)
  60. --- ---------------------------------- -------------------------- -----------------------------------------------
  61. PIN CONFIGURATIONS SIGNAL NAME ON-BOARD CONNECTIONS
  62. (Family Data Sheet Table 1-1) (Starter Kit User Guide)
  63. --- ---------------------------------- -------------------------- -----------------------------------------------
  64. 1 RG15/AERXERR ERXERR Ethernet RX_ER/MDIX_IN
  65. 2 VDD P32_VDD ---
  66. 3 PMD5/RE5 PMPD5/RE5 J2 pin 13
  67. 4 PMD6/RE6 PMPD6/RE6 J2 pin 9
  68. 5 PMD7/RE7 PMPD7/RE7 J2 pin 7
  69. 6 RC1/T2CK T2CLK/RC1 J2 pin 35 (timer)
  70. 7 RC2/AC2TX/T3CK T3CLK/RC2 J2 pin 37 (timer)
  71. 8 RC3/AC2RX/T4CK T4CLK/RC3 J2 pin 39 (timer)
  72. 9 RC4/SDI1/T5CK SDI1/T4CLK/RC4 J2 pin 41 (timer)
  73. J2 pin 93 (SPI1)
  74. 10 PMA5/CN8/ECOL/RG6/SCK2/U3RTS/U6TX PMPA5/SCM2C/CN8/RG6 J2 pin 45 (SPI2)
  75. J2 pin 117 (PMP address)
  76. 11 PMA4/CN9/ECRS/RG7/SDA4/SDI2/U3RX PMPA4/SCM2A/CN9/RG7 J2 pin 47 (SPI2)
  77. J2 pin 119 (PMP address)
  78. 12 PMA3/AECRSDV/AERXDV/CN10/ECRSDV/ ECRS_DV Ethernet CRS/CRS_DV/LED_CFG
  79. ERXDV/RG8/SCL4/SDO2/U3TX
  80. 13 MCLR PIC32_MCLR (pulled up)
  81. PIC32MX440F512H debug processor
  82. J2 pin 130 (ICSP)
  83. 14 PMA2/AEREFCLK/AERXCLK/CN11/ EREF_CLK 50MHz clock, Ethernet X1
  84. EREFCLK/ERXCLK/RG9/SS2/U3CTS/
  85. U6RX
  86. 15 VSS (grounded) ---
  87. 16 VDD P32_VDD ---
  88. 17 RA0/TMS TMS/RA0 J2 pin 126 (JTAG/GPIO)
  89. 18 AERXD0/INT1/RE8 ERXD0(2) Ethernet RXD_0/PHYAD1
  90. 19 AERXD1/INT2/RE9 ERXD1(2) Ethernet RXD_1/PHYAD2
  91. 20 AN5/C1IN+/CN7/RB5/VBUSON VBUSON/C1IN+/AN5/CN7/RB5 USB host power supply, TPS20x1B ~EN,
  92. Low enables power to host port (J4)
  93. USB OTG power supply, MCP1253_MSOP ~SHDN
  94. Enables power to device/OTG port (J5)
  95. J2 pin 63 (comparator 1)
  96. J2 pin 62 (A/D)
  97. 21 AN4/C1IN-/CN6/RB4 USBOEN/C1IN-/AN4/CN6/RB4 J2 pin 65 (comparator 1)
  98. J2 pin 64 (A/D)
  99. 22 AN3/C2IN+/CN5/RB3 C2IN+/AN3/CN5/RB3 TPS20x1B ~OC, sense host port power
  100. MCP1253_MSOP PGOOD, sense device/OTG port power
  101. J2 pin 67 (comparator 2)
  102. J2 pin 66 (A/D)
  103. 23 AN2/C2IN-/CN4/RB2 C2IN-/AN2/CN4/RB2 J2 pin 69 (comparator 2)
  104. J2 pin 101
  105. J2 pin 68 (A/D)
  106. 24 AN1/CN3/PGEC1/RB1 PGC1/AN1/CN3/RB1 J2 pin 70 (A/D)
  107. 25 AN0/CN2/PGED1/RB0 PGD1/AN0/CN2/RB0 J2 pin 72 (A/D)
  108. BOTTOM SIDE, LEFT-TO-RIGHT (if pin 1 is in upper left)
  109. --- ---------------------------------- -------------------------- -----------------------------------------------
  110. PIN CONFIGURATIONS SIGNAL NAME ON-BOARD CONNECTIONS
  111. (Family Data Sheet Table 1-1) (Starter Kit User Guide)
  112. --- ---------------------------------- -------------------------- -----------------------------------------------
  113. 26 AN6/OCFA/PGEC2/RB6 PIC32_PGC2 PIC32MX440F512H debug processor
  114. J2 pin 128 (ICSP)
  115. 27 AN7/PGED2/RB7 PIC32_PGD2/DBG_SD0 PIC32MX440F512H debug processor
  116. J2 pin 132 (ICSP)
  117. 28 PMA7/AERXD2/CVREF-/RA9 PMPA7/VREF-/RA9 J2 pin 113 (PMP address)
  118. J2 pin 114 (A/D ref)
  119. 29 PMA6/AERXD3/CVREF+/RA10/VREF+ PMPA6/VREF+/RA10 J2 pin 115 (PMP address)
  120. J2 pin 116 (A/D ref)
  121. 30 AVDD P32_VDD ---
  122. 31 AVSS (grounded) ---
  123. 32 AN8/C1OUT/RB8 C1OUT/AN8/RB8 J2 pin 71
  124. 33 AN9/C2OUT/RB9 C2OUT/AN9/RB9 J2 pin 73
  125. 34 PMA13/AN10/RB10/CVREFOUT PMPA13/CVREF/AN10 J2 pin 101 (PMP address)
  126. J2 pin 102 (Comparator ref)
  127. 35 PMA12/AETXERR/AN11/ERXERR/RB11 PMPA12/AN11/RB11 J2 pin 103 (PMP address)
  128. 36 VSS (grounded) ---
  129. 37 VDD P32_VDD ---
  130. 38 RA1/TCK TCK/RA1 PIC32MX440F512H debug processor
  131. J2 pin 124 (JTAG/GPIO)
  132. 39 AC1TX/RF13/SCK4/U2RTS/U5TX SCM3D/BCLK2/RF13 J2 pin 106 (UART2)
  133. 40 AC1RX/RF12/SS4/U2CTS/U5RX SCM3C/RF12 J2 pin 108 (UART2)
  134. 41 PMA11/AECRS/AN12/ERXD0/RB12 PMPA11/AN12/RB12 J2 pin 105 (PMP address)
  135. 42 PMA10/AECOL/AN13/ERXD1/RB13 PMPA10/AN13/RB13 J2 pin 107 (PMP address)
  136. 43 PMA1/AETXD3/AN14/ERXD2/PMALH/RB14 PMPA1/AN14/RB14 J2 pin 127 (PMP address)
  137. 44 PMA0/AETXD2/AN15/CN12/ERXD3/OCFB/ PMPA0/AN15/OCFB/CN12 J2 pin 129 (PMP address)
  138. PMALL/RB15 J2 pin 36
  139. 45 VSS (grounded) ---
  140. 46 VDD P32_VDD ---
  141. 47 AETXD0/CN20/RD14/SS3/U1CTS/U4RX EXTD0(2) Ethernet TXD_0
  142. 48 AETXD1/CN21/RD15/SCK3/U1RTS/U4TX EXTD1(2) Ethernet TXD_1
  143. 49 PMA9/CN17/RF4/SDA5/SDI4/U2RX PMPA9/SCM3A/CN17/RF4 J2 pin 109 (PMP address)
  144. J2 pin 110 (UART2)
  145. 50 PMA8/CN18/RF5/SCL5/SDO4/U2TX PMPA8/SCM3B/CN18/RF5 J2 pin 111 (PMP address)
  146. J2 pin 112 (UART2)
  147. RIGHT SIDE, TOP-TO-BOTTOM (if pin 1 is in upper left)
  148. --- ---------------------------------- -------------------------- -----------------------------------------------
  149. PIN CONFIGURATIONS SIGNAL NAME ON-BOARD CONNECTIONS
  150. (Family Data Sheet Table 1-1) (Starter Kit User Guide)
  151. --- ---------------------------------- -------------------------- -----------------------------------------------
  152. 75 VSS (grounded)
  153. 74 CN0/RC14/SOSCO/T1CK SOSC0/T1CK/CN0/RC14 32kHz Oscillator, J2 pin (timer)
  154. J2 pin 32 (secondary OSC)
  155. 73 CN1/RC13/SOSCI SOSC1/CN1/RC13 32kHz Oscillator
  156. J2 pin 32 (secondary OSC)
  157. 72 OC1/INT0/RD0/SDO1 SDO1/INT0/OC1/RD0 User LED D4 (high illuminates)
  158. J2 pin 87 (EXT_INT)
  159. J2 pin 95 (SPI1)
  160. J2 pin 46 (OC/PWM)
  161. 71 PMA14/AEMDC/EMDC/IC4/PMCS1/RD11 EMDC Ethernet MDC
  162. 70 PMA15/IC3/PMCS2/RD10/SCK1 SCK1/IC3/PMPCS2/RD10 J2 pin 29 (PMP control)
  163. J2 pin 91 (SPI1)
  164. J2 pin 52 (input capture)
  165. 69 IC2/RD9/SS1 SS1/IC2/RD9 J2 pin 54 (input capture)
  166. 68 AEMDIO/EMDIO/IC1/RD8/RTCC EMDIO Ethernet MDIO
  167. 67 AETXEN/INT4/RA15/SDA1 ETXEN(2) Ethernet TX_EN
  168. 66 AETXCLK/INT3/RA14/SCL1 INT3/SCL1/RA14 Ethernet PWR_DOWN/INT
  169. 65 VSS (grounded) ---
  170. 64 CLKO/OSC2/RC15 8MHz crystal
  171. 63 CLKI/OSC1/RC12 8MHz crystal
  172. 62 VDD P32_VDD ---
  173. 61 RA5/TDO TDO/RA5 PIC32MX440F512H debug processor
  174. J2 pin 118 (JTAG/GPIO)
  175. 60 RA4/TDI TDI/RA4 PIC32MX440F512H debug processor
  176. 59 RA3/SDA2 SDA2/RA3 J2 pin 74 (I2C2)
  177. 58 RA2/SCL2 SCL2/RA2 J2 pin 76 (I2C2)
  178. 57 D+/RG2 D+/RG2 Host port (J4), Device OTG port (J5)
  179. 56 D-/RG3 D-/RG3 Host port (J4), Device OTG port (J5)
  180. 55 VUSB P32_VDD ---
  181. 54 VBUS P32_VBUS ---
  182. 53 RF8/SCL3/SDO3/U1TX SCM1B/RF8 J2 pin 90 (UART1)
  183. 52 RF2/SDA3/SDI3/U1RX SCM1A/RF2 J2 pin 88 (UART1)
  184. 51 RF3/USBID USBID/RF3 Device OTG port (J5)
  185. TOP SIDE, LEFT-TO-RIGHT (if pin 1 is in upper left)
  186. --- ---------------------------------- -------------------------- -----------------------------------------------
  187. PIN CONFIGURATIONS SIGNAL NAME ON-BOARD CONNECTIONS
  188. (Family Data Sheet Table 1-1) (Starter Kit User Guide)
  189. --- ---------------------------------- -------------------------- -----------------------------------------------
  190. 100 PMD4/RE4 PMPD4/RE4 J2 pin 15 (PMP data)
  191. 99 PMD3/RE3 PMPD3/RE3 J2 pin 17 (PMP data)
  192. 98 PMD2/RE2 PMPD2/RE2 J2 pin 19 (PMP data)
  193. 97 RG13/TRD0 TRD0/RG13 J2 pin 8 (Trace/GPIO)
  194. 96 RG12/TRD1 TRD1/RG12 J2 pin 5
  195. 95 RG14/TRD2 TRD2/RG14 J2 pin 3
  196. 94 PMD1/RE1 PMPD1/RE1 J2 pin 21 (PMP data)
  197. 93 PMD0/RE0 PMPD0/RE0 J2 pin 23 (PMP data)
  198. 92 RA7/TRD3 TRD3/RA7 J2 pin 6 (Trace/GPIO)
  199. 91 RA6/TRCLK TRCLK/RA6 J2 pin 4 (Trace/GPIO)
  200. 90 PMD8/C2RX/RG0 PMPD8/RG0 J2 pin 10 (PMP data)
  201. 89 PMD9/C2TX/ETXERR/RG1 PMPD9/RG1 J2 pin 14 (PMP data)
  202. 88 PMD10/C1TX/ETXD0/RF1 PMPD10/RF1 J2 pin 16 (PMP data)
  203. 87 PMD11/C1RX/ETXD1/RF0 PMPD11/RF0 J2 pin 18 (PMP data)
  204. 86 VDD P32_VDD ---
  205. 85 VCAP/VCORE (capacitor to ground) ---
  206. 84 PMD15/CN16/ETXCLK/RD7 PMPD15/CN16/RD7 Switch SW2 (low when closed)
  207. J2 pin 26 (PMP data)
  208. 83 PMD14/CN15/ETXEN/RD6 PMPD14/CN15/RD6 Switch SW1 (low when closed)
  209. J2 pin 24 (PMP data)
  210. 82 CN14/PMRD/RD5 PMPRD/CN14/RD5 J2 pin 25
  211. 81 CN13/OC5/PMWR/RD4 PMPWR/OC5/C13/RD4 J2 pin 28 (PMP control)
  212. J2 pin 38
  213. 80 PMD13/CN19/ETXD3/RD13 CN19/PMPD13/RD13 Switch SW3 (low when closed)
  214. J2 pin 22 (PMP data)
  215. 79 PMD12/ETXD2/IC5/RD12 IC5/PMPD12/RD12 J2 pin 20 (PMP data)
  216. J2 pin 48
  217. 78 OC4/RD3 OC4/RD3 J2 pin 40 (OC/PWM)
  218. 77 OC3/RD2 OC3/RD2 User LED D5 (high illuminates)
  219. J2 pin 42 (OC/PWM)
  220. 76 OC2/RD1 OC1/RD1 User LED D6 (high illuminates)
  221. J2 pin 44 (OC/PWM)
  222. MEB Connector
  223. =============
  224. The following table summarizes how the pins brought the MEB through the
  225. J2 on the Ethernet Starter Kit are mapped. This connect is J2 on the Ethernet
  226. Starter Kit and J3 on the MEB.
  227. J3
  228. PIC32 SIGNAL PIN CONNECTION
  229. -------------------------- ------- ----------------------------------
  230. PMPD0 pin 23 Graphics Controller (SSD1926)
  231. PMPD1 pin 21 8-bit or 16-bit Data Bus
  232. PMPD2 pin 19
  233. PMPD3 pin 17
  234. PMPD4 pin 15
  235. PMPD6 pin 9
  236. PMPD7 pin 7
  237. -------------------------- ------- ----------------------------------
  238. PMPD8 pin 10 Graphics Controller (SSD1926)
  239. PMPD9 pin 14 16-bit Data Bus
  240. PMPD10 pin 16
  241. PMPD11 pin 18
  242. PMPD12 pin 20
  243. PMPD13 pin 22
  244. PMPD14 pin 24
  245. PMPD15 pin 26
  246. -------------------------- ------- ----------------------------------
  247. Graphics Controller (SSD1926)
  248. RG13 pin 8 Chip select
  249. RB10 pin 101 Register select
  250. RC3 pin 39 Wait line
  251. RA10 pin 115 Reset (see MRF24WBOMA and PICtail)
  252. -------------------------- ------- ----------------------------------
  253. Touchscreen
  254. RB11 pin 103 X+
  255. RB12 pin 105 Y-
  256. RB13 pin 107 X-
  257. RB14 pin 127 Y+
  258. -------------------------- ------- ----------------------------------
  259. Joystick
  260. CN2/RB0 pin 72 Left
  261. CN3/RB1 pin 70 Up
  262. CN5/RB3 pin 66 Down
  263. CN6/RB4 pin 64 Right
  264. CN12/RB15 pin 36 Fire
  265. -------------------------- ------- ----------------------------------
  266. LEDs
  267. RD1 pin 44 LED1
  268. RD2 pin 42 LED2
  269. RD3 pin 40 LED3
  270. RC1 pin 35 LED4
  271. RC2 pin 37 LED5
  272. -------------------------- ------- ----------------------------------
  273. SDA2 pin 74 I2C2 bus for BMA150, MCHP24LC08
  274. SCL2 pin 76 and WM8731 (see also MRF24WBOMA)
  275. -------------------------- ------- ----------------------------------
  276. SCK1 pin 91 SPI1 bus for WM8731
  277. SDI1 pin 93
  278. SDO1 pin 95
  279. -------------------------- ------- ----------------------------------
  280. RA6 pin 4 CPLD
  281. RA7 pin 6
  282. RG12 pin 5
  283. RG14 pin 3
  284. SCK2 pin 45 (see MRF24WBOMA)
  285. SDI2 pin 47 (see MRF24WBOMA)
  286. SDO2 pin 49 (see MRF24WBOMA)
  287. RG9 pin 51 (see MRF24WBOMA)
  288. SCK3A pin 106 (see PICtail)
  289. SDI3A pin 110 (see PICtail)
  290. SDO3A pin 112 (see PICtail)
  291. RF12 pin 108 (see PICtail)
  292. ~SSI pin 97 (see PICtail)
  293. RD9 pin 54
  294. -------------------------- ------- ----------------------------------
  295. INT3 pin 81 MRF24WBOMA
  296. RA10 pin 115 (also Graphics Controller and PICtail)
  297. RB8 pin 71
  298. -------------------------- ------- ----------------------------------
  299. PICtail J5
  300. SDA2 pin 74 I2C2 bus (see above)
  301. SCL2 pin 76 I2C2 bus (see above)
  302. SCK2 pin 45 (see CPLD)
  303. SDI2 pin 47 (see CPLD)
  304. SDO2 pin 49 (see CPLD)
  305. RG9 pin 51 (see CPLD)
  306. U1RX pin 88
  307. U1TX pin 90
  308. ~U1RTS pin 92
  309. ~U1CTS pin 94
  310. RB9 pin 73
  311. RA10 pin 115 Reset (see Graphics controller and MRF24WBOMA)
  312. INT1 pin 85
  313. SCL1 pin 84
  314. SDA1 pin 86 (see CPLD)
  315. ~SSI pin 97 (see CPLD)
  316. U2RX pin 110 (see CPLD)
  317. U2TX pin 112 (see CPLD)
  318. ~U2RTS pin 106 (see CPLD)
  319. ~U2CTS pin 108 (see CPLD)
  320. PICtail
  321. =======
  322. The MEB brings many of the signals out via the PICtail (J5). J5 is
  323. a 28 pin connector bringing out signals as summarized here (J3 is the
  324. designation of the connection to the Ethernet starter kit on the
  325. MEB side):
  326. --- --- ------------------------
  327. J3 J5 Table 2-1
  328. PIN PIN Description
  329. --- --- ------------------------
  330. 1 3.3V
  331. 2 I/O_4 (Test Point)
  332. 76 3 SCL2
  333. 84 4 SCL1
  334. 74 5 SDA2
  335. 86 6 SDA1
  336. 47 7 SDI2/SDI2A/CN9/RG7
  337. 97 8 SS1, WFI_SDO
  338. 49 9 SDO2/SDO2A
  339. 10 WFI_SDI
  340. 45 11 SCK2/SCK2A
  341. 12 WFI_SCK
  342. 51 13 SS2/SS2A/RG9
  343. 14 SS1/RB2
  344. 88 15 U1RX/SDI1A
  345. 110 16 U2RX/SDI3A
  346. 90 17 U1TX/RA10
  347. 112 18 U2TX/SDO3A
  348. 92 19 U1RTS/C2OUT/AN9
  349. 106 20 U2RTS/SCK3A
  350. 94 21 U1CTS/SDO1A
  351. 108 22 U2CTS/SS3A/RF12
  352. 73 23 RB9/INT1/RE8
  353. 115 25 RA10/SCK1A
  354. 26 3.3V
  355. 85 27 INT1/SS1/RD14
  356. 28 GND
  357. Toolchains
  358. ==========
  359. MPLAB/C32
  360. ---------
  361. I am using the free, "Lite" version of the PIC32MX toolchain available
  362. for download from the microchip.com web site. I am using the Windows
  363. version. The MicroChip toolchain is the only toolchain currently
  364. supported in these configurations, but it should be a simple matter to
  365. adapt to other toolchains by modifying the Make.defs file include in
  366. each configuration.
  367. C32 Toolchain Options:
  368. CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW - MicroChip full toolchain for Windows
  369. CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL - MicroChip full toolchain for Linux
  370. CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE - MicroChip "Lite" toolchain for Windows
  371. CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL_LITE - MicroChip "Lite" toolchain for Linux
  372. CONFIG_MIPS32_TOOLCHAIN_PINGUINOL - Pinquino toolchain for Linux
  373. CONFIG_MIPS32_TOOLCHAIN_PINGUINOW - Pinquino toolchain for Windows
  374. CONFIG_MIPS32_TOOLCHAIN_MICROCHIPOPENL - Microchip open toolchain for Linux
  375. CONFIG_MIPS32_TOOLCHAIN_GNU_ELF - General mips-elf toolchain for Linux
  376. NOTE: The "Lite" versions of the toolchain does not support C++. Also
  377. certain optimization levels are not supported by the "Lite" toolchain.
  378. MicrochipOpen
  379. -------------
  380. An alternative, build-it-yourself toolchain is available here:
  381. http://sourceforge.net/projects/microchipopen/ . These tools were
  382. last updated circa 2010. NOTE: C++ support still not available
  383. in this toolchain.
  384. Building MicrochipOpen (on Linux)
  385. 1) Get the build script from this location:
  386. http://microchipopen.svn.sourceforge.net/viewvc/microchipopen/ccompiler4pic32/buildscripts/trunk/
  387. 2) Build the code using the build script, for example:
  388. ./build.sh -b v105_freeze
  389. This will check out the selected branch and build the tools.
  390. 3) Binaries will then be available in a subdirectory with a name something like
  391. pic32-v105-freeze-20120622/install-image/bin (depending on the current data
  392. and the branch that you selected.
  393. Note that the tools will have the prefix, mypic32- so, for example, the
  394. compiler will be called mypic32-gcc.
  395. Pinguino mips-elf Toolchain
  396. ---------------------------
  397. Another option is the mips-elf toolchain used with the Pinguino project. This
  398. is a relatively current mips-elf GCC and should provide free C++ support as
  399. well. This toolchain can be downloaded from the Pinguino website:
  400. http://wiki.pinguino.cc/index.php/Main_Page#Download .
  401. See also boards/mirtoo/README.txt. There is an experimental (untested)
  402. configuration for the Mirtoo platform in that directory.
  403. MPLAB/C32 vs MPLABX/X32
  404. -----------------------
  405. It appears that Microchip is phasing out the MPLAB/C32 toolchain and replacing
  406. it with MPLABX and XC32. At present, the XC32 toolchain is *not* compatible
  407. with the NuttX build scripts. Here are some of the issues that I see when trying
  408. to build with XC32:
  409. 1) Make.def changes: You have to change the tool prefix:
  410. CROSSDEV=xc32-
  411. 2) debug.ld/release.ld: The like expect some things that are not present in
  412. the current linker scripts (or are expected with different names). Here
  413. are some partial fixes:
  414. Rename: kseg0_progmem to kseg0_program_mem
  415. Rename: kseg1_datamem to kseg1_data_mem
  416. Even then, there are more warnings from the linker and some undefined symbols
  417. for non-NuttX code that resides in the unused Microchip libraries. You will
  418. have to solve at least this undefined symbol problem if you want to used the
  419. XC32 toolchain.
  420. Windows Native Toolchains
  421. -------------------------
  422. NOTE: There are several limitations to using a Windows based toolchain in a
  423. Cygwin environment. The three biggest are:
  424. 1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
  425. performed automatically in the Cygwin makefiles using the 'cygpath' utility
  426. but you might easily find some new path problems. If so, check out 'cygpath -w'
  427. 2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
  428. are used in NuttX (e.g., include/arch). The make system works around these
  429. problems for the Windows tools by copying directories instead of linking them.
  430. But this can also cause some confusion for you: For example, you may edit
  431. a file in a "linked" directory and find that your changes had no effect.
  432. That is because you are building the copy of the file in the "fake" symbolic
  433. directory. If you use a Windows toolchain, you should get in the habit of
  434. making like this:
  435. make clean_context all
  436. An alias in your .bashrc file might make that less painful.
  437. Powering the Board
  438. ==================
  439. Ethernet Starter Kit:
  440. There are two ways to supply power to the PIC32 Ethernet Starter Kit:
  441. - USB bus power connected to USB debug connector J1.
  442. - An external application board with a regulated DC power supply that
  443. provides +5V can be connected to the J2 application board connector
  444. that is provided on the bottom side of the board.
  445. One green LED (D3) is provided to show that the PIC32 microcontroller
  446. is powered up.
  447. Ethernet Starter Kit with MEB:
  448. Power can be supplied to the Multimedia Expansion Board through the DC
  449. connector located on the Multimedia Expansion Board... By connecting
  450. 9-14V power supply to the DC connector, the Multimedia Expansion Board
  451. and starter kit will receive the proper voltages. The user can also
  452. supply power via the starter kit. However, if the application uses
  453. multiple features of the Multimedia Expansion Board, it is recommended
  454. to use 9-14V power supply."
  455. On Board Debug Support
  456. ======================
  457. The PIC32 Ethernet Starter Kit includes a PIC32MX440F512H USB microcontroller
  458. that provides debugger connectivity over USB. The PIC32MX440F512H is hard-wired
  459. to the PIC32 device to provide two types of protocol translation:
  460. - I/O pins of PIC32MX440F512H to the ICSP™ pins of the PIC32
  461. - I/O pins of PIC32MX440F512H to the JTAG pins of the PIC32
  462. The PIC32 Ethernet Starter Kit currently uses the JTAG pins of the PIC32 device for
  463. programming and debugging.
  464. Creating Compatible NuttX HEX files
  465. ===================================
  466. Intel Hex Format Files:
  467. -----------------------
  468. When NuttX is built it will produce two files in the top-level NuttX
  469. directory:
  470. 1) nuttx - This is an ELF file, and
  471. 2) nuttx.hex - This is an Intel Hex format file. This is controlled by
  472. the setting CONFIG_INTELHEX_BINARY in the .config file.
  473. The PICkit tool wants an Intel Hex format file to burn into FLASH. However,
  474. there is a problem with the generated nutt.hex: The tool expects the nuttx.hex
  475. file to contain physical addresses. But the nuttx.hex file generated from the
  476. top-level make will have address in the KSEG0 and KSEG1 regions.
  477. tools/pic32/mkpichex:
  478. ----------------------
  479. There is a simple tool in the NuttX tools/pic32 directory that can be
  480. used to solve both issues with the nuttx.hex file. But, first, you must
  481. build the tool:
  482. cd tools/pic32
  483. make -f Makefile.host
  484. Now you will have an executable file call mkpichex (or mkpichex.exe on
  485. Cygwin). This program will take the nutt.hex file as an input, it will
  486. convert all of the KSEG0 and KSEG1 addresses to physical address, and
  487. it will write the modified file, replacing the original nuttx.hex.
  488. To use this file, you need to do the following things:
  489. export PATH=??? # Add the NuttX tools/pic32 directory to your
  490. # PATH variable
  491. make # Build nuttx and nuttx.hex
  492. mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path
  493. # to the top-level build directory. It is the only
  494. # required input to mkpichex.
  495. This procedure is automatically performed at the end of a build.
  496. Serial Console: MEB
  497. ===================
  498. [[Warning: This all sounds great, but the fact is that I have not yet
  499. gotten any serial UART output to work from the MEB.]]
  500. A serial console is not required to use NuttX. However, all of the
  501. NuttX example code in the apps/examples assumes that you have a
  502. serial console. The Ethernet Starter Kit(even with the MEB) does not
  503. have any RS-232 connector needed to drive the serial console.
  504. Raw UART signals are available at the MEB's PICtail connector, however,
  505. and can be connected to an external MAX2232 board to get a serial console.
  506. The defconfig files are set up to use UART2. So the proper connections
  507. would be:
  508. PICtail
  509. PIN FUNCTION
  510. -------- -----------
  511. 1 3.3V
  512. 16 U2RX
  513. 18 U2TX
  514. 28 GND
  515. UART1 is also brought out on the PICtail and would be connected as:
  516. PICtail
  517. PIN FUNCTION
  518. -------- -----------
  519. 1 3.3V
  520. 15 U1RX
  521. 17 U1TX
  522. 28 GND
  523. Here is a summary of the tortuous routes taken by the PIC32MX UART pins:
  524. --- ---------------------------------- -------------------------- -------------------------
  525. PIN CONFIGURATIONS SIGNAL NAME ON-BOARD CONNECTIONS
  526. (Family Data Sheet Table 1-1) (Starter Kit User Guide)
  527. --- ---------------------------------- -------------------------- -------------------------
  528. 39 AC1TX/RF13/SCK4/U2RTS/U5TX SCM3D/BCLK2/RF13 J2 pin 106 (UART2)
  529. 40 AC1RX/RF12/SS4/U2CTS/U5RX SCM3C/RF12 J2 pin 108 (UART2)
  530. 49 PMA9/CN17/RF4/SDA5/SDI4/U2RX PMPA9/SCM3A/CN17/RF4 J2 pin 109 (PMP address)
  531. J2 pin 110 (UART2)
  532. 50 PMA8/CN18/RF5/SCL5/SDO4/U2TX PMPA8/SCM3B/CN18/RF5 J2 pin 111 (PMP address)
  533. J2 pin 112 (UART2)
  534. 52 RF2/SDA3/SDI3/U1RX SCM1A/RF2 J2 pin 88 (UART1)
  535. 53 RF8/SCL3/SDO3/U1TX SCM1B/RF8 J2 pin 90 (UART1)
  536. J2 is the connector at the bottom of the Ethernet start kit that
  537. mates the Ethernet Starter kit to the MEB. The MEB then makes the
  538. following signals available on the PICtail (J5):
  539. MEB Connector:
  540. -------------------------- ------- ----------------------------------
  541. Signal J3
  542. -------------------------- -------
  543. U1RX pin 88
  544. U1TX pin 90
  545. ~U1RTS pin 92
  546. ~U1CTS pin 94
  547. U2RX pin 110
  548. U2TX pin 112
  549. ~U2RTS pin 106
  550. ~U2CTS pin 108
  551. -------------------------- -------
  552. PICtail:
  553. The pins are labeled differently in Table 2-1 and in the schematic. This is
  554. confusing. I will trust Table 2-1.
  555. --- --- ------- --- --- -----------------
  556. Table 2-1 Schematic
  557. J3 J5 J3 J5
  558. PIN PIN NAME PIN PIN Description
  559. --- --- ------- ---- --- ------------
  560. 1 3.3V
  561. 88 15 U1RX 88 15 SDI1A
  562. 110 16 U2RX 110 16 SDI3A
  563. 90 17 U1TX 17 RA10
  564. 90 SD01A
  565. 112 18 U2TX 113 18 SDO3A
  566. 92 19 U1RTS 19 C2OUT/AN9
  567. 92 SCK1A
  568. 106 20 U2RTS 106 20 SCK3A
  569. 94 21 U1CTS 21 SDO1A
  570. 94 SS1/RD14
  571. 108 22 U2CTS 108 22 SS3A/RF12
  572. 26 3.3V
  573. 28 GND
  574. Serial Console: Starter Kit I/O Expansion Board
  575. ===============================================
  576. U1:
  577. Ethernet Starter Kit Expansion I/O board
  578. --------------------------------------------- -------------------------
  579. PIN Description J2 J1 J10/J11
  580. --- ---------------------------------- ------------- ------------------
  581. 47 AETXD0/CN20/RD14/SS3/U1CTS/U4RX Not available N/A
  582. 48 AETXD1/CN21/RD15/SCK3/U1RTS/U4TX Not available N/A
  583. 52 RF2/SDA3/SDI3/U1RX J2 pin 88 J11 pin 41
  584. 53 RF8/SCL3/SDO3/U1TX J2 pin 90 J11 pin 43
  585. U2:
  586. Ethernet Starter Kit Expansion I/O board
  587. --------------------------------------------- -------------------------
  588. PIN Description J2 J1 J10/J11
  589. --- ---------------------------------- ------------- ------------------
  590. 39 AC1TX/RF13/SCK4/U2RTS/U5TX J2 pin 106 J11 pin 42
  591. 40 AC1RX/RF12/SS4/U2CTS/U5RX J2 pin 108 J11 pin 44
  592. 50 PMA8/CN18/RF5/SCL5/SDO4/U2TX J2 pin 111 J10 pin 52
  593. J2 pin 112 J11 pin 48
  594. 49 PMA9/CN17/RF4/SDA5/SDI4/U2RX J2 pin 109 J10 pin 51
  595. J2 pin 110 J11 pin 46
  596. U3:
  597. Ethernet Starter Kit Expansion I/O board
  598. --------------------------------------------- -------------------------
  599. PIN Description J2 J1 J10/J11
  600. --- ---------------------------------- ------------- ------------------
  601. 10 PMA5/CN8/ECOL/RG6/SCK2/U3RTS/U6TX J2 pin 45 J10 pin 23
  602. J2 pin 117 J10 pin 55
  603. 11 PMA4/CN9/ECRS/RG7/SDA4/SDI2/U3RX J2 pin 47 J10 pin 24
  604. J2 pin 119 J10 pin 56
  605. 12 PMA3/AECRSDV/AERXDV/CN10/ECRSDV/ Not available N/A
  606. ERXDV/RG8/SCL4/SDO2/U3TX
  607. 14 PMA2/AEREFCLK/AERXCLK/CN11/
  608. EREFCLK/ERXCLK/RG9/SS2/U3CTS/ Not available N/A
  609. U6RX
  610. U4:
  611. Ethernet Starter Kit Expansion I/O board
  612. --------------------------------------------- -------------------------
  613. PIN Description J2 J1 J10/J11
  614. --- ---------------------------------- ------------- ------------------
  615. 47 AETXD0/CN20/RD14/SS3/U1CTS/U4RX Not available N/A
  616. 48 AETXD1/CN21/RD15/SCK3/U1RTS/U4TX Not available N/A
  617. U5:
  618. Ethernet Starter Kit Expansion I/O board
  619. --------------------------------------------- -------------------------
  620. PIN Description J2 J1 J10/J11
  621. --- ---------------------------------- ------------- ------------------
  622. 39 AC1TX/RF13/SCK4/U2RTS/U5TX J2 pin 106 J11 pin 42
  623. 40 AC1RX/RF12/SS4/U2CTS/U5RX J2 pin 108 J11 pin 44
  624. U6:
  625. PIN Description
  626. --- ----------------------------------
  627. 10 PMA5/CN8/ECOL/RG6/SCK2/U3RTS/U6TX J2 pin 45 J10 pin 23
  628. J2 pin 117 J10 pin 55
  629. 14 PMA2/AEREFCLK/AERXCLK/CN11/ Not available N/A
  630. EREFCLK/ERXCLK/RG9/SS2/U3CTS/
  631. U6RX
  632. LEDs
  633. ====
  634. The PIC32MX Ethernet Starter kit has 3 user LEDs labeled LED1-3 on the
  635. board graphics (but referred to as LED4-6 in the schematic):
  636. PIN User's Guide Board Stencil Notes
  637. --- ------------- -------------- -------------------------
  638. RD0 "User LED D4" "LED1 (RD0") High illuminates (RED)
  639. RD2 "User LED D5" "LED3 (RD2)" High illuminates (YELLOW)
  640. RD1 "User LED D6" "LED2 (RD1)" High illuminates (GREEN)
  641. We will use the labels on the board to identify LEDs. If CONFIG_ARCH_LEDS
  642. is defined, then NuttX will control these LEDs as follows:
  643. ON OFF
  644. ------------------------- ---- ---- ---- ---- ---- ----
  645. LED1 LED2 LED3 LED1 LED2 LED3
  646. ------------------------- ---- ---- ---- ---- ---- ----
  647. LED_STARTED 0 OFF OFF OFF --- --- ---
  648. LED_HEAPALLOCATE 1 ON OFF N/C --- --- ---
  649. LED_IRQSENABLED 2 OFF ON N/C --- --- ---
  650. LED_STACKCREATED 3 ON ON N/C --- --- ---
  651. LED_INIRQ 4 N/C N/C ON N/C N/C OFF
  652. LED_SIGNAL 4 N/C N/C ON N/C N/C OFF
  653. LED_ASSERTION 4 N/C N/C ON N/C N/C OFF
  654. LED_PANIC 5 ON N/C N/C OFF N/C N/C
  655. There are 5 additional LEDs available on the MEB. These are not
  656. used by NuttX.
  657. RD1 LED1
  658. RD2 LED2
  659. RD3 LED3
  660. RC1 LED4
  661. RC2 LED5
  662. PIC32MX Configuration Options
  663. =============================
  664. General Architecture Settings:
  665. CONFIG_ARCH - Identifies the arch/ subdirectory. This should
  666. be set to:
  667. CONFIG_ARCH=mips
  668. CONFIG_ARCH_family - For use in C code:
  669. CONFIG_ARCH_MIPS=y
  670. CONFIG_ARCH_architecture - For use in C code:
  671. CONFIG_ARCH_MIPS32=y
  672. CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory
  673. CONFIG_ARCH_CHIP=pic32mx
  674. CONFIG_ARCH_CHIP_name - For use in C code to identify the exact
  675. chip:
  676. CONFIG_ARCH_CHIP_PIC32MX795F512L=y
  677. CONFIG_ARCH_BOARD - Identifies the boards/ subdirectory and
  678. hence, the board that supports the particular chip or SoC.
  679. CONFIG_ARCH_BOARD=pic32mx-starterkit
  680. CONFIG_ARCH_BOARD_name - For use in C code
  681. CONFIG_ARCH_BOARD_PIC32MX_STARTERKIT=y
  682. CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation
  683. of delay loops
  684. CONFIG_ENDIAN_BIG - define if big endian (default is little
  685. endian)
  686. CONFIG_RAM_SIZE - Describes the installed DRAM (CPU SRAM in this case):
  687. CONFIG_RAM_SIZE=(32*1024) (32Kb)
  688. There is an additional 32Kb of SRAM in AHB SRAM banks 0 and 1.
  689. CONFIG_RAM_START - The start address of installed DRAM
  690. CONFIG_RAM_START=0xa0000000
  691. CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to boards that
  692. have LEDs
  693. CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt
  694. stack. If defined, this symbol is the size of the interrupt
  695. stack in bytes. If not defined, the user task stacks will be
  696. used during interrupt handling.
  697. CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
  698. CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture.
  699. PIC32MX Configuration
  700. CONFIG_PIC32MX_MVEC - Select muli- vs. single-vectored interrupts
  701. Individual subsystems can be enabled:
  702. CONFIG_PIC32MX_WDT - Watchdog timer
  703. CONFIG_PIC32MX_T2 - Timer 2 (Timer 1 is the system time and always enabled)
  704. CONFIG_PIC32MX_T3 - Timer 3
  705. CONFIG_PIC32MX_T4 - Timer 4
  706. CONFIG_PIC32MX_T5 - Timer 5
  707. CONFIG_PIC32MX_IC1 - Input Capture 1
  708. CONFIG_PIC32MX_IC2 - Input Capture 2
  709. CONFIG_PIC32MX_IC3 - Input Capture 3
  710. CONFIG_PIC32MX_IC4 - Input Capture 4
  711. CONFIG_PIC32MX_IC5 - Input Capture 5
  712. CONFIG_PIC32MX_OC1 - Output Compare 1
  713. CONFIG_PIC32MX_OC2 - Output Compare 2
  714. CONFIG_PIC32MX_OC3 - Output Compare 3
  715. CONFIG_PIC32MX_OC4 - Output Compare 4
  716. CONFIG_PIC32MX_OC5 - Output Compare 5
  717. CONFIG_PIC32MX_I2C1 - I2C 1
  718. CONFIG_PIC32MX_I2C2 - I2C 2
  719. CONFIG_PIC32MX_I2C3 - I2C 3
  720. CONFIG_PIC32MX_I2C4 - I2C 4
  721. CONFIG_PIC32MX_I2C5 - I2C 5
  722. CONFIG_PIC32MX_SPI1 - SPI 1
  723. CONFIG_PIC32MX_SPI2 - SPI 2
  724. CONFIG_PIC32MX_SPI3 - SPI 3
  725. CONFIG_PIC32MX_SPI4 - SPI 4
  726. CONFIG_PIC32MX_UART1 - UART 1
  727. CONFIG_PIC32MX_UART2 - UART 2
  728. CONFIG_PIC32MX_UART3 - UART 3
  729. CONFIG_PIC32MX_UART4 - UART 4
  730. CONFIG_PIC32MX_UART5 - UART 5
  731. CONFIG_PIC32MX_UART6 - UART 6
  732. CONFIG_PIC32MX_ADC - ADC 1
  733. CONFIG_PIC32MX_PMP - Parallel Master Port
  734. CONFIG_PIC32MX_CM1 - Comparator 1
  735. CONFIG_PIC32MX_CM2 - Comparator 2
  736. CONFIG_PIC32MX_RTCC - Real-Time Clock and Calendar
  737. CONFIG_PIC32MX_DMA - DMA
  738. CONFIG_PIC32MX_FLASH - FLASH
  739. CONFIG_PIC32MX_USBDEV - USB device
  740. CONFIG_PIC32MX_USBHOST - USB host
  741. CONFIG_PIC32MX_CAN1 - Controller area network 1
  742. CONFIG_PIC32MX_CAN2 - Controller area network 2
  743. CONFIG_PIC32MX_ETHERNET - Ethernet
  744. PIC32MX Configuration Settings
  745. DEVCFG0:
  746. CONFIG_PIC32MX_DEBUGGER - Background Debugger Enable. Default 3 (disabled). The
  747. value 2 enables.
  748. CONFIG_PIC32MX_ICESEL - In-Circuit Emulator/Debugger Communication Channel Select
  749. Default 1 (PG2)
  750. CONFIG_PIC32MX_PROGFLASHWP - Program FLASH write protect. Default 0xff (disabled)
  751. CONFIG_PIC32MX_BOOTFLASHWP - Default 1 (disabled)
  752. CONFIG_PIC32MX_CODEWP - Default 1 (disabled)
  753. DEVCFG1: (All settings determined by selections in board.h)
  754. DEVCFG2: (All settings determined by selections in board.h)
  755. DEVCFG3:
  756. CONFIG_PIC32MX_USBIDO - USB USBID Selection. Default 1 if USB enabled
  757. (USBID pin is controlled by the USB module), but 0 (GPIO) otherwise.
  758. CONFIG_PIC32MX_VBUSIO - USB VBUSON Selection (Default 1 if USB enabled
  759. (VBUSON pin is controlled by the USB module, but 0 (GPIO) otherwise.
  760. CONFIG_PIC32MX_WDENABLE - Enabled watchdog on power up. Default 0 (watchdog
  761. can be enabled later by software).
  762. The priority of interrupts may be specified. The value ranage of
  763. priority is 4-31. The default (16) will be used if these any of these
  764. are undefined.
  765. CONFIG_PIC32MX_CTPRIO - Core Timer Interrupt
  766. CONFIG_PIC32MX_CS0PRIO - Core Software Interrupt 0
  767. CONFIG_PIC32MX_CS1PRIO - Core Software Interrupt 1
  768. CONFIG_PIC32MX_INT0PRIO - External Interrupt 0
  769. CONFIG_PIC32MX_INT1PRIO - External Interrupt 1
  770. CONFIG_PIC32MX_INT2PRIO - External Interrupt 2
  771. CONFIG_PIC32MX_INT3PRIO - External Interrupt 3
  772. CONFIG_PIC32MX_INT4PRIO - External Interrupt 4
  773. CONFIG_PIC32MX_FSCMPRIO - Fail-Safe Clock Monitor
  774. CONFIG_PIC32MX_T1PRIO - Timer 1 (System timer) priority
  775. CONFIG_PIC32MX_T2PRIO - Timer 2 priority
  776. CONFIG_PIC32MX_T3PRIO - Timer 3 priority
  777. CONFIG_PIC32MX_T4PRIO - Timer 4 priority
  778. CONFIG_PIC32MX_T5PRIO - Timer 5 priority
  779. CONFIG_PIC32MX_IC1PRIO - Input Capture 1
  780. CONFIG_PIC32MX_IC2PRIO - Input Capture 2
  781. CONFIG_PIC32MX_IC3PRIO - Input Capture 3
  782. CONFIG_PIC32MX_IC4PRIO - Input Capture 4
  783. CONFIG_PIC32MX_IC5PRIO - Input Capture 5
  784. CONFIG_PIC32MX_OC1PRIO - Output Compare 1
  785. CONFIG_PIC32MX_OC2PRIO - Output Compare 2
  786. CONFIG_PIC32MX_OC3PRIO - Output Compare 3
  787. CONFIG_PIC32MX_OC4PRIO - Output Compare 4
  788. CONFIG_PIC32MX_OC5PRIO - Output Compare 5
  789. CONFIG_PIC32MX_I2C1PRIO - I2C 1
  790. CONFIG_PIC32MX_I2C2PRIO - I2C 2
  791. CONFIG_PIC32MX_I2C3PRIO - I2C 3
  792. CONFIG_PIC32MX_I2C4PRIO - I2C 4
  793. CONFIG_PIC32MX_I2C5PRIO - I2C 5
  794. CONFIG_PIC32MX_SPI2PRIO - SPI 2
  795. CONFIG_PIC32MX_UART1PRIO - UART 1
  796. CONFIG_PIC32MX_UART2PRIO - UART 2
  797. CONFIG_PIC32MX_CN - Input Change Interrupt
  798. CONFIG_PIC32MX_ADCPRIO - ADC1 Convert Done
  799. CONFIG_PIC32MX_PMPPRIO - Parallel Master Port
  800. CONFIG_PIC32MX_CM1PRIO - Comparator 1
  801. CONFIG_PIC32MX_CM2PRIO - Comparator 2
  802. CONFIG_PIC32MX_FSCMPRIO - Fail-Safe Clock Monitor
  803. CONFIG_PIC32MX_RTCCPRIO - Real-Time Clock and Calendar
  804. CONFIG_PIC32MX_DMA0PRIO - DMA Channel 0
  805. CONFIG_PIC32MX_DMA1PRIO - DMA Channel 1
  806. CONFIG_PIC32MX_DMA2PRIO - DMA Channel 2
  807. CONFIG_PIC32MX_DMA3PRIO - DMA Channel 3
  808. CONFIG_PIC32MX_DMA4PRIO - DMA Channel 4
  809. CONFIG_PIC32MX_DMA5PRIO - DMA Channel 5
  810. CONFIG_PIC32MX_DMA6PRIO - DMA Channel 6
  811. CONFIG_PIC32MX_DMA7PRIO - DMA Channel 7
  812. CONFIG_PIC32MX_FCEPRIO - Flash Control Event
  813. CONFIG_PIC32MX_USBPRIO - USB
  814. PIC32MXx specific device driver settings. NOTE: For the Ethernet
  815. starter kit, there is no RS-232 connector (even with the MEB). See
  816. discussion above ("") for information about how you can configure
  817. an external MAX2232 board to get a serial console.
  818. CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the
  819. console and ttys0 (default is the UART0).
  820. CONFIG_UARTn_RXBUFSIZE - Characters are buffered as received.
  821. This specific the size of the receive buffer
  822. CONFIG_UARTn_TXBUFSIZE - Characters are buffered before
  823. being sent. This specific the size of the transmit buffer
  824. CONFIG_UARTn_BAUD - The configure BAUD of the UART. Must be
  825. CONFIG_UARTn_BITS - The number of bits. Must be either 7 or 8.
  826. CONFIG_UARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
  827. CONFIG_UARTn_2STOP - Two stop bits
  828. PIC32MX specific PHY/Ethernet device driver settings
  829. CONFIG_ETH0_PHY_KS8721 - Selects the Micrel KS8721 PHY
  830. CONFIG_ETH0_PHY_DP83848C - Selects the National Semiconductor DP83848C PHY
  831. CONFIG_ETH0_PHY_LAN8720 - Selects the SMSC LAN8720 PHY
  832. CONFIG_PIC32MX_PHY_AUTONEG - Enable auto-negotiation
  833. CONFIG_PIC32MX_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed.
  834. CONFIG_PIC32MX_PHY_FDUPLEX - Select full (vs. half) duplex
  835. CONFIG_PIC32MX_ETH_NTXDESC - Configured number of Tx descriptors. Default: 2
  836. CONFIG_PIC32MX_ETH_NRXDESC - Configured number of Rx descriptors. Default: 4
  837. CONFIG_NET_DUMPPACKET - Dump all received and transmitted packets.
  838. Also needs CONFIG_DEBUG_FEATURES.
  839. CONFIG_NET_REGDEBUG - Enabled low level register debug. Also needs
  840. CONFIG_DEBUG_FEATURES.
  841. CONFIG_PIC32MX_MULTICAST - Enable receipt of multicast (and unicast) frames.
  842. Automatically set if CONFIG_NET_MCASTGROUP is selected.
  843. Related DEVCFG3 Configuration Settings:
  844. CONFIG_PIC32MX_FETHIO: Ethernet I/O Pin Selection bit:
  845. 1 = Default Ethernet I/O Pins
  846. 0 = Alternate Ethernet I/O Pins
  847. CONFIG_PIC32MX_FMIIEN: Ethernet MII Enable bit
  848. 1 = MII enabled
  849. 0 = RMII enabled
  850. PIC32MXx USB Device Configuration
  851. PIC32MXx USB Host Configuration (the PIC32MX does not support USB Host)
  852. Configurations
  853. ==============
  854. Each PIC32MX configuration is maintained in a sub-directory and can be
  855. selected as follow:
  856. tools/configure.sh pic32mx-starterkit:<subdir>
  857. Where <subdir> is one of the following:
  858. nsh:
  859. This is the NuttShell (NSH) using the NSH startup logic at
  860. apps/examples/nsh.
  861. NOTES:
  862. 1. This configuration uses the mconf-based configuration tool. To
  863. change this configurations using that tool, you should:
  864. a. Build and install the kconfig-mconf tool. See nuttx/README.txt
  865. see additional README.txt files in the NuttX tools repository.
  866. b. Execute 'make menuconfig' in nuttx/ in order to start the
  867. reconfiguration process.
  868. 2. Serial Output
  869. The OS test produces all of its test output on the serial console.
  870. This configuration has UART1 enabled as a serial console. I have
  871. been unable to get this UART work on the MEB. But on the Expansion
  872. I/O board, this maps to RX = J11 pin 41 and TX = J11 pin 43
  873. 3. SB Configurations
  874. Several USB device configurations can be enabled and included
  875. as NSH built-in built in functions.
  876. To use USB device, connect the starter kit to the host using a cable
  877. with a Type-B micro-plug to the starter kit’s micro-A/B port J5, located
  878. on the bottom side of the starter kit. The other end of the cable
  879. must have a Type-A plug. Connect it to a USB host. Jumper JP2 should be
  880. removed.
  881. All USB device configurations require the following basic setup in
  882. your NuttX configuration file to enable USB device support:
  883. CONFIG_USBDEV=y : Enable basic USB device support
  884. CONFIG_PIC32MX_USBDEV=y : Enable PIC32 USB device support
  885. system/cdcacm - The system/cdcacm program can be included by
  886. adding the following to the configuration file:
  887. CONFIG_CDCACM=y : Enable the CDCACM device
  888. CONFIG_EXAMPLES_CDCACM=y
  889. 3. Networking Configurations
  890. Several Networking configurations can be enabled and included
  891. as NSH built-in built in functions. The following additional
  892. configuration settings are required:
  893. CONFIG_NET=y : Enable networking support
  894. CONFIG_PIC32MX_ETHERNET=y : Enable the PIC32 Ethernet driver
  895. CONFIG_NSH_TELNET=y : Enable the Telnet NSH console (optional)
  896. NOTES:
  897. a. This logic will assume that a network is connected. During its
  898. initialization, it will try to negotiate the link speed. If you have
  899. no network connected when you reset the board, there will be a long
  900. delay (maybe 30 seconds?) before anything happens. That is the timeout
  901. before the networking finally gives up and decides that no network is
  902. available.
  903. b. This example can support an FTP client. In order to build in FTP client
  904. support simply add the following to the NuttX configuration file:
  905. CONFIG_NETUTILS_FTPC=y
  906. CONFIG_EXAMPLES_FTPC=y
  907. c. This example can support an FTP server. In order to build in FTP server
  908. support simply add the following to the NuttX configuration file:
  909. CONFIG_NETUTILS_FTPD=y
  910. CONFIG_EXAMPLES_FTPD=y
  911. nsh2:
  912. This is an alternative NSH configuration. Without the Expansion I/O board,
  913. there is no way to connect a serial console. This NSH alternative supports
  914. only a Telnet console. The nsh2 differs from the nsh configuration in the
  915. following ways:
  916. NOTES:
  917. 1. Networking is enabled:
  918. CONFIG_NET=y : Enable networking support
  919. CONFIG_PIC32MX_ETHERNET=y : Enable the PIC32 Ethernet driver
  920. CONFIG_NSH_CONSOLE=n : Disable NSH serial console
  921. CONFIG_NSH_TELNET=y : Enable the Telnet NSH console
  922. See apps/nshlib/README.txt for other NSH networking-related configuration
  923. settings.
  924. 2. UART1 is disabled
  925. CONFIG_PIC32MX_UART1=n : UART1 is disabled (as well as other UARTs)
  926. CONFIG_UART1_SERIAL_CONSOLE=n : There is no serial console
  927. 3. The RAM log is enabled"
  928. CONFIG_RAMLOG=y : Enable the RAM-based logging feature.
  929. CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the
  930. system logger.
  931. Logging is currently set up to use 16Kb of memory:
  932. CONFIG_RAMLOG_BUFSIZE=16384
  933. There are a few other configuration differences as necessary to support
  934. this different device configuration. Just the do the 'diff' if you are
  935. curious.
  936. NOTES:
  937. See the notes for the nsh configuration. Most also apply to the nsh2
  938. configuration.
  939. Using a RAM disk and the USB MSC device with nsh and nsh2
  940. ---------------------------------------------------------
  941. Here is an experimental change to either examples/nsh or examples/nsh2
  942. that will create a RAM disk and attempt to export that RAM disk as a
  943. USB mass storage device.
  944. 1. Changes to nuttx/.config
  945. a) Enable support for the PIC32 USB device
  946. -CONFIG_PIC32MX_USBDEV=n
  947. +CONFIG_PIC32MX_USBDEV=y
  948. b) Enable NuttX USB device support
  949. -CONFIG_USBDEV=n
  950. +CONFIG_USBDEV=y
  951. c) Enable the USB MSC class driver
  952. -CONFIG_USBMSC=n
  953. +CONFIG_USBMSC=y
  954. d) Use a RAM disk (instead of an SD card) as the USB MSC logical unit:
  955. -CONFIG_SYSTEM_USBMSC_DEVPATH1="/dev/mmcsd0"
  956. +CONFIG_SYSTEM_USBMSC_DEVPATH1="/dev/ram0"
  957. e) Enable building of the system/usbmsc:
  958. +CONFIG_SYSTEM_USBMSC=y
  959. 3. When NSH first comes up, you must manually create the RAM disk
  960. before exporting it:
  961. a) Create a 64Kb RAM disk at /dev/ram0:
  962. nsh> mkrd -s 512 128
  963. b) Put a FAT file system on the RAM disk:
  964. nsh> mkfatfs /dev/ram0
  965. b) Now the 'msconn' command will connect to the host and
  966. export /dev/ram0 as the USB logical unit:
  967. nsh> msconn
  968. NOTE: This modification should be considered experimental. IN the
  969. little testing I have done with it, it appears functional. But the
  970. logic has not been stressed and there could still be lurking issues.
  971. (There is a bug associated with this configuration listed in the
  972. top-level TODO list).