Early debug changes

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3061 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2010-10-30 18:25:10 +00:00
parent 24e8a42312
commit c2ff2adeae
6 changed files with 162 additions and 114 deletions
+1 -1
View File
@@ -143,7 +143,7 @@ int at32uc3_configgpio(uint16_t cfgset)
putreg32(pinmask, base + AVR32_GPIO_PUERC_OFFSET); putreg32(pinmask, base + AVR32_GPIO_PUERC_OFFSET);
putreg32(pinmask, base + AVR32_GPIO_IERC_OFFSET); putreg32(pinmask, base + AVR32_GPIO_IERC_OFFSET);
putreg32(pinmask, base + AVR32_GPIO_IMR0C_OFFSET); putreg32(pinmask, base + AVR32_GPIO_IMR0C_OFFSET);
putreg32(pinmask, base + AVR32_GPIO_IMR0C_OFFSET); putreg32(pinmask, base + AVR32_GPIO_IMR1C_OFFSET);
putreg32(pinmask, base + AVR32_GPIO_GFERC_OFFSET); putreg32(pinmask, base + AVR32_GPIO_GFERC_OFFSET);
/* Is this a GPIO? Or a peripheral */ /* Is this a GPIO? Or a peripheral */
+6 -9
View File
@@ -80,12 +80,11 @@ __start:
* by the IDLE thread when threading is enabled. * by the IDLE thread when threading is enabled.
*/ */
lddpc r0, .Lstackbase lddpc sp, .Lstackbase
ld.w sp, r0[0]
/* Set up the vector base address so interrupts can be enabled. */ /* Set up the vector base address so interrupts can be enabled. */
lda.w r0, .Lvectortab lda.w r0, vectortab
mtsr AVR32_EVBA, r0 mtsr AVR32_EVBA, r0
/* Enable exception processing */ /* Enable exception processing */
@@ -130,18 +129,16 @@ __start:
/* Perform low-level initialization */ /* Perform low-level initialization */
mcall up_lowinit mcall .Lup_lowinit
/* Then jump to OS entry (will not return) */ /* Then jump to OS entry (will not return) */
lddpc pc, .Los_start lda.w pc, os_start
.Lstackbase: .Lstackbase:
.word _ebss+CONFIG_IDLETHREAD_STACKSIZE-4 .word _ebss+CONFIG_IDLETHREAD_STACKSIZE-4
.Lvectortab: .Lup_lowinit:
.word vectortab .word up_lowinit
.Los_start:
.word os_start
.size __start, .-__start .size __start, .-__start
/* This global variable is unsigned long g_heapbase and is /* This global variable is unsigned long g_heapbase and is
+38 -4
View File
@@ -6,7 +6,7 @@ This is the README file for the NuttX port to the Atmel AVR32DEV1 board.
Contents Contents
^^^^^^^^ ^^^^^^^^
* Pin Configuration * GPIO Pin Configuration
* Serial Connection * Serial Connection
* Toolchains * Toolchains
* Development Environment * Development Environment
@@ -22,8 +22,8 @@ Contents
* AVR32DEV1 Configuration Options * AVR32DEV1 Configuration Options
* Configurations * Configurations
Pin Configuration GPIO Pin Configuration
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
The only GPIO pin usage is for LEDs (2) and Buttons (2): The only GPIO pin usage is for LEDs (2) and Buttons (2):
@@ -32,7 +32,38 @@ The only GPIO pin usage is for LEDs (2) and Buttons (2):
PIN 24 PB2 KEY1 PIN 24 PB2 KEY1
PIN 25 PB3 KEY2 PIN 25 PB3 KEY2
See configs/avr32dev/src/avr32dev_internal.h (See configs/avr32dev/src/avr32dev_internal.h). And also for
crystals (4), JTAG (1), and USB (1):
PIN 30 PA11 XIN32
PIN 31 PA12 XOUT32
PIN 35 PA15 EVTO (JTAG)
PIN 39 PA18 X1IN
PIN 40 PA19 X1OUT
PIN 61 PA26 ID (USB)
All GPIO pins are brought out through connectors J1 (PINS 33-64)
and J2 (PINS 1-32).
NOTE: There seems to be some difference in labeling for OSC0 and
OSC1 between MCUZone.com and Atmel:
Oscillator pinout
-------------------------- --------------------
QFP48 QFP64 Pad Oscillator AVR32DEV1
PIN PIN PIN LABEL
----- ----- ---- --------- --------------------
30 39 PA18 XIN0 X1IN (12MHz)
41 PA28 XIN1 PA28 (no crystal)
22 30 PA11 XIN32 XIN32 (32KHz)
31 40 PA19 XOUT0 X1OUT (12Mhz)
42 PA29 XOUT1 PA29 (no crystal)
23 31 PA12 XOUT32 XOUT32 (32 Khz)
----- ----- ---- --------- --------------------
NOTE: These crystal inputs/outputs are analog signals and my
assumption is that they need no pin multiplexing setting to
enable them for the external crystal function.
Serial Connection Serial Connection
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
@@ -67,6 +98,9 @@ PA17 and PA23 are avaiable from the AVR32DEV1:
PA11-PA12, PA18-PA19, PA28-PA31............................-0.3 to 3.6V PA11-PA12, PA18-PA19, PA28-PA31............................-0.3 to 3.6V
Other Pins ............................................... -0.3 to 5.5V Other Pins ............................................... -0.3 to 5.5V
I get the 5V from another USB port (using the 5V power cable that normally
provides the extra current needed by my USB IDE drive).
Development Environment Development Environment
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
+1
View File
@@ -77,6 +77,7 @@ CONFIG_ARCH_AVR=y
CONFIG_ARCH_AVR32=y CONFIG_ARCH_AVR32=y
CONFIG_ARCH_CHIP=at32uc3 CONFIG_ARCH_CHIP=at32uc3
CONFIG_ARCH_CHIP_AT32UC3B0256=y CONFIG_ARCH_CHIP_AT32UC3B0256=y
CONFIG_ENDIAN_BIG=y
CONFIG_ARCH_BOARD=avr32dev1 CONFIG_ARCH_BOARD=avr32dev1
CONFIG_ARCH_BOARD_AVR32DEV1=y CONFIG_ARCH_BOARD_AVR32DEV1=y
CONFIG_BOARD_LOOPSPERMSEC=7982 CONFIG_BOARD_LOOPSPERMSEC=7982
+3 -2
View File
@@ -49,8 +49,9 @@ if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi
WD=`pwd` WD=`pwd`
export AVRTOOLS_BIN="/cygdrive/c/Program Files/Atmel/AVR Tools/AVR32 Toolchain/bin/" export AVR32_BIN="/cygdrive/c/Program Files/Atmel/AVR Tools/AVR32 Toolchain/bin/"
export FLIP_BIN="/cygdrive/c/Program Files/Atmel/Flip 3.4.2/bin" export FLIP_BIN="/cygdrive/c/Program Files/Atmel/Flip 3.4.2/bin"
export PATH="${FLIP_BIN}:/sbin:/usr/sbin:${PATH_ORIG}:${AVRTOOLS_BIN}" export AVR32DEV1_BIN="${WD}/configs/avr32dev1/tools"
export PATH="${FLIP_BIN}:${AVR32DEV1_BIN}:/sbin:/usr/sbin:${PATH_ORIG}:${AVR32_BIN}"
echo "PATH : ${PATH}" echo "PATH : ${PATH}"
+20 -5
View File
@@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
#set -x
# This script must be executed in the NuttX top-level directory # This script must be executed in the NuttX top-level directory. We'll check..
# the .config file should be located there.
TOPDIR=`pwd` TOPDIR=`pwd`
if [ ! -f .config ]; then if [ ! -f .config ]; then
@@ -9,14 +11,27 @@ if [ ! -f .config ]; then
echo " Has NuttX been configured?" echo " Has NuttX been configured?"
exit 1 exit 1
fi fi
if [! -f nuttx ]; then
echo "The NuttX ELF file (nuttx) does not exist in this directory." # The NuttX build system creates a nuttx ELF file, but the batchisp tools
# expects the file to have a .elf extension
if [ ! -f nuttx.elf ]; then
if [ ! -f nuttx ]; then
echo "The NuttX ELF file (nuttx or nuttx.elf) does not exist in this directory."
echo " Has the NuttX binary been built?" echo " Has the NuttX binary been built?"
exit 1 exit 1
fi
echo "Re-naming nuttx to nuttx.elf"
mv nuttx nuttx.elf || { echo "mv failed"; exit 1; }
else
if [ -f nuttx ]; then
echo "Replacing the old nuttx.elf with the new nuttx file."
mv nuttx nuttx.elf || { echo "mv failed"; exit 1; }
fi
fi fi
DEVICE=at32uc3b0256 DEVICE=at32uc3b0256
HARDWARE=usb HARDWARE=usb
OPERATION="erase f memory flash blankcheck loadbuffer nuttx program verify start reset 0" OPERATION="erase f memory flash blankcheck loadbuffer nuttx.elf program verify start reset 0"
batchisp -device $DEVICE -hardware $HARDWAR -operation $OPERATION batchisp -device $DEVICE -hardware $HARDWARE -operation $OPERATION