summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-07-31 11:44:30 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-07-31 11:44:30 -0600
commit33391365de65dce9254f6b7944ad98f4142eb9c3 (patch)
tree030001d2a1dc2f4f9ef2e26028c5306c92c3c3c0
parent70ba6a34a5e524b918403074f6332cf8e1e13940 (diff)
downloadnuttx-33391365de65dce9254f6b7944ad98f4142eb9c3.tar.gz
nuttx-33391365de65dce9254f6b7944ad98f4142eb9c3.tar.bz2
nuttx-33391365de65dce9254f6b7944ad98f4142eb9c3.zip
SAMA5: Delay loop calibrated; Correct sense of the RED LED
-rw-r--r--nuttx/configs/sama5d3x-ek/README.txt43
-rw-r--r--nuttx/configs/sama5d3x-ek/hello/defconfig2
-rw-r--r--nuttx/configs/sama5d3x-ek/include/board.h2
-rw-r--r--nuttx/configs/sama5d3x-ek/norboot/defconfig2
-rw-r--r--nuttx/configs/sama5d3x-ek/nsh/defconfig2
-rw-r--r--nuttx/configs/sama5d3x-ek/ostest/defconfig2
-rw-r--r--nuttx/configs/sama5d3x-ek/src/sam_autoleds.c13
-rw-r--r--nuttx/configs/sama5d3x-ek/src/sam_userleds.c11
-rw-r--r--nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h4
9 files changed, 59 insertions, 22 deletions
diff --git a/nuttx/configs/sama5d3x-ek/README.txt b/nuttx/configs/sama5d3x-ek/README.txt
index 901c05259..b408f3549 100644
--- a/nuttx/configs/sama5d3x-ek/README.txt
+++ b/nuttx/configs/sama5d3x-ek/README.txt
@@ -449,7 +449,7 @@ Buttons and LEDs
PE24. The red LED is also pulled high but is driven by a transistor so
that it is illuminated when power is applied even if PE24 is not
configured as an output. If PE24 is configured as an output, then the
- LCD is illuminated by a low output.
+ LCD is illuminated by a high output.
These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
defined. In that case, the usage by the board port is defined in
@@ -772,8 +772,14 @@ Configurations
CONFIG_BOOT_RUNFROMISRAM=y : Run from internal SRAM
STATUS:
+ 2013-7-19: This configuration (as do the others) run at 396MHz.
+ The SAMA5D3 can run at 536MHz. I still need to figure out the
+ PLL settings to get that speed.
+
2013-7-28: This configuration was verified functional.
+ 2013-7-31: Delay loop calibrated.
+
norboot:
This is a little program to help debug of code in NOR flash. It
does the following:
@@ -788,6 +794,13 @@ Configurations
1. This program derives from the hello configuration. All of the
notes there apply to this configuration as well.
+ STATUS:
+ 2013-7-19: This configuration (as do the others) run at 396MHz.
+ The SAMA5D3 can run at 536MHz. I still need to figure out the
+ PLL settings to get that speed.
+
+ 2013-7-31: Delay loop calibrated.
+
nsh:
This configuration directory provide the NuttShell (NSH).
@@ -833,13 +846,22 @@ Configurations
However, no built-in applications are selected in the base configuration.
STATUS:
+ 2013-7-19: This configuration (as do the others) run at 396MHz.
+ The SAMA5D3 can run at 536MHz. I still need to figure out the
+ PLL settings to get that speed.
+
2013-7-31: I have been unable to execute this configuration from NOR
FLASH by closing the BMS jumper (J9). As far as I can tell, this
jumper does nothing on my board??? I have been using the norboot
configuration to start the program in NOR FLASH (see just above).
See "Creating and Using NORBOOT" above.
+
2013-7-31: This NSH configuration appears to be fully functional.
+ 2013-7-31: Using delay loop calibration from the hello configuration.
+ That configuration runs out of internal SRAM and, as a result, this
+ configuration needs to be recalibrated.
+
ostest:
This configuration directory, performs a simple OS test using
examples/ostest.
@@ -883,15 +905,22 @@ Configurations
BMS jumper.
STATUS:
+ 2013-7-19: This configuration (as do the others) run at 396MHz.
+ The SAMA5D3 can run at 536MHz. I still need to figure out the
+ PLL settings to get that speed.
+
2013-7-30: I have been unable to execute this configuration from NOR
FLASH by closing the BMS jumper (J9). As far as I can tell, this
jumper does nothing on my board??? I have been using the norboot
configuration to start the program in NOR FLASH (see just above).
See "Creating and Using NORBOOT" above.
- 2013-7-31:
- The OS test configuration is basically functional, but takes a very
- long time in the round-robin scheduler test computing prime numbers.
- This test is suppose to be slow -- like several seconds -- but not
- many minutes. No idea why yet. The best guess would be an excessive
- number of context switches.
+ 2013-7-31: The OS test configuration is basically functional, but
+ takes a very long time in the round-robin scheduler test computing
+ prime numbers. This test is supposed to be slow -- like several
+ seconds -- but not many minutes. No idea why yet. The best guess
+ would be an excessive number of context switches.
+
+ 2013-7-31: Using delay loop calibration from the hello configuration.
+ That configuration runs out of internal SRAM and, as a result, this
+ configuration needs to be recalibrated.
diff --git a/nuttx/configs/sama5d3x-ek/hello/defconfig b/nuttx/configs/sama5d3x-ek/hello/defconfig
index 274565187..b047352fa 100644
--- a/nuttx/configs/sama5d3x-ek/hello/defconfig
+++ b/nuttx/configs/sama5d3x-ek/hello/defconfig
@@ -197,7 +197,7 @@ CONFIG_ARCH_STACKDUMP=y
#
# Board Settings
#
-CONFIG_BOARD_LOOPSPERMSEC=16717
+CONFIG_BOARD_LOOPSPERMSEC=49341
# CONFIG_ARCH_CALIBRATION is not set
CONFIG_RAM_START=0x00300000
CONFIG_RAM_VSTART=0x00300000
diff --git a/nuttx/configs/sama5d3x-ek/include/board.h b/nuttx/configs/sama5d3x-ek/include/board.h
index 0c6900d9e..fd6470e34 100644
--- a/nuttx/configs/sama5d3x-ek/include/board.h
+++ b/nuttx/configs/sama5d3x-ek/include/board.h
@@ -156,7 +156,7 @@
* PE24. The red LED is also pulled high but is driven by a transistor so
* that it is illuminated when power is applied even if PE24 is not
* configured as an output. If PE24 is configured as an output, then the
- * LCD is illuminated by a low output.
+ * LCD is illuminated by a high output.
*/
/* LED index values for use with sam_setled() */
diff --git a/nuttx/configs/sama5d3x-ek/norboot/defconfig b/nuttx/configs/sama5d3x-ek/norboot/defconfig
index c61264255..92cb7bbc0 100644
--- a/nuttx/configs/sama5d3x-ek/norboot/defconfig
+++ b/nuttx/configs/sama5d3x-ek/norboot/defconfig
@@ -207,7 +207,7 @@ CONFIG_ARCH_STACKDUMP=y
#
# Board Settings
#
-CONFIG_BOARD_LOOPSPERMSEC=16717
+CONFIG_BOARD_LOOPSPERMSEC=49341
# CONFIG_ARCH_CALIBRATION is not set
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
CONFIG_ARCH_INTERRUPTSTACK=0
diff --git a/nuttx/configs/sama5d3x-ek/nsh/defconfig b/nuttx/configs/sama5d3x-ek/nsh/defconfig
index 0c8d50b87..adeca9925 100644
--- a/nuttx/configs/sama5d3x-ek/nsh/defconfig
+++ b/nuttx/configs/sama5d3x-ek/nsh/defconfig
@@ -208,7 +208,7 @@ CONFIG_ARCH_STACKDUMP=y
#
# Board Settings
#
-CONFIG_BOARD_LOOPSPERMSEC=16717
+CONFIG_BOARD_LOOPSPERMSEC=49341
# CONFIG_ARCH_CALIBRATION is not set
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
CONFIG_ARCH_INTERRUPTSTACK=0
diff --git a/nuttx/configs/sama5d3x-ek/ostest/defconfig b/nuttx/configs/sama5d3x-ek/ostest/defconfig
index 5d1010ad1..8262ee7dd 100644
--- a/nuttx/configs/sama5d3x-ek/ostest/defconfig
+++ b/nuttx/configs/sama5d3x-ek/ostest/defconfig
@@ -208,7 +208,7 @@ CONFIG_ARCH_STACKDUMP=y
#
# Board Settings
#
-CONFIG_BOARD_LOOPSPERMSEC=16717
+CONFIG_BOARD_LOOPSPERMSEC=49341
# CONFIG_ARCH_CALIBRATION is not set
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
CONFIG_ARCH_INTERRUPTSTACK=0
diff --git a/nuttx/configs/sama5d3x-ek/src/sam_autoleds.c b/nuttx/configs/sama5d3x-ek/src/sam_autoleds.c
index 1fdc6f6ae..da56cde6e 100644
--- a/nuttx/configs/sama5d3x-ek/src/sam_autoleds.c
+++ b/nuttx/configs/sama5d3x-ek/src/sam_autoleds.c
@@ -131,8 +131,8 @@ void up_ledinit(void)
void up_ledon(int led)
{
- bool blueoff = true;
- bool redoff = true;
+ bool blueoff = true; /* Low illuminates */
+ bool redon = false; /* High illuminates */
switch (led)
{
@@ -148,13 +148,12 @@ void up_ledon(int led)
return;
case 3: /* LED_PANIC */
- redoff = false;
+ redon = true;
break;
}
sam_gpiowrite(GPIO_BLUE, blueoff);
- sam_gpiowrite(GPIO_RED, redoff);
-
+ sam_gpiowrite(GPIO_RED, redon);
}
/****************************************************************************
@@ -165,8 +164,8 @@ void up_ledoff(int led)
{
if (led != 2)
{
- sam_gpiowrite(GPIO_BLUE, true);
- sam_gpiowrite(GPIO_RED, true);
+ sam_gpiowrite(GPIO_BLUE, true); /* Low illuminates */
+ sam_gpiowrite(GPIO_RED, false); /* High illuminates */
}
}
diff --git a/nuttx/configs/sama5d3x-ek/src/sam_userleds.c b/nuttx/configs/sama5d3x-ek/src/sam_userleds.c
index 725f64abe..21d5b04b4 100644
--- a/nuttx/configs/sama5d3x-ek/src/sam_userleds.c
+++ b/nuttx/configs/sama5d3x-ek/src/sam_userleds.c
@@ -122,10 +122,15 @@ void sam_setled(int led, bool ledon)
if (led == BOARD_BLUE)
{
+ /* Low illuminates */
+
ledcfg = GPIO_BLUE;
+ ledon = !ledon;
}
else if (led == BOARD_RED)
{
+ /* High illuminates */
+
ledcfg = GPIO_RED;
}
else
@@ -144,9 +149,13 @@ void sam_setleds(uint8_t ledset)
{
bool ledon;
- ledon = ((ledset & BOARD_BLUE_BIT) != 0);
+ /* Low illuminates */
+
+ ledon = ((ledset & BOARD_BLUE_BIT) == 0);
sam_gpiowrite(GPIO_BLUE, ledon);
+ /* High illuminates */
+
ledon = ((ledset & BOARD_RED_BIT) != 0);
sam_gpiowrite(GPIO_RED, ledon);
}
diff --git a/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h b/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h
index adcfa0a27..7c9c45f06 100644
--- a/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h
+++ b/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h
@@ -65,12 +65,12 @@
* PE24. The red LED is also pulled high but is driven by a transistor so
* that it is illuminated when power is applied even if PE24 is not
* configured as an output. If PE24 is configured as an output, then the
- * LCD is illuminated by a low output.
+ * LCD is illuminated by a high output.
*/
#define GPIO_BLUE (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \
GPIO_PORT_PIOE | GPIO_PIN25)
-#define GPIO_RED (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \
+#define GPIO_RED (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_CLEAR | \
GPIO_PORT_PIOE | GPIO_PIN24)
/* Buttons **************************************************************************/