2011-05-08 23:38:47 +02:00
|
|
|
configs/pic32mx README
|
|
|
|
=====================
|
|
|
|
|
|
|
|
This README file discusses the port of NuttX to the PIC32MX board from
|
|
|
|
PCB Logic Design Co. This board features the MicroChip PIC32MX460F512L.
|
|
|
|
The board is a very simple -- little more than a carrier for the PIC32
|
|
|
|
MCU plus voltage regulation, debug interface, and an OTG connector.
|
|
|
|
|
2011-05-12 00:47:59 +02:00
|
|
|
Contents
|
|
|
|
========
|
|
|
|
|
|
|
|
Toolchains
|
2011-05-17 00:20:26 +02:00
|
|
|
PIC32MX Configuration Options
|
|
|
|
Configurations
|
2011-05-12 00:47:59 +02:00
|
|
|
|
|
|
|
Toolchains
|
|
|
|
==========
|
|
|
|
|
|
|
|
I am using the free, LITE version of the PIC32MX toolchain available
|
|
|
|
for download from the microchip.com web site. I am using the Windows
|
2011-05-17 00:20:26 +02:00
|
|
|
version. The MicroChip toolchain is the only toolchaing currently
|
|
|
|
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.
|
|
|
|
|
|
|
|
Toolchain Options:
|
|
|
|
|
|
|
|
CONFIG_PIC32MX_MICROCHIPW - MicroChip full toolchain for Windows
|
|
|
|
CONFIG_PIC32MX_MICROCHIPL - MicroChip full toolchain for Linux
|
|
|
|
CONFIG_PIC32MX_MICROCHIPW_LITE - MicroChip LITE toolchain for Windows
|
|
|
|
CONFIG_PIC32MX_MICROCHIPL_LITE - MicroChip LITE toolchain for Linux
|
|
|
|
|
|
|
|
Windows Native Toolchains
|
|
|
|
|
|
|
|
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
|
|
|
|
are used in Nuttx (e.g., include/arch). The make system works around these
|
|
|
|
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
|
|
|
|
a file in a "linked" directory and find that your changes had not effect.
|
|
|
|
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.
|
|
|
|
|
|
|
|
3. Dependencies are not made when using Windows versions of the GCC. This is
|
|
|
|
because the dependencies are generated using Windows pathes which do not
|
|
|
|
work with the Cygwin make.
|
|
|
|
|
|
|
|
Support has been added for making dependencies with the windows-native toolchains.
|
|
|
|
That support can be enabled by modifying your Make.defs file as follows:
|
|
|
|
|
|
|
|
- MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
|
|
|
+ MKDEP = $(TOPDIR)/tools/mkdeps.sh --winpaths "$(TOPDIR)"
|
|
|
|
|
|
|
|
If you have problems with the dependency build (for example, if you are not
|
|
|
|
building on C:), then you may need to modify tools/mkdeps.sh
|
|
|
|
|
|
|
|
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_PIC32MX460F512L=y
|
|
|
|
|
|
|
|
CONFIG_ARCH_BOARD - Identifies the configs subdirectory and
|
|
|
|
hence, the board that supports the particular chip or SoC.
|
|
|
|
|
|
|
|
CONFIG_ARCH_BOARD=pcblogic-pic32mx
|
|
|
|
|
|
|
|
CONFIG_ARCH_BOARD_name - For use in C code
|
|
|
|
|
|
|
|
CONFIG_ARCH_BOARD_PCBLOGICPIC32MX=y
|
|
|
|
|
|
|
|
CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation
|
|
|
|
of delay loops
|
|
|
|
|
|
|
|
CONFIG_ENDIAN_BIG - define if big endian (default is little
|
|
|
|
endian)
|
|
|
|
|
|
|
|
CONFIG_DRAM_SIZE - Describes the installed DRAM (CPU SRAM in this case):
|
|
|
|
|
|
|
|
CONFIG_DRAM_SIZE=(32*1024) (32Kb)
|
|
|
|
|
|
|
|
There is an additional 32Kb of SRAM in AHB SRAM banks 0 and 1.
|
|
|
|
|
|
|
|
CONFIG_DRAM_START - The start address of installed DRAM
|
|
|
|
|
|
|
|
CONFIG_DRAM_START=0x10000000
|
|
|
|
|
|
|
|
CONFIG_DRAM_END - Last address+1 of installed RAM
|
|
|
|
|
|
|
|
CONFIG_DRAM_END=(CONFIG_DRAM_START+CONFIG_DRAM_SIZE)
|
|
|
|
|
|
|
|
CONFIG_ARCH_IRQPRIO - The PIC32MXx supports interrupt prioritization
|
|
|
|
|
|
|
|
CONFIG_ARCH_IRQPRIO=y
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
CONFIG_ARCH_CALIBRATION - Enables some build in instrumentation that
|
|
|
|
cause a 100 second delay during boot-up. This 100 second delay
|
|
|
|
serves no purpose other than it allows you to calibratre
|
|
|
|
CONFIG_ARCH_LOOPSPERMSEC. You simply use a stop watch to measure
|
|
|
|
the 100 second delay then adjust CONFIG_ARCH_LOOPSPERMSEC until
|
|
|
|
the delay actually is 100 seconds.
|
|
|
|
|
2011-05-19 20:29:40 +02:00
|
|
|
PIC32MX Configuration
|
|
|
|
|
|
|
|
CONFIG_PIC32MX_MVEC - Select muli- vs. single-vectored interrupts
|
|
|
|
|
2011-05-17 00:20:26 +02:00
|
|
|
Individual subsystems can be enabled:
|
|
|
|
|
2011-05-21 16:41:53 +02:00
|
|
|
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_SPI1 - SPI 1
|
|
|
|
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_USB - USB
|
2011-05-17 00:20:26 +02:00
|
|
|
|
2011-05-19 20:29:40 +02:00
|
|
|
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.
|
|
|
|
|
2011-05-21 16:41:53 +02:00
|
|
|
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_SPI1PRIO - SPI 1
|
|
|
|
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
|
2011-05-19 20:29:40 +02:00
|
|
|
|
2011-05-17 00:20:26 +02:00
|
|
|
PIC32MXx specific device driver settings
|
|
|
|
|
|
|
|
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
|
|
|
|
^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
Each PIC32MX configuration is maintained in a sudirectory and can be
|
|
|
|
selected as follow:
|
|
|
|
|
|
|
|
cd tools
|
|
|
|
./configure.sh pcblogic-pic32mx/<subdir>
|
|
|
|
cd -
|
|
|
|
. ./setenv.sh
|
|
|
|
|
|
|
|
Where <subdir> is one of the following:
|
|
|
|
|
|
|
|
ostest:
|
|
|
|
This configuration directory, performs a simple OS test using
|
|
|
|
apps/examples/ostest.
|