2019-08-08 16:53:04 +02:00
|
|
|
boards/mips/pic32mx/sure-pic32mx README
|
2011-07-03 18:31:10 +02:00
|
|
|
=====================
|
|
|
|
|
|
|
|
This README file discusses the port of NuttX to the "Advanced USB Storage
|
|
|
|
Demo Board," Model DB-DP11215, from Sure Electronics
|
|
|
|
(http://www.sureelectronics.net/). This board features the MicroChip
|
|
|
|
PIC32MX440F512H. See also http://www.sureelectronics.net/goods.php?id=1168
|
|
|
|
for further information about the Sure DB-DP11215 board.
|
|
|
|
|
2012-01-12 01:24:54 +01:00
|
|
|
DB_DP11215 PIC32 Storage Demo Board
|
|
|
|
|
|
|
|
- PIC32MX44F512H
|
|
|
|
- SD card slot
|
|
|
|
- RS-2323 Interface
|
|
|
|
- USB (MINI-B)
|
|
|
|
- 2x16 LCD display
|
|
|
|
- Three tactile switches
|
|
|
|
- Four user LEDs
|
|
|
|
|
|
|
|
Also available (but not yet supported).
|
|
|
|
|
|
|
|
DB-DP11212 PIC32 General Purpose Demo Board
|
|
|
|
|
|
|
|
- PIC32MX44F512H
|
|
|
|
- LM75A temperature sensor and temperature resistor (NTC-SMD thermistor)
|
|
|
|
- SPI FLASH: AT25DF041A
|
|
|
|
- USB (MINI-B)
|
|
|
|
- 2x16 LCD display
|
|
|
|
- 4 digit, 8 segment LED display
|
|
|
|
- Three tactile switches
|
|
|
|
- Four user LEDs
|
|
|
|
|
2013-05-28 21:36:01 +02:00
|
|
|
NOTE: I see that Sure Electronics shows both of these boards at end-of-Life
|
|
|
|
(EOL). So I assume that these boards will no longer be generally available.
|
|
|
|
This work should still be useful, however, for other PIC32MX4-based boards
|
|
|
|
(2012-5-27).
|
|
|
|
|
2011-07-03 18:31:10 +02:00
|
|
|
Contents
|
|
|
|
========
|
|
|
|
|
|
|
|
PIC32MX440F512H Pin Out
|
|
|
|
Toolchains
|
|
|
|
Loading NuttX with PICkit2
|
2013-05-27 00:44:53 +02:00
|
|
|
LCD1602
|
2011-07-03 18:31:10 +02:00
|
|
|
PIC32MX Configuration Options
|
|
|
|
Configurations
|
|
|
|
|
|
|
|
PIC32MX440F512H Pin Out
|
|
|
|
=======================
|
|
|
|
|
2012-03-12 16:47:47 +01:00
|
|
|
DB_DP11215 PIC32 Storage Demo Board
|
|
|
|
-----------------------------------
|
|
|
|
PIC32MX440F512H 64-Pin QFN (USB) Pin Out as used on the DB_DP11215 PIC32 Storage
|
|
|
|
Demo Board.
|
2011-07-03 18:31:10 +02:00
|
|
|
|
|
|
|
LEFT SIDE, TOP-TO-BOTTOM (if pin 1 is in upper left)
|
|
|
|
PIN NAME SIGNAL NOTES
|
|
|
|
---- ----------------------------- -------------- -------------------------------
|
|
|
|
1 PMD5/RE5 PMPD5 Display, JP1-12, DB4
|
|
|
|
2 PMD6/RE6 PMPD6 Display, JP1-13, DB6
|
|
|
|
3 PMD7/RE7 PMPD7 Display, JP1-14, DB7
|
|
|
|
4 SCK2/PMA5/CN8/RG6 SCK SD connector SCK, FLASH (U1) SCK*
|
|
|
|
5 SDI2/PMA4/CN9/RG7 SDI SD connector DO, FLASH (U1) SO*
|
|
|
|
6 SDO2/PMA3/CN10/RG8 SDO SD connector DI, FLASH (U1) SI*
|
|
|
|
7 MCLR\ PIC_MCLR Pulled high, J7-1, ICSP
|
|
|
|
8 SS2/PMA2/CN11/RG9 UTIL_CS FLASH (U1) CS*
|
|
|
|
9 Vss Grounded
|
|
|
|
10 Vdd +3.3V ---
|
|
|
|
11 AN5/C1IN+/Vbuson/CN7/RB5 Vbuson/AN5/RB5 To USB VBUS circuitry
|
|
|
|
12 AN4/C1IN-/CN6/RB4 SW_OK SW3, Pull high, low means SW3 closed
|
|
|
|
13 AN3/C2IN+/CN5/RB3 SW_UP SW1, Pull high, low means SW1 closed
|
|
|
|
14 AN2/C2IN-/CN4/RB2 SW_Down SW2, Pull high, low means SW2 closed
|
|
|
|
15 PGEC1/AN1/Vref-/CVref-/CN3/ ADC_SENSE_SWITCHED_+VBUS To USB VBUS circuitry
|
|
|
|
RB1
|
|
|
|
16 PGED1/AN0/VREF+/CVREF+/PMA6/ N/C Not connected
|
|
|
|
CN2/RB0
|
2012-03-12 16:47:47 +01:00
|
|
|
|
|
|
|
*FLASH (U1, SOIC) not populated
|
2011-07-03 18:31:10 +02:00
|
|
|
|
|
|
|
BOTTOM SIDE, LEFT-TO-RIGHT (if pin 1 is in upper left)
|
|
|
|
PIN NAME SIGNAL NOTES
|
|
|
|
---- ----------------------------- -------------- -------------------------------
|
|
|
|
17 PGEC2/AN6/OCFA/RB6 PIC_PGC2 J7-5, ICSP
|
|
|
|
18 PGED2/AN7/RB7 PIC_PGD2 J7-4, ICSP
|
|
|
|
19 AVdd +3.3V ---
|
|
|
|
20 AVss Grounded
|
|
|
|
21 AN8/U2CTS/C1OUT/RB8 N/C Not connected
|
|
|
|
22 AN9/C2OUT/PMA7/RB9 N/C Not connected
|
|
|
|
23 TMS/AN10/CVREFOUT/PMA13/RB10 UTIL_WP FLASH (U1) WP*
|
2012-03-07 18:40:23 +01:00
|
|
|
24 TDO/AN11/PMA12/RB11 SD_CS SD connector CS
|
2011-07-03 18:31:10 +02:00
|
|
|
25 Vss Grounded
|
|
|
|
26 Vdd +3.3V ---
|
|
|
|
27 TCK/AN12/PMA11/RB12 SD_CD SD connector CD
|
|
|
|
28 TDI/AN13/PMA10/RB13 SD_WD SD connector WD
|
|
|
|
29 AN14/U2RTS/PMALH/PMA1/RB14 N/C Not connected
|
|
|
|
30 AN15/OCFB/PMALL/PMA0/CN12/ PMPA0 Display, JP1-4, RS
|
|
|
|
RB15
|
|
|
|
31 SDA2/U2RX/PMA9/CN17/RF4 RXD2_MCU J5 DB9 via RS232 driver
|
|
|
|
32 SCL2/U2TX/PMA8/CN18/RF5 TXD2_MCU J5 DB9 via RS232 driver
|
|
|
|
|
2012-03-12 16:47:47 +01:00
|
|
|
*FLASH (U1, SOIC) not populated
|
2011-07-03 18:31:10 +02:00
|
|
|
|
|
|
|
RIGHT SIDE, TOP-TO-BOTTOM (if pin 1 is in upper left)
|
|
|
|
PIN NAME SIGNAL NOTES
|
|
|
|
---- ----------------------------- -------------- -------------------------------
|
|
|
|
48 SOSCO/T1CK/CN0/RC14 SOSCO 32.768KHz XTAL (Y1)
|
|
|
|
47 SOSCI/CN1/RC13 SOSCI 32.768KHz XTAL (Y1)
|
|
|
|
46 OC1/INT0/RD0 PWM1 Used to control backlight level (K)
|
|
|
|
45 IC4/PMCS1/PMA14/INT4/RD11 PMPCS1 Display, JP1-6, E
|
|
|
|
44 SCL1/IC3/PMCS2/PMA15/INT3/ USB_OPT USB PHY
|
|
|
|
RD10
|
|
|
|
43 U1CTS/SDA1/IC2/INT2/RD9 USB_OPTEN USB PHY
|
|
|
|
42 RTCC/IC1/INT1/RD8 N/C Not connected
|
|
|
|
41 Vss Grounded
|
|
|
|
40 OSC2/CLKO/RC15 OSC2 20MHz XTAL (Y2)
|
|
|
|
39 OSC1/CLKI/RC12 OSC1 20MHz XTAL (Y2)
|
|
|
|
38 Vdd +3.3V ---
|
|
|
|
37 D+/RG2 APPS_D+ USB connectors via PHY
|
|
|
|
36 D-/RG3 APPS_D- USB connectors via PHY
|
|
|
|
35 Vusb +3.3V ---
|
|
|
|
34 Vbus VBUS_DEVICE_MODE Display, USB Mini-B, USB Type A, JP1-1, +5V
|
|
|
|
33 USBID/RF3 N/C Not connected
|
|
|
|
|
|
|
|
TOP SIDE, LEFT-TO-RIGHT (if pin 1 is in upper left)
|
|
|
|
PIN NAME SIGNAL NOTES
|
|
|
|
---- ----------------------------- -------------- -------------------------------
|
|
|
|
64 PMPD4/RE4 PMPD4 Display, JP1-11, DB4
|
|
|
|
63 PMPD3/RE3 PMPD3 Display, JP1-10, DB3
|
|
|
|
62 PMPD2/RE2 PMPD2 Display, JP1-9, DB2
|
|
|
|
61 PMPD1/RE1 PMPD1 Display, JP1-8, DB1
|
|
|
|
60 PMPD0/RE0 PMPD0 Display, JP1-7, DB0
|
|
|
|
59 RF1 RF1 Low illuminates LED/R/ERR
|
|
|
|
58 RF0 RF0 Low illuminates LED/Y/flash
|
|
|
|
57 ENVREG ENVREG Pulled high
|
|
|
|
56 Vcap/Vddcore VDDCORE Capactors to ground
|
|
|
|
55 CN16/RD7 RD7 Low illuminates LED/Y/USB
|
|
|
|
54 CN15/RD6 RD6 Low illuminates LED/Y/SD
|
|
|
|
53 PMRD/CN14/RD5 PMPRD Display, JP1-5, R/W
|
|
|
|
52 OC5/IC5/PMWR/CN13/RD4 N/C Not connected
|
|
|
|
51 U1TX/OC4/RD3 CP2102_RXD J6-3, UART1 (also CP2102*)
|
|
|
|
50 U1RX/OC3/RD2 CP2102_TXD J6-2, UART1 (also CP2102*)
|
|
|
|
49 U1RTS/OC2/RD1 PWM2 Used to control backlight level (Vo)
|
|
|
|
|
|
|
|
*USB-to-UART bridge (U1, CP2102) not populated
|
|
|
|
|
2012-03-12 16:47:47 +01:00
|
|
|
DB-DP11212 PIC32 General Purpose Demo Board
|
|
|
|
-------------------------------------------
|
|
|
|
PIC32MX440F512H 64-Pin QFN (USB) Pin Out as used on the DB-DP11212 PIC32 General
|
|
|
|
Purpose Demo Board
|
|
|
|
|
|
|
|
LEFT SIDE, TOP-TO-BOTTOM (if pin 1 is in upper left)
|
|
|
|
PIN NAME SIGNAL NOTES
|
|
|
|
---- ----------------------------- -------------- -------------------------------
|
|
|
|
1 PMD5/RE5 PMPD5 Display, JP1-12, DB5
|
|
|
|
2 PMD6/RE6 PMPD6 Display, JP1-13, DB6
|
|
|
|
3 PMD7/RE7 PMPD7 Display, JP1-14, DB7
|
|
|
|
4 SCK2/PMA5/CN8/RG6 SCK FLASH (U4) SCK*
|
|
|
|
5 SDI2/PMA4/CN9/RG7 SDI FLASH (U4) SO*
|
|
|
|
6 SDO2/PMA3/CN10/RG8 SDO FLASH (U4) SI*
|
|
|
|
7 MCLR\ PIC_MCLR Pulled high, J2-1, ICSP
|
|
|
|
8 SS2/PMA2/CN11/RG9 N/C Not connected
|
|
|
|
9 Vss Grounded
|
|
|
|
10 Vdd +3.3V ---
|
|
|
|
11 Vbuson/AN5/CN7/RB5 RB5 LCD SEG5 (F), U5-10
|
|
|
|
12 AN4/CN6/RB4 RB4 LCD SEG4 (E), U5-1
|
|
|
|
13 AN3/CN5/RB3 RB3 LCD SEG3 (D), U5-2
|
|
|
|
14 AN2/CN4/RB2 RB2 LCD SEG2 (C), U5-4
|
|
|
|
15 PGEC1/AN1/Vref-/CN3/RB1 RB1 LCD SEG1 (B), U5-7
|
|
|
|
16 PGED1/AN0/VREF+/CVREF+/PMA6/ RB0 LCD SEG0 (A), U5-11
|
|
|
|
CN2/RB0
|
|
|
|
|
|
|
|
*FLASH (U4, SOIC) not populated
|
|
|
|
|
|
|
|
BOTTOM SIDE, LEFT-TO-RIGHT (if pin 1 is in upper left)
|
|
|
|
PIN NAME SIGNAL NOTES
|
|
|
|
---- ----------------------------- -------------- -------------------------------
|
|
|
|
17 PGEC2/AN6/OCFA/RB6 PIC_PGC2 J2-5, ICSP
|
|
|
|
18 PGED2/AN7/RB7 PIC_PGD2 J2-4, ICSP
|
|
|
|
19 AVdd +3.3V ---
|
|
|
|
20 AVss Grounded
|
|
|
|
21 AN8/U2CTS/RB8 RB8 LCD SEG6 (G), U5-5
|
|
|
|
22 AN9/PMA7/RB9 RB9 LCD SEG7 (DP), U5-3
|
|
|
|
23 TMS/AN10/PMA13/RB10 UTIL_WP FLASH (U4) WP*
|
|
|
|
24 TDO/AN11/PMA12/RB11 UTIL_CS FLASH (U4) CS*
|
|
|
|
25 Vss Grounded
|
|
|
|
26 Vdd +3.3V ---
|
|
|
|
27 TCK/AN12/PMA11/RB12 N/C Not connected
|
|
|
|
28 TDI/AN13/PMA10/RB13 N/C Not connected
|
|
|
|
29 AN14/U2RTS/PMA1/RB14 temp_AD temp_AD
|
|
|
|
30 AN15/PMA0/CN12/RB15 PMPA0 Display, JP1-4, RS
|
|
|
|
31 SDA2/U2RX/PMA9/CN17/RF4 SDA LM75/SO, U3-1, SDA
|
|
|
|
32 SCL2/U2TX/PMA8/CN18/RF5 SCL LM75/SO, U3-2, SCL
|
|
|
|
|
|
|
|
*FLASH (U4, SOIC) not populated
|
|
|
|
|
|
|
|
RIGHT SIDE, TOP-TO-BOTTOM (if pin 1 is in upper left)
|
|
|
|
PIN NAME SIGNAL NOTES
|
|
|
|
---- ----------------------------- -------------- -------------------------------
|
|
|
|
48 SOSCO/T1CK/CN0/RC14 SOSCO 32.768KHz XTAL (Y1)
|
|
|
|
47 SOSCI/CN1/RC13 SOSCI 32.768KHz XTAL (Y1)
|
|
|
|
46 OC1/INT0/RD0 RD0 LCD DIG1, U5-12
|
|
|
|
45 IC4/PMCS1/PMA14/RD11 PMCS1 Display, JP1-6, E
|
|
|
|
44 SCL1/PMCS2/PMA15 RD10 LCD DIG2, U5-9
|
|
|
|
43 SDA1/RD9 RD9 LCD DIG3, U5-8
|
|
|
|
42 RTCC/RD8 RD8 LCD DIG4, U5-6
|
|
|
|
41 Vss Grounded
|
|
|
|
40 OSC2/CLKO/RC15 OSC2 20MHz XTAL (Y2)
|
|
|
|
39 OSC1/CLKI/RC12 OSC1 20MHz XTAL (Y2)
|
|
|
|
38 Vdd +3.3V ---
|
|
|
|
37 D+ MCU_D+ USB connectors via PHY
|
|
|
|
36 D- MCU_D- USB connectors via PHY
|
|
|
|
35 Vusb +3.3V ---
|
|
|
|
34 Vbus +5V_DUSB Display, USB Mini-B, USB Type A, JP1-1, +5V
|
|
|
|
33 USBID/RF3 N/C Not connected
|
|
|
|
|
|
|
|
TOP SIDE, LEFT-TO-RIGHT (if pin 1 is in upper left)
|
|
|
|
PIN NAME SIGNAL NOTES
|
|
|
|
---- ----------------------------- -------------- -------------------------------
|
|
|
|
64 PMPD4/RD4 PMPD4 Display, JP1-11, DB4
|
|
|
|
63 PMPD3/RD3 PMPD3 Display, JP1-10, DB3
|
|
|
|
62 PMPD2/RD2 PMPD2 Display, JP1-9, DB2
|
|
|
|
61 PMPD1/RD1 PMPD1 Display, JP1-8, DB1
|
|
|
|
60 PMPD0/RE0 PMPD0 Display, JP1-7, DB0
|
|
|
|
59 RF1 Key3 SW3-1
|
|
|
|
58 RF0 Key2 SW2-1
|
|
|
|
57 ENVREG ENVREG Pulled high
|
|
|
|
56 Vcap/Vddcore VDDCORE Capacitors to ground
|
|
|
|
55 CN16/RD7 N/C Not connected
|
|
|
|
54 CN15/RD6 Key5 SW5-1
|
|
|
|
53 PMRD/CN14/RD5 PMPRD ---
|
|
|
|
52 OC5/PMWR/CN13/RD4 PWM2 Used to control backlight level (Vo)
|
|
|
|
51 U1TX/OC4/RD3 N/C Not connected
|
|
|
|
50 U1RX/OC3/RD2 N/C Not connected
|
|
|
|
49 OC2/RD1 PWM1 Used to control backlight level (K)
|
|
|
|
|
2011-07-03 18:31:10 +02:00
|
|
|
Toolchains
|
|
|
|
==========
|
|
|
|
|
2012-06-22 20:35:25 +02:00
|
|
|
MPLAB/C32
|
|
|
|
---------
|
|
|
|
|
|
|
|
I am using the free, "Lite" version of the PIC32MX toolchain available
|
2011-07-03 18:31:10 +02:00
|
|
|
for download from the microchip.com web site. I am using the Windows
|
2012-06-22 20:35:25 +02:00
|
|
|
version. The MicroChip toolchain is the only toolchain currently
|
2011-07-03 18:31:10 +02:00
|
|
|
supported in these configurations, but it should be a simple matter to
|
|
|
|
adapt to other toolchains by modifying the Make.defs file include in
|
|
|
|
each configuration.
|
|
|
|
|
2012-06-22 20:35:25 +02:00
|
|
|
C32 Toolchain Options:
|
|
|
|
|
2015-02-22 19:14:20 +01:00
|
|
|
CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW - MicroChip full toolchain for Windows
|
|
|
|
CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL - MicroChip full toolchain for Linux
|
|
|
|
CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE - MicroChip "Lite" toolchain for Windows
|
|
|
|
CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL_LITE - MicroChip "Lite" toolchain for Linux
|
|
|
|
CONFIG_MIPS32_TOOLCHAIN_PINGUINOL - Pinquino toolchain for Linux
|
|
|
|
CONFIG_MIPS32_TOOLCHAIN_PINGUINOW - Pinquino toolchain for Windows
|
|
|
|
CONFIG_MIPS32_TOOLCHAIN_MICROCHIPOPENL - Microchip open toolchain for Linux
|
|
|
|
CONFIG_MIPS32_TOOLCHAIN_GNU_ELF - General mips-elf toolchain for Linux
|
2012-06-22 20:35:25 +02:00
|
|
|
|
|
|
|
NOTE: The "Lite" versions of the toolchain does not support C++. Also
|
|
|
|
certain optimization levels are not supported by the "Lite" toolchain.
|
|
|
|
|
|
|
|
MicrochipOpen
|
|
|
|
-------------
|
|
|
|
|
|
|
|
An alternative, build-it-yourself toolchain is available here:
|
|
|
|
http://sourceforge.net/projects/microchipopen/ . These tools were
|
2012-06-22 23:28:15 +02:00
|
|
|
last updated circa 2010. NOTE: C++ support still not available
|
|
|
|
in this toolchain.
|
2012-06-22 20:35:25 +02:00
|
|
|
|
|
|
|
Building MicrochipOpen (on Linux)
|
|
|
|
|
|
|
|
1) Get the build script from this location:
|
2012-06-22 20:58:24 +02:00
|
|
|
|
|
|
|
http://microchipopen.svn.sourceforge.net/viewvc/microchipopen/ccompiler4pic32/buildscripts/trunk/
|
|
|
|
|
2012-06-22 20:35:25 +02:00
|
|
|
2) Build the code using the build script, for example:
|
2012-06-22 20:58:24 +02:00
|
|
|
|
|
|
|
./build.sh -b v105_freeze
|
|
|
|
|
|
|
|
This will check out the selected branch and build the tools.
|
|
|
|
|
|
|
|
3) Binaries will then be available in a subdirectory with a name something like
|
|
|
|
pic32-v105-freeze-20120622/install-image/bin (depending on the current data
|
|
|
|
and the branch that you selected.
|
|
|
|
|
|
|
|
Note that the tools will have the prefix, mypic32- so, for example, the
|
|
|
|
compiler will be called mypic32-gcc.
|
2012-06-22 20:35:25 +02:00
|
|
|
|
2012-06-23 18:41:32 +02:00
|
|
|
Penguino mips-elf Toolchain
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
Another option is the mips-elf toolchain used with the Penguino project. This
|
|
|
|
is a relatively current mips-elf GCC and should provide free C++ support as
|
2020-02-23 09:50:23 +01:00
|
|
|
well. This toolchain can be downloaded from the Penguino website:
|
2018-04-16 01:15:48 +02:00
|
|
|
http://wiki.pinguino.cc/index.php/Main_Page#Download .
|
2012-06-23 18:41:32 +02:00
|
|
|
|
2019-08-05 15:13:48 +02:00
|
|
|
See also boards/mirtoo/README.txt. There is an experimental (untested)
|
2012-06-23 18:41:32 +02:00
|
|
|
configuration for the Mirtoo platform in that directory.
|
|
|
|
|
2012-06-22 20:35:25 +02:00
|
|
|
MPLAB/C32 vs MPLABX/X32
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
It appears that Microchip is phasing out the MPLAB/C32 toolchain and replacing
|
|
|
|
it with MPLABX and XC32. At present, the XC32 toolchain is *not* compatible
|
|
|
|
with the NuttX build scripts. Here are some of the issues that I see when trying
|
|
|
|
to build with XC32:
|
|
|
|
|
|
|
|
1) Make.def changes: You have to change the tool prefix:
|
|
|
|
|
|
|
|
CROSSDEV=xc32-
|
|
|
|
|
|
|
|
2) debug.ld/release.ld: The like expect some things that are not present in
|
|
|
|
the current linker scripts (or are expected with different names). Here
|
|
|
|
are some partial fixes:
|
|
|
|
|
|
|
|
Rename: kseg0_progmem to kseg0_program_mem
|
|
|
|
Rename: kseg1_datamem to kseg1_data_mem
|
2011-07-03 18:31:10 +02:00
|
|
|
|
2012-06-22 20:35:25 +02:00
|
|
|
Even then, there are more warnings from the linker and some undefined symbols
|
2018-04-16 01:15:48 +02:00
|
|
|
for non-NuttX code that resides in the unused Microchip libraries. You will
|
|
|
|
have to solve at least this undefined symbol problem if you want to used the
|
|
|
|
XC32 toolchain.
|
2011-07-03 18:31:10 +02:00
|
|
|
|
|
|
|
Windows Native Toolchains
|
2012-06-22 20:35:25 +02:00
|
|
|
-------------------------
|
2013-05-27 19:39:13 +02:00
|
|
|
|
2011-07-03 18:31:10 +02:00
|
|
|
NOTE: There are several limitations to using a Windows based toolchain in a
|
|
|
|
Cygwin environment. The three biggest are:
|
|
|
|
|
|
|
|
1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
|
|
|
|
performed automatically in the Cygwin makefiles using the 'cygpath' utility
|
|
|
|
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
|
|
|
|
|
|
|
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
2020-10-19 06:09:06 +02:00
|
|
|
are used in NuttX (e.g., include/arch). The make system works around these
|
2011-07-03 18:31:10 +02:00
|
|
|
problems for the Windows tools by copying directories instead of linking them.
|
|
|
|
But this can also cause some confusion for you: For example, you may edit
|
2011-10-13 19:49:11 +02:00
|
|
|
a file in a "linked" directory and find that your changes had no effect.
|
2011-07-03 18:31:10 +02:00
|
|
|
That is because you are building the copy of the file in the "fake" symbolic
|
|
|
|
directory. If you use a Windows toolchain, you should get in the habit of
|
|
|
|
making like this:
|
|
|
|
|
|
|
|
make clean_context all
|
|
|
|
|
|
|
|
An alias in your .bashrc file might make that less painful.
|
|
|
|
|
|
|
|
Loading NuttX with PICkit2
|
|
|
|
==========================
|
|
|
|
|
|
|
|
NOTE: You need a PICKit3 if you plan to use the MPLAB debugger! The PICKit2
|
2011-10-12 04:32:57 +02:00
|
|
|
can, however, still be used to load programs. Instructions for the PICKit3
|
2011-07-03 18:31:10 +02:00
|
|
|
are similar.
|
|
|
|
|
|
|
|
Intel Hex Forma Files:
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
When NuttX is built it will produce two files in the top-level NuttX
|
|
|
|
directory:
|
|
|
|
|
|
|
|
1) nuttx - This is an ELF file, and
|
2012-02-27 20:50:35 +01:00
|
|
|
2) nuttx.hex - This is an Intel Hex format file. This is controlled by
|
2011-07-03 18:31:10 +02:00
|
|
|
the setting CONFIG_INTELHEX_BINARY in the .config file.
|
|
|
|
|
2012-02-27 20:50:35 +01:00
|
|
|
The PICkit tool wants an Intel Hex format file to burn into FLASH. However,
|
|
|
|
there is a problem with the generated nutt.hex: The tool expects the nuttx.hex
|
|
|
|
file to contain physical addresses. But the nuttx.hex file generated from the
|
|
|
|
top-level make will have address in the KSEG0 and KSEG1 regions.
|
2011-07-03 18:31:10 +02:00
|
|
|
|
2020-03-06 23:39:44 +01:00
|
|
|
tools/pic32/mkpichex:
|
2012-06-20 21:29:20 +02:00
|
|
|
----------------------
|
2011-07-03 18:31:10 +02:00
|
|
|
|
2020-03-06 23:39:44 +01:00
|
|
|
There is a simple tool in the NuttX tools/pic32 directory that can be
|
2012-06-20 21:29:20 +02:00
|
|
|
used to solve both issues with the nuttx.hex file. But, first, you must
|
|
|
|
build the tool:
|
2011-07-03 18:31:10 +02:00
|
|
|
|
2020-03-06 23:39:44 +01:00
|
|
|
cd tools/pic32
|
|
|
|
make -f Makefile.host
|
2011-07-03 18:31:10 +02:00
|
|
|
|
2020-02-23 09:50:23 +01:00
|
|
|
Now you will have an executable file call mkpichex (or mkpichex.exe on
|
2012-02-27 20:50:35 +01:00
|
|
|
Cygwin). This program will take the nutt.hex file as an input, it will
|
2011-07-03 18:31:10 +02:00
|
|
|
convert all of the KSEG0 and KSEG1 addresses to physical address, and
|
2012-02-27 20:50:35 +01:00
|
|
|
it will write the modified file, replacing the original nuttx.hex.
|
2011-07-03 18:31:10 +02:00
|
|
|
|
|
|
|
To use this file, you need to do the following things:
|
|
|
|
|
2020-03-07 14:45:09 +01:00
|
|
|
export PATH = ??? # Add the NuttX tools/pic32 directory to your
|
|
|
|
# PATH variable
|
|
|
|
make # Build nuttx and nuttx.hex
|
|
|
|
mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path
|
|
|
|
# to the top-level build directory. It is the only
|
|
|
|
# required input to mkpichex.
|
|
|
|
|
|
|
|
This procedure is automatically performed at the end of a build.
|
2011-07-03 18:31:10 +02:00
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
LCD1602
|
|
|
|
=======
|
|
|
|
|
|
|
|
The on-board LCD is a 2x16 segment LCD and appears to be compatible with
|
2018-10-17 19:33:54 +02:00
|
|
|
the LCD1602 and is treated like an LCD1602 LCD here.
|
2013-05-27 00:44:53 +02:00
|
|
|
|
2018-10-17 19:33:54 +02:00
|
|
|
LCD pin mapping
|
2013-05-27 00:44:53 +02:00
|
|
|
|
|
|
|
--------------------- ---------- ----------------------------------
|
|
|
|
PIC32 Sure JP1 Sure Signal Description
|
|
|
|
PIN SIGNAL NAME PIN NAME(s)
|
|
|
|
--------------------- ---------- ----------------------------------
|
|
|
|
34 Vbus 1. +5V +5V VBUS device mode
|
|
|
|
To GND via capacitor
|
|
|
|
2. GND GND
|
|
|
|
49 RD1 3. Vo Transistor circuit driven by PWM2
|
|
|
|
44 PMA0/AN15/RB15 4. RS PMA0, Selects registers
|
|
|
|
53 PMRD/RD5 5. RW PMRD/PMWR, Selects read or write
|
|
|
|
45 PMPCS1/RD11 6. E Starts data read/write
|
|
|
|
60 PMD0/RE0 7. DB0 PMD0
|
|
|
|
61 PMD1/RE1 8. DB1 PMD1
|
|
|
|
62 PMD2/RE2 9. DB2 PMD2
|
|
|
|
63 PMD3/RE3 10. DB3 PMD3
|
|
|
|
64 PMD4/RE4 11. DB4 PMD4
|
|
|
|
1 PMD5/RE5 12. DB5 PMD5
|
|
|
|
2 PMD6/RE6 13. DB6 PMD6
|
|
|
|
3 PMD7/RE7 14. DB7 PMD7
|
|
|
|
15. A +5V_DUSB
|
|
|
|
46 INT0/RD0 16. K Transistor circuit driven by PWM1
|
|
|
|
--------------------- ---------- ----------------------------------
|
|
|
|
|
2013-05-27 19:39:13 +02:00
|
|
|
Vbus power also requires Vbuson/AN5/RB5
|
|
|
|
|
2011-07-03 18:31:10 +02:00
|
|
|
PIC32MX Configuration Options
|
|
|
|
=============================
|
|
|
|
|
|
|
|
General Architecture Settings:
|
|
|
|
|
|
|
|
CONFIG_ARCH - Identifies the arch/ subdirectory. This should
|
|
|
|
be set to:
|
|
|
|
|
|
|
|
CONFIG_ARCH=mips
|
|
|
|
|
|
|
|
CONFIG_ARCH_family - For use in C code:
|
|
|
|
|
|
|
|
CONFIG_ARCH_MIPS=y
|
|
|
|
|
|
|
|
CONFIG_ARCH_architecture - For use in C code:
|
|
|
|
|
|
|
|
CONFIG_ARCH_MIPS32=y
|
|
|
|
|
|
|
|
CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory
|
|
|
|
|
|
|
|
CONFIG_ARCH_CHIP=pic32mx
|
|
|
|
|
|
|
|
CONFIG_ARCH_CHIP_name - For use in C code to identify the exact
|
|
|
|
chip:
|
|
|
|
|
|
|
|
CONFIG_ARCH_CHIP_PIC32MX440F512H=y
|
|
|
|
|
2019-08-05 15:13:48 +02:00
|
|
|
CONFIG_ARCH_BOARD - Identifies the boards/ subdirectory and
|
2011-07-03 18:31:10 +02:00
|
|
|
hence, the board that supports the particular chip or SoC.
|
|
|
|
|
|
|
|
CONFIG_ARCH_BOARD=sure-pic32mx
|
|
|
|
|
2013-05-27 19:39:13 +02:00
|
|
|
CONFIG_ARCH_DBDP11215 Distinguishes the DB_DP11215 PIC32 Storage
|
2012-01-12 01:24:54 +01:00
|
|
|
Demo Board
|
|
|
|
|
|
|
|
CONFIG_ARCH_DBDP11212 Distingustes the DB-DP11212 PIC32 General
|
|
|
|
Purpose Demo Board
|
|
|
|
|
2011-07-03 18:31:10 +02:00
|
|
|
CONFIG_ARCH_BOARD_name - For use in C code
|
|
|
|
|
|
|
|
CONFIG_ARCH_BOARD_SUREPIC32MX=y
|
|
|
|
|
|
|
|
CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation
|
|
|
|
of delay loops
|
|
|
|
|
|
|
|
CONFIG_ENDIAN_BIG - define if big endian (default is little
|
|
|
|
endian)
|
|
|
|
|
2013-07-26 18:09:17 +02:00
|
|
|
CONFIG_RAM_SIZE - Describes the installed DRAM (CPU SRAM in this case):
|
2011-07-03 18:31:10 +02:00
|
|
|
|
2013-07-26 18:09:17 +02:00
|
|
|
CONFIG_RAM_SIZE=(32*1024) (32Kb)
|
2011-07-03 18:31:10 +02:00
|
|
|
|
|
|
|
There is an additional 32Kb of SRAM in AHB SRAM banks 0 and 1.
|
|
|
|
|
2013-07-26 18:09:17 +02:00
|
|
|
CONFIG_RAM_START - The start address of installed DRAM
|
2011-07-03 18:31:10 +02:00
|
|
|
|
2013-07-26 18:09:17 +02:00
|
|
|
CONFIG_RAM_START=0xa0000000
|
2011-07-03 18:31:10 +02:00
|
|
|
|
|
|
|
CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to boards that
|
|
|
|
have LEDs
|
|
|
|
|
|
|
|
CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt
|
|
|
|
stack. If defined, this symbol is the size of the interrupt
|
|
|
|
stack in bytes. If not defined, the user task stacks will be
|
|
|
|
used during interrupt handling.
|
|
|
|
|
|
|
|
CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
|
|
|
|
|
|
|
|
CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture.
|
|
|
|
|
|
|
|
PIC32MX Configuration
|
|
|
|
|
|
|
|
CONFIG_PIC32MX_MVEC - Select muli- vs. single-vectored interrupts
|
|
|
|
|
|
|
|
Individual subsystems can be enabled:
|
|
|
|
|
|
|
|
CONFIG_PIC32MX_WDT - Watchdog timer
|
|
|
|
CONFIG_PIC32MX_T2 - Timer 2 (Timer 1 is the system time and always enabled)
|
|
|
|
CONFIG_PIC32MX_T3 - Timer 3
|
|
|
|
CONFIG_PIC32MX_T4 - Timer 4
|
|
|
|
CONFIG_PIC32MX_T5 - Timer 5
|
|
|
|
CONFIG_PIC32MX_IC1 - Input Capture 1
|
|
|
|
CONFIG_PIC32MX_IC2 - Input Capture 2
|
|
|
|
CONFIG_PIC32MX_IC3 - Input Capture 3
|
|
|
|
CONFIG_PIC32MX_IC4 - Input Capture 4
|
|
|
|
CONFIG_PIC32MX_IC5 - Input Capture 5
|
|
|
|
CONFIG_PIC32MX_OC1 - Output Compare 1
|
|
|
|
CONFIG_PIC32MX_OC2 - Output Compare 2
|
|
|
|
CONFIG_PIC32MX_OC3 - Output Compare 3
|
|
|
|
CONFIG_PIC32MX_OC4 - Output Compare 4
|
|
|
|
CONFIG_PIC32MX_OC5 - Output Compare 5
|
|
|
|
CONFIG_PIC32MX_I2C1 - I2C 1
|
|
|
|
CONFIG_PIC32MX_I2C2 - I2C 2
|
|
|
|
CONFIG_PIC32MX_SPI2 - SPI 2
|
|
|
|
CONFIG_PIC32MX_UART1 - UART 1
|
|
|
|
CONFIG_PIC32MX_UART2 - UART 2
|
|
|
|
CONFIG_PIC32MX_ADC - ADC 1
|
|
|
|
CONFIG_PIC32MX_PMP - Parallel Master Port
|
|
|
|
CONFIG_PIC32MX_CM1 - Comparator 1
|
|
|
|
CONFIG_PIC32MX_CM2 - Comparator 2
|
|
|
|
CONFIG_PIC32MX_RTCC - Real-Time Clock and Calendar
|
|
|
|
CONFIG_PIC32MX_DMA - DMA
|
|
|
|
CONFIG_PIC32MX_FLASH - FLASH
|
|
|
|
CONFIG_PIC32MX_USBDEV - USB device
|
|
|
|
CONFIG_PIC32MX_USBHOST - USB host
|
|
|
|
|
|
|
|
PIC32MX Configuration Settings
|
|
|
|
DEVCFG0:
|
|
|
|
CONFIG_PIC32MX_DEBUGGER - Background Debugger Enable. Default 3 (disabled). The
|
|
|
|
value 2 enables.
|
|
|
|
CONFIG_PIC32MX_ICESEL - In-Circuit Emulator/Debugger Communication Channel Select
|
|
|
|
Default 1 (PG2)
|
|
|
|
CONFIG_PIC32MX_PROGFLASHWP - Program FLASH write protect. Default 0xff (disabled)
|
|
|
|
CONFIG_PIC32MX_BOOTFLASHWP - Default 1 (disabled)
|
|
|
|
CONFIG_PIC32MX_CODEWP - Default 1 (disabled)
|
|
|
|
DEVCFG1: (All settings determined by selections in board.h)
|
|
|
|
DEVCFG2: (All settings determined by selections in board.h)
|
2013-05-27 19:39:13 +02:00
|
|
|
DEVCFG3:
|
2011-07-03 18:31:10 +02:00
|
|
|
CONFIG_PIC32MX_USBIDO - USB USBID Selection. Default 1 if USB enabled
|
|
|
|
(USBID pin is controlled by the USB module), but 0 (GPIO) otherwise.
|
|
|
|
CONFIG_PIC32MX_VBUSIO - USB VBUSON Selection (Default 1 if USB enabled
|
|
|
|
(VBUSON pin is controlled by the USB module, but 0 (GPIO) otherwise.
|
|
|
|
CONFIG_PIC32MX_WDENABLE - Enabled watchdog on power up. Default 0 (watchdog
|
|
|
|
can be enabled later by software).
|
|
|
|
|
|
|
|
The priority of interrupts may be specified. The value ranage of
|
|
|
|
priority is 4-31. The default (16) will be used if these any of these
|
|
|
|
are undefined.
|
|
|
|
|
|
|
|
CONFIG_PIC32MX_CTPRIO - Core Timer Interrupt
|
|
|
|
CONFIG_PIC32MX_CS0PRIO - Core Software Interrupt 0
|
|
|
|
CONFIG_PIC32MX_CS1PRIO - Core Software Interrupt 1
|
|
|
|
CONFIG_PIC32MX_INT0PRIO - External Interrupt 0
|
|
|
|
CONFIG_PIC32MX_INT1PRIO - External Interrupt 1
|
|
|
|
CONFIG_PIC32MX_INT2PRIO - External Interrupt 2
|
|
|
|
CONFIG_PIC32MX_INT3PRIO - External Interrupt 3
|
|
|
|
CONFIG_PIC32MX_INT4PRIO - External Interrupt 4
|
|
|
|
CONFIG_PIC32MX_FSCMPRIO - Fail-Safe Clock Monitor
|
|
|
|
CONFIG_PIC32MX_T1PRIO - Timer 1 (System timer) priority
|
|
|
|
CONFIG_PIC32MX_T2PRIO - Timer 2 priority
|
|
|
|
CONFIG_PIC32MX_T3PRIO - Timer 3 priority
|
|
|
|
CONFIG_PIC32MX_T4PRIO - Timer 4 priority
|
|
|
|
CONFIG_PIC32MX_T5PRIO - Timer 5 priority
|
|
|
|
CONFIG_PIC32MX_IC1PRIO - Input Capture 1
|
|
|
|
CONFIG_PIC32MX_IC2PRIO - Input Capture 2
|
|
|
|
CONFIG_PIC32MX_IC3PRIO - Input Capture 3
|
|
|
|
CONFIG_PIC32MX_IC4PRIO - Input Capture 4
|
|
|
|
CONFIG_PIC32MX_IC5PRIO - Input Capture 5
|
|
|
|
CONFIG_PIC32MX_OC1PRIO - Output Compare 1
|
|
|
|
CONFIG_PIC32MX_OC2PRIO - Output Compare 2
|
|
|
|
CONFIG_PIC32MX_OC3PRIO - Output Compare 3
|
|
|
|
CONFIG_PIC32MX_OC4PRIO - Output Compare 4
|
|
|
|
CONFIG_PIC32MX_OC5PRIO - Output Compare 5
|
|
|
|
CONFIG_PIC32MX_I2C1PRIO - I2C 1
|
|
|
|
CONFIG_PIC32MX_I2C2PRIO - I2C 2
|
|
|
|
CONFIG_PIC32MX_SPI2PRIO - SPI 2
|
|
|
|
CONFIG_PIC32MX_UART1PRIO - UART 1
|
|
|
|
CONFIG_PIC32MX_UART2PRIO - UART 2
|
|
|
|
CONFIG_PIC32MX_CN - Input Change Interrupt
|
|
|
|
CONFIG_PIC32MX_ADCPRIO - ADC1 Convert Done
|
|
|
|
CONFIG_PIC32MX_PMPPRIO - Parallel Master Port
|
|
|
|
CONFIG_PIC32MX_CM1PRIO - Comparator 1
|
|
|
|
CONFIG_PIC32MX_CM2PRIO - Comparator 2
|
|
|
|
CONFIG_PIC32MX_FSCMPRIO - Fail-Safe Clock Monitor
|
|
|
|
CONFIG_PIC32MX_RTCCPRIO - Real-Time Clock and Calendar
|
|
|
|
CONFIG_PIC32MX_DMA0PRIO - DMA Channel 0
|
|
|
|
CONFIG_PIC32MX_DMA1PRIO - DMA Channel 1
|
|
|
|
CONFIG_PIC32MX_DMA2PRIO - DMA Channel 2
|
|
|
|
CONFIG_PIC32MX_DMA3PRIO - DMA Channel 3
|
|
|
|
CONFIG_PIC32MX_FCEPRIO - Flash Control Event
|
|
|
|
CONFIG_PIC32MX_USBPRIO - USB
|
|
|
|
|
|
|
|
PIC32MXx specific device driver settings. NOTE: For the Sure board,
|
|
|
|
UART2 is brought out to the DB9 connector and serves as the serial
|
|
|
|
console.
|
|
|
|
|
|
|
|
CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the
|
|
|
|
console and ttys0 (default is the UART0).
|
|
|
|
CONFIG_UARTn_RXBUFSIZE - Characters are buffered as received.
|
|
|
|
This specific the size of the receive buffer
|
|
|
|
CONFIG_UARTn_TXBUFSIZE - Characters are buffered before
|
|
|
|
being sent. This specific the size of the transmit buffer
|
|
|
|
CONFIG_UARTn_BAUD - The configure BAUD of the UART. Must be
|
|
|
|
CONFIG_UARTn_BITS - The number of bits. Must be either 7 or 8.
|
|
|
|
CONFIG_UARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
|
|
|
|
CONFIG_UARTn_2STOP - Two stop bits
|
|
|
|
|
|
|
|
PIC32MXx USB Device Configuration
|
|
|
|
|
|
|
|
PIC32MXx USB Host Configuration (the PIC32MX does not support USB Host)
|
|
|
|
|
|
|
|
Configurations
|
|
|
|
==============
|
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
Each PIC32MX configuration is maintained in a sub-directory and can be
|
|
|
|
selected as follow:
|
2011-07-03 18:31:10 +02:00
|
|
|
|
2019-08-06 00:53:39 +02:00
|
|
|
tools/configure.sh sure-pic32mx:<subdir>
|
2011-07-03 18:31:10 +02:00
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
Where <subdir> is one of the following sub-directories.
|
|
|
|
|
|
|
|
NOTE: These configurations use the mconf-based configuration tool. To
|
|
|
|
change any of these configurations using that tool, you should:
|
|
|
|
|
|
|
|
a. Build and install the kconfig-mconf tool. See nuttx/README.txt
|
2015-06-28 16:08:57 +02:00
|
|
|
see additional README.txt files in the NuttX tools repository.
|
2013-05-27 00:44:53 +02:00
|
|
|
|
|
|
|
b. Execute 'make menuconfig' in nuttx/ in order to start the
|
|
|
|
reconfiguration process.
|
|
|
|
|
|
|
|
Configuration sub-directories
|
|
|
|
-----------------------------
|
|
|
|
|
2011-07-03 18:31:10 +02:00
|
|
|
Where <subdir> is one of the following:
|
|
|
|
|
2012-01-04 00:25:49 +01:00
|
|
|
nsh:
|
2012-03-07 18:40:23 +01:00
|
|
|
====
|
|
|
|
Description.
|
|
|
|
------------
|
2012-01-04 00:25:49 +01:00
|
|
|
Configures the NuttShell (nsh) located at apps/examples/nsh. The
|
|
|
|
Configuration enables only the serial NSH interface.
|
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
Notes.
|
|
|
|
-----
|
|
|
|
1. By default, this configuration uses an older Microchip C32 toolchain
|
|
|
|
for Windows (the newer ones seem to be incompatible) and builds under
|
|
|
|
Cygwin (or probably MSYS). That can easily be reconfigured, of course.
|
|
|
|
|
|
|
|
Build Setup:
|
|
|
|
CONFIG_HOST_WINDOWS=y : Builds under Windows
|
|
|
|
CONFIG_WINDOWS_CYGWIN=y : Using Cygwin
|
|
|
|
|
|
|
|
System Type:
|
|
|
|
CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE=y : Older C32 toolchain
|
|
|
|
|
2020-02-23 09:50:23 +01:00
|
|
|
2. USB Configurations.
|
2013-05-27 00:44:53 +02:00
|
|
|
|
|
|
|
Several USB device configurations can be enabled and included
|
|
|
|
as NSH built-in built in functions. All require the following
|
|
|
|
basic setup in your .config to enable USB device support:
|
2013-05-27 19:39:13 +02:00
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
Drivers:
|
|
|
|
CONFIG_USBDEV=y : Enable basic USB device support
|
2012-01-04 00:25:49 +01:00
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
System Type -> PIC32MX Peripheral Support:
|
|
|
|
CONFIG_PIC32MX_USBDEV=y : Enable PIC32 USB device support
|
2012-02-29 22:53:28 +01:00
|
|
|
|
2013-09-26 01:23:03 +02:00
|
|
|
system/cdcacm - The system/cdcacm program can be included as an
|
2014-03-06 20:00:50 +01:00
|
|
|
function by dding the following to the NuttX configuration file:
|
2013-05-27 19:39:13 +02:00
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
Application Configuration->Examples:
|
2013-09-26 01:23:03 +02:00
|
|
|
CONFIG_SYSTEM_CDCACM=y : Select apps/system/cdcacm
|
2013-05-27 00:44:53 +02:00
|
|
|
|
|
|
|
and defining the following in your .config file:
|
|
|
|
|
|
|
|
Drivers->USB Device Driver Support
|
|
|
|
CONFIG_CDCACM=y : Enable the CDCACM device
|
|
|
|
|
2014-03-06 20:00:50 +01:00
|
|
|
system/usbmsc - To enable the USB mass storage class (MSC)device,
|
|
|
|
you would need to add the following to the NuttX configuration file.
|
|
|
|
However, this device cannot work until support for the SD card is
|
|
|
|
also incorporated.
|
2013-05-27 00:44:53 +02:00
|
|
|
|
|
|
|
Drivers->USB Device Driver Support
|
|
|
|
CONFIG_USBMSC=y : Enables the USB MSC class
|
|
|
|
|
|
|
|
Application Configuration->Examples:
|
2013-09-26 00:54:39 +02:00
|
|
|
CONFIG_SYSTEM_USBMSC=y : Enhables apps/system/usbmsc
|
2012-02-29 22:53:28 +01:00
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
3. SD Card Support.
|
2012-02-29 22:53:28 +01:00
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
Support for the on-board, SPI-based SD card is available but is
|
|
|
|
not yet functional (at least at the time of this writing). SD
|
|
|
|
card support can be enabled for testing by simply enabling SPI2
|
|
|
|
support in the configuration file:
|
2012-02-29 22:53:28 +01:00
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
System Type -> PIC32MX Peripheral Support:
|
|
|
|
CONFIG_PIC32MX_SPI2=y : Enable SPI2
|
2012-03-06 21:21:57 +01:00
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
Drivers:
|
|
|
|
CONFIG_MMCSD=y : MMC/SD support
|
|
|
|
CONFIG_MMCSD_SPI=y : SPI-based MMC/SD support
|
2012-03-07 18:40:23 +01:00
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
File Systems:
|
|
|
|
CONFIG_FS_FAT=y : FAT file system
|
2016-06-11 22:14:08 +02:00
|
|
|
: Other FAT options
|
2012-03-07 18:40:23 +01:00
|
|
|
|
|
|
|
Debug output for testing the SD card can be enabled using:
|
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
Build Setup:
|
2016-06-11 22:14:08 +02:00
|
|
|
CONFIG_DEBUG_FEATURES=y : Enable debug features
|
|
|
|
CONFIG_DEBUG_INFO=y : Enable verbose debug output
|
2013-05-27 00:44:53 +02:00
|
|
|
CONFIG_DEBUG_FS=y : Enable file system debug
|
|
|
|
CONFIG_DEBUG_SPI=y : Enable SPI debug
|
|
|
|
|
|
|
|
4. To enable LCD1602 support:
|
|
|
|
|
2013-05-27 19:39:13 +02:00
|
|
|
Device Drivers ->LCD Driver Support:
|
2013-05-27 00:44:53 +02:00
|
|
|
CONFIG_LCD=y : Enable LCD menus
|
|
|
|
CONFIG_LCD_LCD1602=y : Select LCD1602
|
2013-05-27 19:39:13 +02:00
|
|
|
CONFIG_LCD_MAXCONTRAST=255 : (Or any large-ish value that you prefer)
|
|
|
|
CONFIG_LCD_MAXPOWER=255 : (Or any large-ish value that you prefer)
|
2013-05-27 00:44:53 +02:00
|
|
|
|
|
|
|
Library Routines:
|
|
|
|
CONFIG_LIB_SLCDCODEC=y : Enable the SLCD CODEC
|
|
|
|
|
2013-05-27 19:39:13 +02:00
|
|
|
NOTE that is is not necessary to select the PMP peripheral; this LCD
|
|
|
|
driver is a bit-bang driver that just happens to use the PMP pins as
|
|
|
|
GPIOS.
|
2013-05-27 00:44:53 +02:00
|
|
|
|
|
|
|
To enable apps/examples/slcd to test the LCD:
|
|
|
|
|
2013-05-27 19:39:13 +02:00
|
|
|
Application Configuration -> NSH Library:
|
2013-05-27 00:44:53 +02:00
|
|
|
CONFIG_NSH_ARCHINIT=y : Needed to initialize the SLCD
|
2013-05-27 19:39:13 +02:00
|
|
|
|
|
|
|
Application Configuration -> Examples:
|
2013-05-27 00:44:53 +02:00
|
|
|
CONFIG_EXAMPLES_SLCD=y : Enable apps/examples/slcd use /dev/lcd1602
|
|
|
|
CONFIG_EXAMPLES_SLCD_DEVNAME="/dev/lcd1602"
|
|
|
|
|
|
|
|
To enable LCD debug output:
|
|
|
|
|
2013-05-27 19:39:13 +02:00
|
|
|
Build Setup -> Debug Options:
|
2016-06-11 22:14:08 +02:00
|
|
|
CONFIG_DEBUG_FEATURES=y : Enable debug features
|
2016-06-11 19:50:18 +02:00
|
|
|
CONFIG_DEBUG_INFO=y : Enable verbose debug output
|
2013-05-27 19:39:13 +02:00
|
|
|
CONFIG_DEBUG_LCD=y : Enable LCD debug output
|
2013-05-27 00:44:53 +02:00
|
|
|
|
|
|
|
NOTES:
|
2013-07-05 19:45:17 +02:00
|
|
|
2013-05-27: The LCD1602 has been verified on the DB-DP11212 using
|
|
|
|
this configuration. It has not been used with the usbnsh configuration
|
|
|
|
or with the DB-11112 board. It looks to me like the connection to the
|
|
|
|
LCD1602 is identical on the DB-11112 and so I would expect that to work.
|
|
|
|
|
|
|
|
At this point in time, testing of the SLCD is very limited because
|
|
|
|
there is not much in apps/examples/slcd. Basically driver with a working
|
|
|
|
test setup and ready to be tested and debugged.
|
2012-03-07 18:40:23 +01:00
|
|
|
|
2012-03-07 01:53:50 +01:00
|
|
|
usbnsh:
|
2012-03-07 18:40:23 +01:00
|
|
|
=======
|
|
|
|
Description.
|
|
|
|
------------
|
2012-03-06 21:21:57 +01:00
|
|
|
This is another NSH example. If differs from the 'nsh' configuration
|
|
|
|
above in that this configurations uses a USB serial device for console
|
|
|
|
I/O. This configuration was created to support the "DB-DP11212 PIC32
|
|
|
|
General Purpose Demo Board" which has no easily accessible serial port.
|
|
|
|
However, as of this writing, the configuration has set for the
|
|
|
|
"DB_DP11215 PIC32 Storage Demo Board" and has only be testing on that
|
|
|
|
board.
|
|
|
|
|
2013-05-27 00:44:53 +02:00
|
|
|
Notes.
|
|
|
|
-----
|
|
|
|
1. By default, this configuration uses an older Microchip C32 toolchain
|
|
|
|
for Windows (the newer ones seem to be incompatible) and builds under
|
|
|
|
Cygwin (or probably MSYS). That can easily be reconfigured, of course.
|
|
|
|
|
|
|
|
Build Setup:
|
|
|
|
CONFIG_HOST_WINDOWS=y : Builds under Windows
|
|
|
|
CONFIG_WINDOWS_CYGWIN=y : Using Cygwin
|
|
|
|
|
|
|
|
System Type:
|
|
|
|
CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE=y : Older C32 toolchain
|
|
|
|
|
|
|
|
2. Comparison to nsh
|
|
|
|
|
|
|
|
Below summarizes the key configuration differences between the 'nsh'
|
|
|
|
and the 'upnsh' configurations:
|
|
|
|
|
|
|
|
CONFIG_USBDEV=y : NuttX USB device support is enabled
|
|
|
|
CONFIG_PIC32MX_USBDEV=y : The PIC32MX USB device driver is built
|
2013-05-27 22:10:34 +02:00
|
|
|
CONFIG_DEV_CONSOLE=n : /dev/console does not exist on power up
|
2013-05-27 00:44:53 +02:00
|
|
|
CONFIG_UART1_SERIAL_CONSOLE=n : There is no serial console
|
|
|
|
CONFIG_UART2_SERIAL_CONSOLE=n :
|
|
|
|
CONFIG_CDCACM=y : The CDC/ACM serial device class is enabled
|
|
|
|
CONFIG_CDCACM_CONSOLE=y : The CDC/ACM serial device is the console
|
|
|
|
|
2013-05-27 22:10:34 +02:00
|
|
|
3. Using the Prolifics PL2303 Emulation
|
2013-05-27 00:44:53 +02:00
|
|
|
|
|
|
|
You could also use the non-standard PL2303 serial device instead of
|
|
|
|
the standard CDC/ACM serial device by changing:
|
|
|
|
|
2013-05-29 18:26:00 +02:00
|
|
|
Drivers->USB Device Driver Support
|
|
|
|
CONFIG_CDCACM=n : Disable the CDC/ACM serial device class
|
|
|
|
CONFIG_CDCACM_CONSOLE=n : The CDC/ACM serial device is NOT the console
|
|
|
|
CONFIG_PL2303=y : The Prolifics PL2303 emulation is enabled
|
|
|
|
CONFIG_PL2303_CONSOLE=y : The PL2303 serial device is the console
|
2013-05-27 00:44:53 +02:00
|
|
|
|
|
|
|
Why would you want to use a non-standard USB serial driver? You might
|
|
|
|
to use the PL2303 driver with a Windows host because it should
|
|
|
|
automatically install the PL2303 driver (you might have to go through
|
|
|
|
some effort to get Windows to recognize the CDC/ACM device).
|
2013-05-27 22:10:34 +02:00
|
|
|
|
|
|
|
4. Since this configuration is current set for the "DB_DP11215 PIC32
|
2013-05-29 18:26:00 +02:00
|
|
|
Storage Demo Board," UART2 is available and is configured to used as
|
2013-05-27 22:10:34 +02:00
|
|
|
the SYSLOG device. That means that all debug output will be directed
|
2013-05-29 18:26:00 +02:00
|
|
|
out UART2. Debug output is not enabled by default, however, so these
|
2019-09-11 16:56:56 +02:00
|
|
|
settings do nothing until you enable debug output.
|
2013-05-27 22:10:34 +02:00
|
|
|
|
|
|
|
Device Drivers -> System Logging Device Options:
|
|
|
|
CONFIG_SYSLOG_CHAR=y
|
|
|
|
CONFIG_SYSLOG_DEVPATH="/dev/ttyS0"
|
|
|
|
|
|
|
|
System Type -> PIC32MX Peripheral Support:
|
|
|
|
CONFIG_PIC32MX_UART2=y : Enable UART2
|
|
|
|
|
|
|
|
Device Drivers -> Serial Driver Support:
|
|
|
|
CONFIG_UART2_2STOP=0 : UART2 configuration
|
|
|
|
CONFIG_UART2_BAUD=115200
|
|
|
|
CONFIG_UART2_BITS=8
|
|
|
|
CONFIG_UART2_PARITY=0
|
|
|
|
CONFIG_UART2_RXBUFSIZE=64
|
|
|
|
CONFIG_UART2_TXBUFSIZE=64
|
|
|
|
|
2013-05-28 21:36:01 +02:00
|
|
|
NOTE: Using the SYSLOG to get debug output has limitations. Among
|
|
|
|
those are that you cannot get debug output from interrupt handlers.
|
|
|
|
So, in particularly, debug output is not a useful way to debug the
|
|
|
|
USB device controller driver. Instead, use the USB monitor with
|
|
|
|
USB debug off and USB trance on (see below).
|
2013-05-27 22:10:34 +02:00
|
|
|
|
2013-05-28 21:36:01 +02:00
|
|
|
5. Enabling USB monitor SYSLOG output. If tracing is enabled, the USB
|
2013-05-27 22:10:34 +02:00
|
|
|
device will save encoded trace output in in-memory buffer; if the
|
|
|
|
USB monitor is enabled, that trace buffer will be periodically
|
2013-05-28 21:36:01 +02:00
|
|
|
emptied and dumped to the system logging device (UART2 in this
|
2013-06-26 18:54:12 +02:00
|
|
|
configuration):
|
2013-05-27 22:10:34 +02:00
|
|
|
|
|
|
|
Device Drivers -> "USB Device Driver Support:
|
|
|
|
CONFIG_USBDEV_TRACE=y : Enable USB trace feature
|
2013-09-03 21:09:50 +02:00
|
|
|
CONFIG_USBDEV_TRACE_NRECORDS=256 : Buffer 256 records in memory
|
2013-05-27 22:10:34 +02:00
|
|
|
|
|
|
|
Application Configuration -> NSH LIbrary:
|
|
|
|
CONFIG_NSH_USBDEV_TRACE=n : No builtin tracing from NSH
|
|
|
|
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
|
|
|
|
|
|
|
Application Configuration -> System NSH Add-Ons:
|
2016-06-30 20:24:33 +02:00
|
|
|
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
|
|
|
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
|
|
|
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
|
|
|
CONFIG_USBMONITOR_INTERVAL=1 : Dump trace data every second
|
|
|
|
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
|
|
|
CONFIG_USBMONITOR_TRACECLASS=y
|
|
|
|
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
|
|
|
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
|
|
|
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
2013-05-28 21:36:01 +02:00
|
|
|
|
2013-05-29 18:26:00 +02:00
|
|
|
NOTE: USB debug output also be enabled in this case. Both will appear
|
|
|
|
on the serial SYSLOG output. However, the debug output will be
|
|
|
|
asynchronous with the trace output and, hence, difficult to interpret.
|
2013-05-28 21:36:01 +02:00
|
|
|
|
|
|
|
6. If you want to try this configuration on the DB-DP11212 PIC32 General
|
|
|
|
Purpose Demo Board", here are the changes that you should make:
|
|
|
|
|
|
|
|
Board Configuration:
|
|
|
|
CONFIG_ARCH_DBDP11215=n : Disable the DB-DP11215
|
|
|
|
CONFIG_ARCH_DBDP11212=y : Enable the DB-DP11212
|
2013-07-03 19:39:54 +02:00
|
|
|
CONFIG_ARCH_LEDS=n : The DB-DP11212 has no LEDs
|
2013-05-28 21:36:01 +02:00
|
|
|
|
|
|
|
System Type -> PIC32MX Peripheral Support:
|
|
|
|
CONFIG_PIC32MX_UART2=n : Disable UART2
|
|
|
|
|
2013-06-26 18:54:12 +02:00
|
|
|
The SYSLOG output on UART2 cannot by used. You have two choices,
|
|
|
|
first, you can simply disable the SYSLOG device. Then 1) debug
|
|
|
|
output will come the USB console, and 2) all debug output prior
|
|
|
|
to connecting the USB console will be lost:
|
|
|
|
|
2020-02-23 09:50:23 +01:00
|
|
|
The second options is to configure a RAM SYSLOG device. This is
|
2013-06-26 18:54:12 +02:00
|
|
|
a circular buffer that accumulated debug output in memory. The
|
|
|
|
contents of the circular buffer can be dumped from the NSH command
|
|
|
|
line using the 'dmesg' command.
|
|
|
|
|
|
|
|
Device Drivers -> System Logging Device Options:
|
|
|
|
CONFIG_RAMLOG=y : Enable the RAM-based logging feature.
|
|
|
|
CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the
|
|
|
|
system logger.
|
|
|
|
|
2013-07-03 19:39:54 +02:00
|
|
|
Logging is currently can be set up to use any amount of memory (here 8KB):
|
2013-06-26 18:54:12 +02:00
|
|
|
|
2014-07-01 20:00:40 +02:00
|
|
|
CONFIG_RAMLOG_BUFSIZE=8192
|
2013-06-26 18:54:12 +02:00
|
|
|
|
2013-07-05 19:45:17 +02:00
|
|
|
STATUS:
|
|
|
|
2013-7-4: This configuration was last verified.
|
|
|
|
|
2013-06-26 18:54:12 +02:00
|
|
|
7. See the notes for the nsh configuration. Most also apply to the usbnsh
|
2013-07-05 19:45:17 +02:00
|
|
|
configuration as well.
|