diff --git a/arch/arm/include/kinetis/kinetis_k28irq.h b/arch/arm/include/kinetis/kinetis_k28irq.h index d7e0862f4f..f8dd2c0d40 100644 --- a/arch/arm/include/kinetis/kinetis_k28irq.h +++ b/arch/arm/include/kinetis/kinetis_k28irq.h @@ -140,7 +140,7 @@ #define KINETIS_IRQ_SWI (KINETIS_IRQ_FIRST+64) /* 64: Software interrupt */ #define KINETIS_IRQ_SPI2 (KINETIS_IRQ_FIRST+65) /* 65: SPI2 all sources */ #define KINETIS_IRQ_SPI3 (KINETIS_IRQ_FIRST+66) /* 66: SPI3 all sources */ -#define KINETIS_IRQ_RESVD67 (KINETIS_IRQ_FIRST+67) /* 66: Reserved */ +#define KINETIS_IRQ_RESVD67 (KINETIS_IRQ_FIRST+67) /* 67: Reserved */ #define KINETIS_IRQ_I2S1TX (KINETIS_IRQ_FIRST+68) /* 68: I2S1 Transmit */ #define KINETIS_IRQ_I2S1RX (KINETIS_IRQ_FIRST+69) /* 69: I2S1 Receive */ diff --git a/arch/arm/src/kinetis/chip/kinetis_k28vectors.h b/arch/arm/src/kinetis/chip/kinetis_k28vectors.h index 7464732771..7454d87326 100644 --- a/arch/arm/src/kinetis/chip/kinetis_k28vectors.h +++ b/arch/arm/src/kinetis/chip/kinetis_k28vectors.h @@ -76,7 +76,6 @@ VECTOR(kinetis_dmach14, KINETIS_IRQ_DMACH14) /* 14: DMA channel 14, 30 transfer VECTOR(kinetis_dmach15, KINETIS_IRQ_DMACH15) /* 15: DMA channel 15, 31 transfer complete */ VECTOR(kinetis_dmaerr, KINETIS_IRQ_DMAERR) /* 16: DMA error interrupt channels 0-31 */ VECTOR(kinetis_mcm, KINETIS_IRQ_MCM) /* 17: MCM or RDC interrupt */ -VECTOR(kinetis_rdc, KINETIS_IRQ_RDC) /* 17: MCM or RDC interrupt */ VECTOR(kinetis_flashcc, KINETIS_IRQ_FLASHCC) /* 18: Flash memory command complete */ VECTOR(kinetis_flashrc, KINETIS_IRQ_FLASHRC) /* 19: Flash memory read collision */ @@ -157,7 +156,7 @@ UNUSED(KINETIS_IRQ_RESVD87) VECTOR(kinetis_tpm1, KINETIS_IRQ_TPM1) /* 88: TPM1 */ VECTOR(kinetis_tpm2, KINETIS_IRQ_TPM2) /* 89: TPM2 */ -VECTOR(kinetis_usbhsdcd, KINETIS_IRQ_USBHSDCD) /* 90: USBHS DCD or USBHS Phy modules */ +VECTOR(kinetis_usbhsdcd, KINETIS_IRQ_USBHSDCD) /* 90: USBHS DCD or USBHS Phy modules */ VECTOR(kinetis_i2c3, KINETIS_IRQ_I2C3) /* 91: I2C3 */ UNUSED(KINETIS_IRQ_RESVD92) VECTOR(kinetis_usb1otg, KINETIS_IRQ_USB1OTG) /* 93: USB1 OTG*/ diff --git a/arch/arm/src/kinetis/kinetis.h b/arch/arm/src/kinetis/kinetis.h index a38f8c2e08..1cde44c4df 100644 --- a/arch/arm/src/kinetis/kinetis.h +++ b/arch/arm/src/kinetis/kinetis.h @@ -225,7 +225,7 @@ */ #define GPIO_OUTPUT_ONE (1 << 24) /* Bit 24: 1:Initial output value=1 */ -#define GPIO_OUTPUT_ZER0 (0) /* Bit 24: 0:Initial output value=0 */ +#define GPIO_OUTPUT_ZERO (0) /* Bit 24: 0:Initial output value=0 */ /* Five bits are used to incode DMA/interrupt options: * diff --git a/configs/freedom-k28f/README.txt b/configs/freedom-k28f/README.txt index 75546f5744..9e2b5d7ead 100644 --- a/configs/freedom-k28f/README.txt +++ b/configs/freedom-k28f/README.txt @@ -33,10 +33,45 @@ README Contents ======== + o STATUS o Serial Console o LEDs and Buttons o Configurations +STATUS +====== + + 2018-05-05: The basic NSH port appears to be fully functional. I do see + one anomaly: There is a significant, long start up delay. This delay + seems to be variable from immediate to several seconds. I have not + studied the cause, but there are the symptoms: + + This debug on, I see this output after a reset: + + __start: Reset status: 00:00 + + NuttShell (NSH) NuttX-7.24 + nsh> help + help usage: help [-v] [] + + [ cmp false mkdir rm true + ? dirname free mh rmdir uname + basename dd help mount set umount + break df hexdump mv sh unset + cat echo kill mw sleep usleep + cd exec ls ps test xd + cp exit mb pwd time + + Builtin Apps: + nsh> + + The delay occurs between the reset and the __start debug output. __start + is the reset handler so this is very early in the logic. On a reset, it + vectors to __start. That particular debug message is output after most + low-level initialization has occurred. So the delay is something within + the initialization sequence at the beginning of __start. My suspicion is + the delays associated with the clock configuration. + Serial Console ============== diff --git a/configs/freedom-k28f/nsh/defconfig b/configs/freedom-k28f/nsh/defconfig index ba3ec6c7ad..d7535a6bc2 100644 --- a/configs/freedom-k28f/nsh/defconfig +++ b/configs/freedom-k28f/nsh/defconfig @@ -2,20 +2,17 @@ # CONFIG_NSH_ARGCAT is not set # CONFIG_NSH_CMDOPT_HEXDUMP is not set # CONFIG_NSH_CMDPARMS is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -# CONFIG_NSH_DISABLE_PS is not set CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="freedom-k28f" CONFIG_ARCH_BOARD_FREEDOM_K28F=y CONFIG_ARCH_CHIP_KINETIS=y CONFIG_ARCH_CHIP_MK28FN2M0VMI15=y CONFIG_ARCH_STACKDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=6024 +CONFIG_BOARD_LOOPSPERMSEC=10401 CONFIG_BUILTIN=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y CONFIG_DISABLE_POLL=y CONFIG_EXAMPLES_NSH=y +CONFIG_FS_PROCFS=y CONFIG_HOST_WINDOWS=y CONFIG_INTELHEX_BINARY=y CONFIG_KINETIS_LPUART0=y @@ -26,15 +23,17 @@ CONFIG_MAX_TASKS=16 CONFIG_MAX_WDOGPARMS=2 CONFIG_NFILE_DESCRIPTORS=8 CONFIG_NFILE_STREAMS=8 +CONFIG_NSH_ARCHINIT=y CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_DISABLE_IFUPDOWN=y CONFIG_NSH_FILEIOSIZE=512 CONFIG_NSH_LINELEN=64 CONFIG_NSH_READLINE=y CONFIG_PREALLOC_MQ_MSGS=4 CONFIG_PREALLOC_TIMERS=4 CONFIG_PREALLOC_WDOGS=16 -CONFIG_RAM_SIZE=65536 -CONFIG_RAM_START=0x1fff8000 +CONFIG_RAM_SIZE=524288 +CONFIG_RAM_START=0x34000000 CONFIG_RAW_BINARY=y CONFIG_RR_INTERVAL=200 CONFIG_SCHED_WAITPID=y diff --git a/configs/freedom-k28f/src/freedom-k28f.h b/configs/freedom-k28f/src/freedom-k28f.h index 427ce07972..b7d2ec46f5 100644 --- a/configs/freedom-k28f/src/freedom-k28f.h +++ b/configs/freedom-k28f/src/freedom-k28f.h @@ -57,9 +57,9 @@ * BLUE PTE8 */ -#define GPIO_LED_R (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTE | PIN6) -#define GPIO_LED_G (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTE | PIN7) -#define GPIO_LED_B (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTE | PIN8) +#define GPIO_LED_R (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN6) +#define GPIO_LED_G (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN7) +#define GPIO_LED_B (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN8) /* Two push buttons, SW2 and SW3, are available on FRDM-K28F board, where SW2 is * connected to PTA4 and SW3 is connected to PTD0. Besides the general purpose diff --git a/configs/freedom-k28f/src/k28_autoleds.c b/configs/freedom-k28f/src/k28_autoleds.c index bbffd41c24..8155cc2f77 100644 --- a/configs/freedom-k28f/src/k28_autoleds.c +++ b/configs/freedom-k28f/src/k28_autoleds.c @@ -119,9 +119,9 @@ void board_autoled_on(int led) { if (led != LED_NOCHANGE) { - bool redoff = true; - bool greenoff = true; - bool blueoff = true; + bool redon = false; + bool greenon = false; + bool blueon = false; switch (led) { @@ -130,21 +130,21 @@ void board_autoled_on(int led) break; case LED_OFF_OFF_ON: - blueoff = false; + blueon = true; break; case LED_OFF_ON_OFF: - greenoff = false; + greenon = true; break; case LED_ON_OFF_OFF: - redoff = false; + redon = true; break; } - kinetis_gpiowrite(GPIO_LED_R, redoff); - kinetis_gpiowrite(GPIO_LED_G, greenoff); - kinetis_gpiowrite(GPIO_LED_B, blueoff); + kinetis_gpiowrite(GPIO_LED_R, redon); + kinetis_gpiowrite(GPIO_LED_G, greenon); + kinetis_gpiowrite(GPIO_LED_B, blueon); } } @@ -156,9 +156,9 @@ void board_autoled_off(int led) { if (led == LED_ON_OFF_OFF) { - kinetis_gpiowrite(GPIO_LED_R, true); - kinetis_gpiowrite(GPIO_LED_G, true); - kinetis_gpiowrite(GPIO_LED_B, true); + kinetis_gpiowrite(GPIO_LED_R, false); + kinetis_gpiowrite(GPIO_LED_G, false); + kinetis_gpiowrite(GPIO_LED_B, false); } } diff --git a/configs/freedom-k28f/src/k28_userleds.c b/configs/freedom-k28f/src/k28_userleds.c index 7545c50444..4295dff2ed 100644 --- a/configs/freedom-k28f/src/k28_userleds.c +++ b/configs/freedom-k28f/src/k28_userleds.c @@ -93,7 +93,7 @@ void board_userled(int led, bool ledon) return; } - kinetis_gpiowrite(ledcfg, !ledon); /* Low illuminates */ + kinetis_gpiowrite(ledcfg, ledon); } /**************************************************************************** @@ -104,9 +104,9 @@ void board_userled_all(uint8_t ledset) { /* Low illuminates */ - kinetis_gpiowrite(GPIO_LED_R, (ledset & BOARD_LED_R_BIT) == 0); - kinetis_gpiowrite(GPIO_LED_G, (ledset & BOARD_LED_G_BIT) == 0); - kinetis_gpiowrite(GPIO_LED_B, (ledset & BOARD_LED_B_BIT) == 0); + kinetis_gpiowrite(GPIO_LED_R, (ledset & BOARD_LED_R_BIT) != 0); + kinetis_gpiowrite(GPIO_LED_G, (ledset & BOARD_LED_G_BIT) != 0); + kinetis_gpiowrite(GPIO_LED_B, (ledset & BOARD_LED_B_BIT) != 0); } #endif /* !CONFIG_ARCH_LEDS */ diff --git a/configs/kwikstik-k40/src/kwikstik-k40.h b/configs/kwikstik-k40/src/kwikstik-k40.h index 9460857888..f9698ccd59 100644 --- a/configs/kwikstik-k40/src/kwikstik-k40.h +++ b/configs/kwikstik-k40/src/kwikstik-k40.h @@ -93,7 +93,7 @@ */ #define GPIO_SD_CARDDETECT (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN27) -#define GPIO_SD_CARDON (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTE | PIN6) +#define GPIO_SD_CARDON (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN6) /* Connections via the General Purpose Tower Plug-in (TWRPI) Socket * ------------------- -------------------------- -------- ------------------- diff --git a/configs/teensy-3.x/src/teensy-3x.h b/configs/teensy-3.x/src/teensy-3x.h index 890845adbd..20360b07b2 100644 --- a/configs/teensy-3.x/src/teensy-3x.h +++ b/configs/teensy-3.x/src/teensy-3x.h @@ -67,7 +67,7 @@ * high will illuminate the LED. */ -#define GPIO_LED (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTC | PIN5) +#define GPIO_LED (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTC | PIN5) /************************************************************************************ * Public Types diff --git a/configs/twr-k60n512/src/twr-k60n512.h b/configs/twr-k60n512/src/twr-k60n512.h index 0cf1ea1432..2ebeacf6fd 100644 --- a/configs/twr-k60n512/src/twr-k60n512.h +++ b/configs/twr-k60n512/src/twr-k60n512.h @@ -115,10 +115,10 @@ #define GPIO_SW1 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTA | PIN19) #define GPIO_SW2 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN26) -#define GPIO_LED1 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTA | PIN11) -#define GPIO_LED2 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTA | PIN28) -#define GPIO_LED3 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTA | PIN29) -#define GPIO_LED4 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTA | PIN10) +#define GPIO_LED1 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN11) +#define GPIO_LED2 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN28) +#define GPIO_LED3 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN29) +#define GPIO_LED4 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN10) /* Connections via the General Purpose Tower Plug-in (TWRPI) Socket * -------------------- ------------------------- -------- ------------------- diff --git a/configs/twr-k64f120m/src/twrk64.h b/configs/twr-k64f120m/src/twrk64.h index 7bc66273f6..3f0ceb7733 100644 --- a/configs/twr-k64f120m/src/twrk64.h +++ b/configs/twr-k64f120m/src/twrk64.h @@ -237,10 +237,10 @@ TODO See README /* LEDs. Note that LED1-3 are used by system, LED4 is for user defined apps. */ -#define GPIO_LED1 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTE | PIN6) -#define GPIO_LED2 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTE | PIN7) -#define GPIO_LED3 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTE | PIN8) -#define GPIO_LED4 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTE | PIN9) +#define GPIO_LED1 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN6) +#define GPIO_LED2 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN7) +#define GPIO_LED3 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN8) +#define GPIO_LED4 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN9) /************************************************************************************ * Public Types