mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Merge branch 'master' into stm32l4_usb
Conflicts: configs/stm32l476vg-disco/nsh/defconfig
This commit is contained in:
+37
-21
@@ -201,6 +201,17 @@ config ARCH_BOARD_FIRE_STM32
|
||||
and 3 of the boards are supported but only version 2 has been
|
||||
tested.
|
||||
|
||||
config ARCH_BOARD_FREEDOM_K64F
|
||||
bool "NXP Freedom-k64f development board"
|
||||
depends on ARCH_CHIP_MK64FN1M0VLL12
|
||||
select ARCH_HAVE_LEDS
|
||||
select ARCH_HAVE_BUTTONS
|
||||
select ARCH_HAVE_IRQBUTTONS
|
||||
---help---
|
||||
development board.
|
||||
This port uses the FreeScale FREEDOM-K64F development board. This
|
||||
board uses the Kinetis K64 MK64FN1M0VLL12 Cortex-M4 MCU.
|
||||
|
||||
config ARCH_BOARD_FREEDOM_KL25Z
|
||||
bool "Freescale Freedom KL25Z"
|
||||
depends on ARCH_CHIP_MKL25Z128
|
||||
@@ -518,6 +529,15 @@ config ARCH_BOARD_OLIMEX_STM32H407
|
||||
toolchain* under Linux or Cygwin. See the http://www.olimex.com for
|
||||
further information. This board features the STMicro STM32F407ZGT6 (144pins).
|
||||
|
||||
config ARCH_BOARD_OLIMEX_STM32E407
|
||||
bool "Olimex STM32 E407 board"
|
||||
depends on ARCH_CHIP_STM32F407ZG
|
||||
select ARCH_HAVE_LEDS
|
||||
select ARCH_HAVE_BUTTONS
|
||||
select ARCH_HAVE_IRQBUTTONS
|
||||
---help---
|
||||
Olimex STM32 E407 board based on the STMicro STM32F407ZGT6 (144pins).
|
||||
|
||||
config ARCH_BOARD_OLIMEX_STM32P107
|
||||
bool "Olimex STM32 P107 board"
|
||||
depends on ARCH_CHIP_STM32F107VC
|
||||
@@ -1265,25 +1285,19 @@ config ARCH_BOARD_CUSTOM
|
||||
|
||||
endchoice
|
||||
|
||||
if !ARCH_BOARD_CUSTOM
|
||||
|
||||
config ARCH_BOARD_CUSTOM_DIR
|
||||
string
|
||||
default "configs/dummy"
|
||||
|
||||
config ARCH_BOARD_CUSTOM_DIR_RELPATH
|
||||
bool
|
||||
default y
|
||||
|
||||
endif # !ARCH_BOARD_CUSTOM
|
||||
|
||||
if ARCH_BOARD_CUSTOM
|
||||
|
||||
menu "Custom Board Configuration"
|
||||
|
||||
config ARCH_BOARD_CUSTOM_NAME
|
||||
string "Custom board name"
|
||||
default ""
|
||||
---help---
|
||||
This is a name for the board. It is not used except to return the
|
||||
information via the NSH uname command.
|
||||
|
||||
config ARCH_BOARD_CUSTOM_DIR
|
||||
string "Custom board directory"
|
||||
default "configs/dummy"
|
||||
default ""
|
||||
---help---
|
||||
If the custom board configuration is selected, then it is necessary
|
||||
to also tell the build system where it can find the board directory
|
||||
@@ -1300,12 +1314,6 @@ config ARCH_BOARD_CUSTOM_DIR_RELPATH
|
||||
---help---
|
||||
Specifies that the board directory is relative to the NuttX directory.
|
||||
|
||||
config ARCH_BOARD_CUSTOM_NAME
|
||||
string "Custom board name"
|
||||
---help---
|
||||
This is a name for the board. It is not used except to return the
|
||||
information via the NSH uname command.
|
||||
|
||||
config BOARD_CUSTOM_LEDS
|
||||
bool "Custom board LEDs"
|
||||
default n
|
||||
@@ -1355,6 +1363,7 @@ config ARCH_BOARD
|
||||
default "ez80f910200kitg" if ARCH_BOARD_EZ80F910200KITG
|
||||
default "ez80f910200zco" if ARCH_BOARD_EZ80F910200ZCO
|
||||
default "fire-stm32v2" if ARCH_BOARD_FIRE_STM32
|
||||
default "freedom-k64f" if ARCH_BOARD_FREEDOM_K64F
|
||||
default "freedom-kl25z" if ARCH_BOARD_FREEDOM_KL25Z
|
||||
default "freedom-kl26z" if ARCH_BOARD_FREEDOM_KL26Z
|
||||
default "hymini-stm32v" if ARCH_BOARD_HYMINI_STM32V
|
||||
@@ -1387,6 +1396,7 @@ config ARCH_BOARD
|
||||
default "olimex-lpc-h3131" if ARCH_BOARD_OLIMEX_LPC_H3131
|
||||
default "olimex-stm32-h405" if ARCH_BOARD_OLIMEX_STM32H405
|
||||
default "olimex-stm32-h407" if ARCH_BOARD_OLIMEX_STM32H407
|
||||
default "olimex-stm32-e407" if ARCH_BOARD_OLIMEX_STM32E407
|
||||
default "olimex-stm32-p107" if ARCH_BOARD_OLIMEX_STM32P107
|
||||
default "olimex-stm32-p207" if ARCH_BOARD_OLIMEX_STM32P207
|
||||
default "olimex-strp711" if ARCH_BOARD_OLIMEX_STRP711
|
||||
@@ -1555,6 +1565,9 @@ endif
|
||||
if ARCH_BOARD_FIRE_STM32
|
||||
source "configs/fire-stm32v2/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_FREEDOM_K64F
|
||||
source "configs/freedom-k64f/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_FREEDOM_KL25Z
|
||||
source "configs/freedom-kl25z/Kconfig"
|
||||
endif
|
||||
@@ -1654,6 +1667,9 @@ endif
|
||||
if ARCH_BOARD_OLIMEX_STM32H407
|
||||
source "configs/olimex-stm32-h407/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_OLIMEX_STM32E407
|
||||
source "configs/olimex-stm32-e407/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_OLIMEX_STM32P107
|
||||
source "configs/olimex-stm32-p107/Kconfig"
|
||||
endif
|
||||
@@ -1859,7 +1875,7 @@ if ARCH_BOARD_SIM
|
||||
source "configs/sim/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_CUSTOM
|
||||
source "$ARCH_BOARD_CUSTOM_DIR/Kconfig"
|
||||
source "configs/dummy/Kconfig"
|
||||
endif
|
||||
|
||||
config BOARD_CRASHDUMP
|
||||
|
||||
+33
-2
@@ -35,6 +35,28 @@
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
# Determine if there is a Kconfig file for any custom board configuration
|
||||
|
||||
ifeq ($(CONFIG_ARCH_BOARD_CUSTOM),y)
|
||||
CUSTOM_DIR = $(patsubst "%",%,$(CONFIG_ARCH_BOARD_CUSTOM_DIR))
|
||||
ifeq ($(CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH),y)
|
||||
CUSTOM_KPATH = $(TOPDIR)$(DELIM)$(CUSTOM_DIR)$(DELIM)Kconfig
|
||||
else
|
||||
CUSTOM_KPATH = $(CUSTOM_DIR)$(DELIM)Kconfig
|
||||
endif
|
||||
CUSTOM_KCONFIG = $(if $(wildcard $(CUSTOM_KPATH)),y,)
|
||||
else
|
||||
CUSTOM_KCONFIG =
|
||||
endif
|
||||
|
||||
ifeq ($(CUSTOM_KCONFIG),y)
|
||||
BOARD_KCONFIG = $(CUSTOM_KPATH)
|
||||
else
|
||||
BOARD_KCONFIG = $(TOPDIR)$(DELIM)configs$(DELIM)dummy$(DELIM)dummy_kconfig
|
||||
endif
|
||||
|
||||
DUMMY_KCONFIG = $(TOPDIR)$(DELIM)configs$(DELIM)dummy$(DELIM)Kconfig
|
||||
|
||||
# Basic
|
||||
|
||||
CONFIG_ASRCS =
|
||||
@@ -58,7 +80,7 @@ OBJS = $(AOBJS) $(COBJS)
|
||||
BIN = libconfigs$(LIBEXT)
|
||||
|
||||
all: $(BIN)
|
||||
.PHONY: depend clean distclean
|
||||
.PHONY: depend ccontext clean_context clean distclean
|
||||
|
||||
$(AOBJS): %$(OBJEXT): %.S
|
||||
$(call ASSEMBLE, $<, $@)
|
||||
@@ -77,7 +99,16 @@ endif
|
||||
|
||||
depend: .depend
|
||||
|
||||
clean:
|
||||
$(DUMMY_KCONFIG): $(BOARD_KCONFIG)
|
||||
$(call DELFILE, $(DUMMY_KCONFIG))
|
||||
$(Q) cp -f $(BOARD_KCONFIG) $(DUMMY_KCONFIG)
|
||||
|
||||
context: $(DUMMY_KCONFIG)
|
||||
|
||||
clean_context:
|
||||
$(call DELFILE, $(DUMMY_KCONFIG))
|
||||
|
||||
clean: clean_context
|
||||
$(call DELFILE, $(BIN))
|
||||
$(call CLEAN)
|
||||
|
||||
|
||||
@@ -261,6 +261,10 @@ configs/fire-stm32v2
|
||||
STM32F103VET6 chip. See http://firestm32.taobao.com . Version 2 and 3 of
|
||||
the boards are supported but only version 2 has been tested.
|
||||
|
||||
configs/freedom-k64f
|
||||
This port uses the FreeScale FREEDOM-K64F development board. This board
|
||||
uses the Kinetis K64 MK64FN1M0VLL12 Cortex-M4 MCU.
|
||||
|
||||
configs/freedom-kl25z
|
||||
configs/freedom-kl26z
|
||||
These configurations are for the Freescale Freedom KL25Z and very similar
|
||||
@@ -438,6 +442,10 @@ configs/olimex-stm32-h407
|
||||
further information. This board features the STMicro STM32F407ZGT6 (144
|
||||
pins). Contributed by Neil Hancock.
|
||||
|
||||
configs/olimex-stm32-e407
|
||||
Olimex STM32 E407 board based on the STMicro STM32F407ZGT6 (144pins).
|
||||
Contributed by Mateusz Szafoni.
|
||||
|
||||
configs/olimex-stm32-p107
|
||||
This port uses the Olimex STM32-P107 board (STM32F107VC) and a GNU arm-nuttx-elf
|
||||
toolchain* under Linux or Cygwin. See the https://www.olimex.com/dev/stm32-p107.html
|
||||
|
||||
@@ -900,7 +900,7 @@ CONFIG_NSH_CONSOLE=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -577,7 +577,7 @@ CONFIG_EXAMPLES_HELLO=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_FSUTILS_INIFILE is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -668,7 +668,7 @@ CONFIG_NSH_CONSOLE=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_FSUTILS_INIFILE is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -796,7 +796,7 @@ CONFIG_NETUTILS_HTTPD_KEEPALIVE_DISABLE=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -787,7 +787,7 @@ CONFIG_NETUTILS_NETLIB=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -931,7 +931,7 @@ CONFIG_NSH_IOBUFFER_SIZE=512
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_NETDB is not set
|
||||
|
||||
@@ -875,7 +875,7 @@ CONFIG_NSH_CONSOLE=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -1411,7 +1411,7 @@ CONFIG_NSH_IOBUFFER_SIZE=512
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_NETDB is not set
|
||||
|
||||
@@ -797,7 +797,7 @@ CONFIG_NSH_CONSOLE=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -797,7 +797,7 @@ CONFIG_NSH_CONSOLE=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -830,7 +830,7 @@ CONFIG_NSH_CONSOLE=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -971,7 +971,7 @@ CONFIG_NSH_CONSOLE=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -1156,7 +1156,7 @@ CONFIG_NSH_MAX_ROUNDTRIP=20
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
CONFIG_SYSTEM_I2CTOOL=y
|
||||
CONFIG_I2CTOOL_MINBUS=6
|
||||
|
||||
@@ -1156,7 +1156,7 @@ CONFIG_NSH_IOBUFFER_SIZE=512
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
CONFIG_SYSTEM_I2CTOOL=y
|
||||
CONFIG_I2CTOOL_MINBUS=6
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
/Kconfig
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
|
||||
@@ -828,7 +828,7 @@ CONFIG_NSH_ARCHINIT=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -905,7 +905,7 @@ CONFIG_NSH_ARCHINIT=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -777,7 +777,7 @@ CONFIG_EXAMPLES_USBSERIAL_BUFSIZE=512
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
@@ -785,6 +785,6 @@ CONFIG_EXAMPLES_USBSERIAL_BUFSIZE=512
|
||||
# CONFIG_SYSTEM_READLINE is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_USBMONITOR is not set
|
||||
# CONFIG_USBMONITOR is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
||||
|
||||
@@ -712,7 +712,7 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -930,7 +930,7 @@ CONFIG_NETUTILS_HTTPD_KEEPALIVE_DISABLE=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -920,7 +920,7 @@ CONFIG_NETUTILS_NETLIB=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -1126,7 +1126,7 @@ CONFIG_NSH_IOBUFFER_SIZE=512
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_NETDB is not set
|
||||
|
||||
@@ -789,7 +789,7 @@ CONFIG_EXAMPLES_NXFLAT=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -954,7 +954,7 @@ CONFIG_THTTPD_TILDE_MAP_NONE=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -819,7 +819,7 @@ CONFIG_SYSTEM_CLE=y
|
||||
CONFIG_SYSTEM_CLE_DEBUGLEVEL=0
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -819,7 +819,7 @@ CONFIG_SYSTEM_CLE=y
|
||||
CONFIG_SYSTEM_CLE_DEBUGLEVEL=0
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
|
||||
@@ -1118,7 +1118,7 @@ CONFIG_NSH_IOBUFFER_SIZE=512
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_NETDB is not set
|
||||
|
||||
@@ -666,7 +666,7 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
# CONFIG_READLINE_HAVE_EXTMATCH is not set
|
||||
|
||||
@@ -834,7 +834,7 @@ CONFIG_NETUTILS_NETLIB=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
# CONFIG_READLINE_HAVE_EXTMATCH is not set
|
||||
|
||||
@@ -843,7 +843,7 @@ CONFIG_NETUTILS_HTTPD_KEEPALIVE_DISABLE=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
# CONFIG_READLINE_HAVE_EXTMATCH is not set
|
||||
|
||||
@@ -833,7 +833,7 @@ CONFIG_NETUTILS_NETLIB=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
# CONFIG_READLINE_HAVE_EXTMATCH is not set
|
||||
|
||||
@@ -1007,7 +1007,7 @@ CONFIG_NSH_IOBUFFER_SIZE=512
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_NETDB is not set
|
||||
|
||||
@@ -834,7 +834,7 @@ CONFIG_NETUTILS_NETLIB=y
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
# CONFIG_READLINE_HAVE_EXTMATCH is not set
|
||||
|
||||
@@ -1456,7 +1456,7 @@ CONFIG_NSH_IOBUFFER_SIZE=512
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
CONFIG_SYSTEM_I2CTOOL=y
|
||||
CONFIG_I2CTOOL_MINBUS=1
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
|
||||
if ARCH_BOARD_FREEDOM_K64F
|
||||
endif
|
||||
@@ -0,0 +1,393 @@
|
||||
README.txt
|
||||
==========
|
||||
|
||||
This is the README file for the port of NuttX to the Freescale Freedom-K64F
|
||||
develoment board.
|
||||
|
||||
Contents
|
||||
========
|
||||
|
||||
o Freedom K64F Features
|
||||
o Serial Console
|
||||
o LEDs and Buttons
|
||||
o Development Environment
|
||||
o GNU Toolchain Options
|
||||
|
||||
Kinetis Freedom K64F Features:
|
||||
=============================
|
||||
|
||||
The features of the FRDM-K64F hardware are as follows:
|
||||
|
||||
- MK64FN1M0VLL12 MCU (120 MHz, 1 MB flash memory, 256 KB RAM, low-power,
|
||||
crystal-less USB, and 100 LQFP)
|
||||
- Dual role USB interface with micro-B USB connector
|
||||
- RGB LED
|
||||
- FXOS8700CQ - accelerometer and magnetometer
|
||||
- Two user push buttons
|
||||
- Flexible power supply option - OpenSDAv2 USB, K64 USB, and external
|
||||
source
|
||||
- Easy access to MCU input/output through Arduino R3TM compatible I/O
|
||||
connectors
|
||||
- Programmable OpenSDAv2 debug circuit supporting the CMSIS-DAP Interface
|
||||
software that provides:
|
||||
o Mass storage device (MSD) flash programming interface
|
||||
o CMSIS-DAP debug interface over a driver-less USB HID connection
|
||||
providing run-control debugging and compatibility with IDE tools
|
||||
o Virtual serial port interface
|
||||
o Open-source CMSIS-DAP software project: github.com/mbedmicro/CMSIS-DAP.
|
||||
- Ethernet
|
||||
- SDHC
|
||||
- Add-on RF module: nRF24L01+ Nordic 2.4GHz Radio
|
||||
- Add-on Bluetooth module: JY-MCU BT board V1.05 BT
|
||||
|
||||
OpenSDAv2
|
||||
=========
|
||||
|
||||
The FRDM-K64F platform features OpenSDAv2, the Freescale open-source
|
||||
hardware embedded serial and debug adapter running an open-source
|
||||
bootloader. This circuit offers several options for serial communication,
|
||||
flash programming, and run-control debugging. OpenSDAv2 is an mbed
|
||||
HDK-compatible debug interface preloaded with the open-source CMSIS-DAP
|
||||
Interface firmware (mbed interface) for rapid prototyping and product
|
||||
development.
|
||||
|
||||
Serial Console
|
||||
==============
|
||||
|
||||
USB VCOM Console
|
||||
----------------
|
||||
The primary serial port interface signals are PTB16 UART0_RX and PTB17
|
||||
UART0_TX. These signals are connected to the OpenSDAv2 VCOM circuit.
|
||||
|
||||
Serial Shield Console
|
||||
---------------------
|
||||
An alternative serial port might use a standard serial shield mounted
|
||||
on the Freedom Board. In this case, Arduino pin D1 provides UART TX and
|
||||
pin D0 privides UART RX.
|
||||
|
||||
The I/O headers on the FRDM-K64F board are arranged to enable
|
||||
compatibility with Arduino shield. The outer rows of pins (even numbered
|
||||
pins) on the headers, share the same mechanical spacing and placement with
|
||||
the I/O headers on the Arduino Revision 3 (R3) standard.
|
||||
|
||||
The Arduino D0 and D1 pins then correspond to pins 2 and 4 on the J1 I/O
|
||||
connector:
|
||||
|
||||
Arduino Pin FRDM-K64F J1 Connector
|
||||
------------------------ -----------------------
|
||||
UART TX, Arduino D1 pin Pin 4, PTC17, UART3_TX
|
||||
UART RX, Arduino D0 pin Pin 2, PTC16, UART3_RX
|
||||
|
||||
Default Serial Console
|
||||
----------------------
|
||||
By default, these configuration are setup to use the Serial Console on
|
||||
UART3. That, however, is easily reconfigured.
|
||||
|
||||
LEDs and Buttons
|
||||
================
|
||||
|
||||
RGB LED
|
||||
-------
|
||||
An RGB LED is connected through GPIO as shown below:
|
||||
|
||||
LED K64
|
||||
------ -------------------------------------------------------
|
||||
RED PTB22/SPI2_SOUT/FB_AD29/CMP2_OUT
|
||||
BLUE PTB21/SPI2_SCK/FB_AD30/CMP1_OUT
|
||||
GREEN PTE26/ENET_1588_CLKIN/UART4_CTS_b/RTC_CLKOUT/USB0_CLKIN
|
||||
|
||||
If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||
Freedom KL25Z. Usage of these LEDs is defined in include/board.h and
|
||||
src/k64_leds.c. The following definitions describe how NuttX controls the LEDs:
|
||||
|
||||
SYMBOL Meaning LED state
|
||||
RED GREEN BLUE
|
||||
------------------- ----------------------- -----------------
|
||||
LED_STARTED NuttX has been started OFF OFF OFF
|
||||
LED_HEAPALLOCATE Heap has been allocated OFF OFF ON
|
||||
LED_IRQSENABLED Interrupts enabled OFF OFF ON
|
||||
LED_STACKCREATED Idle stack created OFF ON OFF
|
||||
LED_INIRQ In an interrupt (no change)
|
||||
LED_SIGNAL In a signal handler (no change)
|
||||
LED_ASSERTION An assertion failed (no change)
|
||||
LED_PANIC The system has crashed FLASH OFF OFF
|
||||
LED_IDLE K64 is in sleep mode (Optional, not used)
|
||||
|
||||
Buttons
|
||||
-------
|
||||
Two push buttons, SW2 and SW3, are available on FRDM-K64F board, where
|
||||
SW2 is connected to PTC6 and SW3 is connected to PTA4. Besides the
|
||||
general purpose input/output functions, SW2 and SW3 can be low-power
|
||||
wake up signal. Also, only SW3 can be a non-maskable interrupt.
|
||||
|
||||
Switch GPIO Function
|
||||
--------- ---------------------------------------------------------------
|
||||
SW2 PTC6/SPI0_SOUT/PD0_EXTRG/I2S0_RX_BCLK/FB_AD9/I2S0_MCLK/LLWU_P10
|
||||
SW3 PTA4/FTM0_CH1/NMI_b/LLWU_P3
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
The NuttX make system supports several GNU-based toolchains under Linux,
|
||||
Cygwin under Windows, and Windoes native. To select a toolchain:
|
||||
|
||||
1. Use 'make menuconfig' and select the toolchain that you are using
|
||||
under the System Type menu.
|
||||
2. The default toolchain is the NuttX buildroot under Linux or Cygwin:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y
|
||||
|
||||
If you are not using CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT, then you may
|
||||
also have to modify the PATH in the setenv.h file if your make cannot
|
||||
find the tools.
|
||||
|
||||
NOTE: Using native Windows toolchains under Cygwin has some limitations.
|
||||
This incuudes the CodeSourcery (for Windows) and devkitARM toolchains are
|
||||
Windows native toolchains. The biggest limitations 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 no 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.
|
||||
|
||||
Freedom K64F Configuration Options
|
||||
==================================
|
||||
|
||||
CONFIG_ARCH - Identifies the arch/ subdirectory. This sould
|
||||
be set to:
|
||||
|
||||
CONFIG_ARCH=arm
|
||||
|
||||
CONFIG_ARCH_family - For use in C code:
|
||||
|
||||
CONFIG_ARCH_ARM=y
|
||||
|
||||
CONFIG_ARCH_architecture - For use in C code:
|
||||
|
||||
CONFIG_ARCH_CORTEXM4=y
|
||||
|
||||
CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory
|
||||
|
||||
CONFIG_ARCH_CHIP=kinetis
|
||||
|
||||
CONFIG_ARCH_CHIP_name - For use in C code to identify the exact
|
||||
chip:
|
||||
|
||||
CONFIG_ARCH_CHIP_MK64FN1M0VLL12
|
||||
|
||||
CONFIG_ARCH_BOARD - Identifies the configs subdirectory and
|
||||
hence, the board that supports the particular chip or SoC.
|
||||
|
||||
CONFIG_ARCH_BOARD="freedom-k64f" (for the Freedom K64F development board)
|
||||
|
||||
CONFIG_ARCH_BOARD_name - For use in C code
|
||||
|
||||
CONFIG_ARCH_BOARD_FREEDOM_K64F=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_RAM_SIZE - Describes the installed DRAM (SRAM in this case):
|
||||
|
||||
CONFIG_RAM_SIZE=0x00010000 (64Kb)
|
||||
|
||||
CONFIG_RAM_START - The start address of installed DRAM
|
||||
|
||||
CONFIG_RAM_START=0x20000000
|
||||
|
||||
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.
|
||||
|
||||
Individual subsystems can be enabled:
|
||||
|
||||
CONFIG_KINETIS_TRACE -- Enable trace clocking on power up.
|
||||
CONFIG_KINETIS_FLEXBUS -- Enable flexbus clocking on power up.
|
||||
CONFIG_KINETIS_UART0 -- Support UART0
|
||||
CONFIG_KINETIS_UART1 -- Support UART1
|
||||
CONFIG_KINETIS_UART2 -- Support UART2
|
||||
CONFIG_KINETIS_UART3 -- Support UART3
|
||||
CONFIG_KINETIS_UART4 -- Support UART4
|
||||
CONFIG_KINETIS_UART5 -- Support UART5
|
||||
CONFIG_KINETIS_ENET -- Support Ethernet (K5x, K6x, and K7x only)
|
||||
CONFIG_KINETIS_RNGB -- Support the random number generator(K6x only)
|
||||
CONFIG_KINETIS_FLEXCAN0 -- Support FlexCAN0
|
||||
CONFIG_KINETIS_FLEXCAN1 -- Support FlexCAN1
|
||||
CONFIG_KINETIS_SPI0 -- Support SPI0
|
||||
CONFIG_KINETIS_SPI1 -- Support SPI1
|
||||
CONFIG_KINETIS_SPI2 -- Support SPI2
|
||||
CONFIG_KINETIS_I2C0 -- Support I2C0
|
||||
CONFIG_KINETIS_I2C1 -- Support I2C1
|
||||
CONFIG_KINETIS_I2S -- Support I2S
|
||||
CONFIG_KINETIS_DAC0 -- Support DAC0
|
||||
CONFIG_KINETIS_DAC1 -- Support DAC1
|
||||
CONFIG_KINETIS_ADC0 -- Support ADC0
|
||||
CONFIG_KINETIS_ADC1 -- Support ADC1
|
||||
CONFIG_KINETIS_CMP -- Support CMP
|
||||
CONFIG_KINETIS_VREF -- Support VREF
|
||||
CONFIG_KINETIS_SDHC -- Support SD host controller
|
||||
CONFIG_KINETIS_FTM0 -- Support FlexTimer 0
|
||||
CONFIG_KINETIS_FTM1 -- Support FlexTimer 1
|
||||
CONFIG_KINETIS_FTM2 -- Support FlexTimer 2
|
||||
CONFIG_KINETIS_LPTIMER -- Support the low power timer
|
||||
CONFIG_KINETIS_RTC -- Support RTC
|
||||
CONFIG_KINETIS_SLCD -- Support the segment LCD (K3x, K4x, and K5x only)
|
||||
CONFIG_KINETIS_EWM -- Support the external watchdog
|
||||
CONFIG_KINETIS_CMT -- Support Carrier Modulator Transmitter
|
||||
CONFIG_KINETIS_USBOTG -- Support USB OTG (see also CONFIG_USBHOST and CONFIG_USBDEV)
|
||||
CONFIG_KINETIS_USBDCD -- Support the USB Device Charger Detection module
|
||||
CONFIG_KINETIS_LLWU -- Support the Low Leakage Wake-Up Unit
|
||||
CONFIG_KINETIS_TSI -- Support the touch screeen interface
|
||||
CONFIG_KINETIS_FTFL -- Support FLASH
|
||||
CONFIG_KINETIS_DMA -- Support DMA
|
||||
CONFIG_KINETIS_CRC -- Support CRC
|
||||
CONFIG_KINETIS_PDB -- Support the Programmable Delay Block
|
||||
CONFIG_KINETIS_PIT -- Support Programmable Interval Timers
|
||||
CONFIG_ARM_MPU -- Support the MPU
|
||||
|
||||
Kinetis interrupt priorities (Default is the mid priority). These should
|
||||
not be set because they can cause unhandled, nested interrupts. All
|
||||
interrupts need to be at the default priority in the current design.
|
||||
|
||||
CONFIG_KINETIS_UART0PRIO
|
||||
CONFIG_KINETIS_UART1PRIO
|
||||
CONFIG_KINETIS_UART2PRIO
|
||||
CONFIG_KINETIS_UART3PRIO
|
||||
CONFIG_KINETIS_UART4PRIO
|
||||
CONFIG_KINETIS_UART5PRIO
|
||||
|
||||
CONFIG_KINETIS_EMACTMR_PRIO
|
||||
CONFIG_KINETIS_EMACTX_PRIO
|
||||
CONFIG_KINETIS_EMACRX_PRIO
|
||||
CONFIG_KINETIS_EMACMISC_PRIO
|
||||
|
||||
CONFIG_KINETIS_SDHC_PRIO
|
||||
|
||||
PIN Interrupt Support
|
||||
|
||||
CONFIG_GPIO_IRQ -- Enable pin interrupt support. Also needs
|
||||
one or more of the following:
|
||||
CONFIG_KINETIS_PORTAINTS -- Support 32 Port A interrupts
|
||||
CONFIG_KINETIS_PORTBINTS -- Support 32 Port B interrupts
|
||||
CONFIG_KINETIS_PORTCINTS -- Support 32 Port C interrupts
|
||||
CONFIG_KINETIS_PORTDINTS -- Support 32 Port D interrupts
|
||||
CONFIG_KINETIS_PORTEINTS -- Support 32 Port E interrupts
|
||||
|
||||
Kinetis K64 specific device driver settings
|
||||
|
||||
CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn (n=0..5) 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.
|
||||
CONFIG_UARTn_BITS - The number of bits. Must be either 8 or 8.
|
||||
CONFIG_UARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
|
||||
|
||||
Kenetis ethernet controller settings
|
||||
|
||||
CONFIG_ENET_NRXBUFFERS - Number of RX buffers. The size of one
|
||||
buffer is determined by CONFIG_NET_ETH_MTU. Default: 6
|
||||
CONFIG_ENET_NTXBUFFERS - Number of TX buffers. The size of one
|
||||
buffer is determined by CONFIG_NET_ETH_MTU. Default: 2
|
||||
CONFIG_ENET_USEMII - Use MII mode. Default: RMII mode.
|
||||
CONFIG_ENET_PHYADDR - PHY address
|
||||
|
||||
Configurations
|
||||
==============
|
||||
|
||||
Each Freedom K64F configuration is maintained in a sub-directory and
|
||||
can be selected as follow:
|
||||
|
||||
cd tools
|
||||
./configure.sh freedom-k64f/<subdir>
|
||||
cd -
|
||||
. ./setenv.sh
|
||||
|
||||
Where <subdir> is one of the following:
|
||||
|
||||
nsh:
|
||||
---
|
||||
Configures the NuttShell (nsh) located at apps/examples/nsh using a
|
||||
serial console on UART3.
|
||||
|
||||
NOTES:
|
||||
|
||||
1. This configuration uses the mconf-based configuration tool. To
|
||||
change this configuration using that tool, you should:
|
||||
|
||||
a. Build and install the kconfig-mconf tool. See nuttx/README.txt
|
||||
see additional README.txt files in the NuttX tools repository.
|
||||
|
||||
b. Execute 'make menuconfig' in nuttx/ in order to start the
|
||||
reconfiguration process.
|
||||
|
||||
2. Default platform/toolchain:
|
||||
|
||||
CONFIG_HOST_LINUX=y : Linux (Cygwin under Windows okay too).
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : Buildroot (arm-nuttx-elf-gcc)
|
||||
CONFIG_ARMV7M_OABI_TOOLCHAIN=y : The older OABI version
|
||||
CONFIG_RAW_BINARY=y : Output formats: ELF and raw binary
|
||||
|
||||
3. The Serial Console is provided on UART3 with the correct pin
|
||||
configuration for use with an Arduino Serial Shield.
|
||||
|
||||
4. An SDHC driver is has not yet been tested but can be enabled in the NSH
|
||||
configuration by setting the following configuration values as follows:
|
||||
|
||||
CONFIG_KINETIS_SDHC=y : Enable the SDHC driver
|
||||
|
||||
CONFIG_MMCSD=y : Enable MMC/SD support
|
||||
CONFIG_MMCSD_SDIO=y : Use the SDIO-based MMC/SD driver
|
||||
CONFIG_MMCSD_NSLOTS=1 : One MMC/SD slot
|
||||
|
||||
CONFIG_FAT=y : Eable FAT file system
|
||||
CONFIG_FAT_LCNAMES=y : FAT lower case name support
|
||||
CONFIG_FAT_LFN=y : FAT long file name support
|
||||
CONFIG_FAT_MAXFNAME=32 : Maximum lenght of a long file name
|
||||
|
||||
CONFIG_GPIO_IRQ=y : Enable GPIO interrupts
|
||||
CONFIG_KINETIS_PORTEINTS=y : Enable PortE GPIO interrupts
|
||||
|
||||
CONFIG_SCHED_WORKQUEUE=y : Enable the NuttX workqueue
|
||||
|
||||
CONFIG_NSH_ARCHINIT=y : Provide NSH initializeation logic
|
||||
@@ -0,0 +1,269 @@
|
||||
/************************************************************************************
|
||||
* configs/freedom-k64f/include/board.h
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __CONFIG_FREEDOM_K64F_INCLUDE_BOARD_H
|
||||
#define __CONFIG_FREEDOM_K64F_INCLUDE_BOARD_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#ifndef __ASSEMBLY__
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/* Clocking *************************************************************************/
|
||||
/* The Freedom K64F uses a 50MHz external clock from the Micrel Ethernet PHY. The
|
||||
* Kinetis MCU startup from an internal digitally-controlled oscillator (DCO). Nuttx
|
||||
* will enable the main external oscillator (EXTAL0/XTAL0). The external
|
||||
* oscillator/resonator can range from 32.768 KHz up to 50 MHz. The default external
|
||||
* source for the MCG oscillator inputs (EXTAL) is 50 MHz clock source from Micrel
|
||||
* Ethernet PHY.
|
||||
*/
|
||||
|
||||
#define BOARD_EXTCLOCK 1 /* External clock */
|
||||
#define BOARD_EXTAL_FREQ 50000000 /* 50MHz Oscillator from Micrel PHY */
|
||||
#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */
|
||||
|
||||
/* PLL Configuration. Either the external clock or crystal frequency is used to
|
||||
* select the PRDIV value. Only reference clock frequencies are supported that will
|
||||
* produce a 2MHz reference clock to the PLL.
|
||||
*
|
||||
* PLL Input frequency: PLLIN = REFCLK / PRDIV = 50 Mhz / 20 = 2.5 MHz
|
||||
* PLL Output frequency: PLLOUT = PLLIN * VDIV = 2.5 Mhz * 48 = 120 MHz
|
||||
* MCG Frequency: PLLOUT = 96MHz
|
||||
*
|
||||
* PRDIV register value is the divider minus one. So 20 -> 19
|
||||
* VDIV regiser value is offset by 24. So 28 -> 24
|
||||
*/
|
||||
|
||||
#define BOARD_PRDIV 20 /* PLL External Reference Divider */
|
||||
#define BOARD_VDIV 48 /* PLL VCO Divider (frequency multiplier) */
|
||||
|
||||
#define BOARD_PLLIN_FREQ (BOARD_EXTAL_FREQ / BOARD_PRDIV)
|
||||
#define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV)
|
||||
#define BOARD_MCG_FREQ BOARD_PLLOUT_FREQ
|
||||
|
||||
/* SIM CLKDIV1 dividers */
|
||||
|
||||
#define BOARD_OUTDIV1 1 /* Core = MCG, 120 MHz */
|
||||
#define BOARD_OUTDIV2 2 /* Bus = MCG / 2, 60 MHz */
|
||||
#define BOARD_OUTDIV3 2 /* FlexBus = MCG / 2, 60 MHz */
|
||||
#define BOARD_OUTDIV4 5 /* Flash clock = MCG / 5, 24 MHz */
|
||||
|
||||
#define BOARD_CORECLK_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV1)
|
||||
#define BOARD_BUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV2)
|
||||
#define BOARD_FLEXBUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV3)
|
||||
#define BOARD_FLASHCLK_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV4)
|
||||
|
||||
/* SDHC clocking ********************************************************************/
|
||||
|
||||
/* SDCLK configurations corresponding to various modes of operation. Formula is:
|
||||
*
|
||||
* SDCLK frequency = (base clock) / (prescaler * divisor)
|
||||
*
|
||||
* The SDHC module is always configure configured so that the core clock is the base
|
||||
* clock.
|
||||
*/
|
||||
|
||||
/* Identification mode: 400KHz = 96MHz / ( 16 * 15) */
|
||||
|
||||
#define BOARD_SDHC_IDMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV16
|
||||
#define BOARD_SDHC_IDMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15)
|
||||
|
||||
/* MMC normal mode: 16MHz = 96MHz / (2 * 3) */
|
||||
|
||||
#define BOARD_SDHC_MMCMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||
#define BOARD_SDHC_MMCMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3)
|
||||
|
||||
/* SD normal mode (1-bit): 16MHz = 96MHz / (2 * 3) */
|
||||
|
||||
#define BOARD_SDHC_SD1MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||
#define BOARD_SDHC_SD1MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3)
|
||||
|
||||
/* SD normal mode (4-bit): 24MHz = 96MHz / (2 * 2) (with DMA)
|
||||
* SD normal mode (4-bit): 16MHz = 96MHz / (2 * 3) (no DMA)
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SDIO_DMA
|
||||
# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(2)
|
||||
#else
|
||||
//# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||
//# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3)
|
||||
# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV16
|
||||
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15)
|
||||
#endif
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
/* The Freedom K64F has a single RGB LED driven by the K64F as follows:
|
||||
*
|
||||
* LED K64
|
||||
* ------ -------------------------------------------------------
|
||||
* RED PTB22/SPI2_SOUT/FB_AD29/CMP2_OUT
|
||||
* BLUE PTB21/SPI2_SCK/FB_AD30/CMP1_OUT
|
||||
* GREEN PTE26/ENET_1588_CLKIN/UART4_CTS_b/RTC_CLKOUT/USB0_CLKIN
|
||||
*
|
||||
* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any
|
||||
* way. The following definitions are used to access individual LEDs.
|
||||
*/
|
||||
|
||||
/* LED index values for use with board_userled() */
|
||||
|
||||
#define BOARD_LED_R 0
|
||||
#define BOARD_LED_G 1
|
||||
#define BOARD_LED_B 2
|
||||
#define BOARD_NLEDS 3
|
||||
|
||||
/* LED bits for use with board_userled_all() */
|
||||
|
||||
#define BOARD_LED_R_BIT (1 << BOARD_LED_R)
|
||||
#define BOARD_LED_G_BIT (1 << BOARD_LED_G)
|
||||
#define BOARD_LED_B_BIT (1 << BOARD_LED_B)
|
||||
|
||||
/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
|
||||
* the Freedom K64F. The following definitions describe how NuttX controls
|
||||
* the LEDs:
|
||||
*
|
||||
* SYMBOL Meaning LED state
|
||||
* RED GREEN BLUE
|
||||
* ------------------- ----------------------- ----------------- */
|
||||
#define LED_STARTED 1 /* NuttX has been started OFF OFF OFF */
|
||||
#define LED_HEAPALLOCATE 2 /* Heap has been allocated OFF OFF ON */
|
||||
#define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF ON */
|
||||
#define LED_STACKCREATED 3 /* Idle stack created OFF ON OFF */
|
||||
#define LED_INIRQ 0 /* In an interrupt (no change) */
|
||||
#define LED_SIGNAL 0 /* In a signal handler (no change) */
|
||||
#define LED_ASSERTION 0 /* An assertion failed (no change) */
|
||||
#define LED_PANIC 4 /* The system has crashed FLASH OFF OFF */
|
||||
#undef LED_IDLE /* K64 is in sleep mode (Not used) */
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
/* Two push buttons, SW2 and SW3, are available on FRDM-K64F board, where SW2 is
|
||||
* connected to PTC6 and SW3 is connected to PTA4. Besides the general purpose
|
||||
* input/output functions, SW2 and SW3 can be low-power wake up signal. Also, only
|
||||
* SW3 can be a non-maskable interrupt.
|
||||
*
|
||||
* Switch GPIO Function
|
||||
* --------- ---------------------------------------------------------------
|
||||
* SW2 PTC6/SPI0_SOUT/PD0_EXTRG/I2S0_RX_BCLK/FB_AD9/I2S0_MCLK/LLWU_P10
|
||||
* SW3 PTA4/FTM0_CH1/NMI_b/LLWU_P3
|
||||
*/
|
||||
|
||||
#define BUTTON_SW2 0
|
||||
#define BUTTON_SW3 1
|
||||
|
||||
#define BUTTON_SW2_BIT (1 << BUTTON_SW2)
|
||||
#define BUTTON_SW3_BIT (1 << BUTTON_SW3)
|
||||
|
||||
/* Alternative pin resolution *******************************************************/
|
||||
/* If there are alternative configurations for various pins in the
|
||||
* kinetis_k64pinmux.h header file, those alternative pins will be labeled with a
|
||||
* suffix like _1, _2, etc. The logic in this file must select the correct pin
|
||||
* configuration for the board by defining a pin configuration (with no suffix) that
|
||||
* maps to the correct alternative.
|
||||
*/
|
||||
|
||||
/* The primary serial port interface signals are PTB16 UART0_RX and PTB17 UART0_TX.
|
||||
* These signals are connected to the OpenSDAv2 circuit.
|
||||
*/
|
||||
|
||||
#define PIN_UART0_RX PIN_UART0_RX_3
|
||||
#define PIN_UART0_TX PIN_UART0_TX_3
|
||||
|
||||
/* An alternative serial port might use a standard serial shield mounted
|
||||
* on the Freedom Board. In this case, Arduino pin D1 provides UART TX and
|
||||
* pin D0 privides UART RX.
|
||||
*
|
||||
* The I/O headers on the FRDM-K64F board are arranged to enable
|
||||
* compatibility with Arduino shield. The outer rows of pins (even numbered
|
||||
* pins) on the headers, share the same mechanical spacing and placement with
|
||||
* the I/O headers on the Arduino Revision 3 (R3) standard.
|
||||
*
|
||||
* The Arduino D0 and D1 pins then correspond to pins 2 and 4 on the J1 I/O
|
||||
* connector:
|
||||
*
|
||||
* Arduino Pin FRDM-K64F J1 Connector
|
||||
* ------------------------ -----------------------
|
||||
* UART TX, Arduino D1 pin Pin 4, PTC17, UART3_TX
|
||||
* UART RX, Arduino D0 pin Pin 2, PTC16, UART3_RX
|
||||
*/
|
||||
|
||||
#define PIN_UART3_RX PIN_UART3_RX_2
|
||||
#define PIN_UART3_TX PIN_UART3_TX_2
|
||||
|
||||
/************************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Public Function Prototypes
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: kinetis_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All STM32 architectures must provide the following entry point. This entry point
|
||||
* is called early in the intitialization -- after all memory has been configured
|
||||
* and mapped but before any devices have been initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
void kinetis_boardinitialize(void);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIG_FREEDOM_K64F_INCLUDE_BOARD_H */
|
||||
@@ -0,0 +1,111 @@
|
||||
############################################################################
|
||||
# configs/freedom-k64f/nsh/Make.defs
|
||||
#
|
||||
# Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
include ${TOPDIR}/.config
|
||||
include ${TOPDIR}/tools/Config.mk
|
||||
include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
|
||||
|
||||
ifeq ($(WINTOOL),y)
|
||||
# Windows-native toolchains
|
||||
DIRLINK = $(TOPDIR)/tools/copydir.sh
|
||||
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
||||
MKDEP = $(TOPDIR)/tools/mkwindeps.sh
|
||||
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
|
||||
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
|
||||
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/flash.ld}"
|
||||
else
|
||||
# Linux/Cygwin-native toolchain
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT)
|
||||
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
|
||||
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
|
||||
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/flash.ld
|
||||
endif
|
||||
|
||||
CC = $(CROSSDEV)gcc
|
||||
CXX = $(CROSSDEV)g++
|
||||
CPP = $(CROSSDEV)gcc -E
|
||||
LD = $(CROSSDEV)ld
|
||||
AR = $(CROSSDEV)ar rcs
|
||||
NM = $(CROSSDEV)nm
|
||||
OBJCOPY = $(CROSSDEV)objcopy
|
||||
OBJDUMP = $(CROSSDEV)objdump
|
||||
|
||||
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
|
||||
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
ARCHOPTIMIZATION = -g
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
ARCHCFLAGS = -fno-builtin
|
||||
ARCHCXXFLAGS = -fno-builtin -fno-exceptions
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
|
||||
ARCHDEFINES =
|
||||
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
|
||||
|
||||
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
|
||||
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
||||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
||||
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
|
||||
|
||||
NXFLATLDFLAGS1 = -r -d -warn-common
|
||||
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
LDNXFLATFLAGS = -e main -s 2048
|
||||
|
||||
ASMEXT = .S
|
||||
OBJEXT = .o
|
||||
LIBEXT = .a
|
||||
EXEEXT =
|
||||
|
||||
ifneq ($(CROSSDEV),arm-nuttx-elf-)
|
||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||
endif
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Executable → Regular
+4
-4
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# configs/stm32f746g-disco/netnsh/setenv.sh
|
||||
# configs/freedom-k64f/nsh/setenv.sh
|
||||
#
|
||||
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
# Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -61,7 +61,7 @@ fi
|
||||
|
||||
# This is the location where I installed the ARM "GNU Tools for ARM Embedded Processors"
|
||||
# You can this free toolchain here https://launchpad.net/gcc-arm-embedded
|
||||
export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q2/bin"
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q2/bin"
|
||||
|
||||
# This is the path to the location where I installed the devkitARM toolchain
|
||||
# You can get this free toolchain from http://devkitpro.org/ or http://sourceforge.net/projects/devkitpro/
|
||||
@@ -69,7 +69,7 @@ export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/4.9
|
||||
|
||||
# This is the Cygwin path to the location where I build the buildroot
|
||||
# toolchain.
|
||||
# export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin"
|
||||
export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin"
|
||||
|
||||
# Add the path to the toolchain to the PATH varialble
|
||||
export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||
@@ -0,0 +1,142 @@
|
||||
/****************************************************************************
|
||||
* configs/freedom-k64f/scripts/flash.ld
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* The MK64FN1M0VLL12 has 1M of FLASH beginning at address 0x0000:0000 and
|
||||
* 128Kb of SRAM beginning at address 0x1800:0000 (SRAM_L) and 0x2000:000
|
||||
* (SRAM_U).
|
||||
*
|
||||
* NOTE: that the first part of the K64 FLASH region is reserved for
|
||||
* interrupt vectflash and, following that, is a region from 0x0000:0400
|
||||
* to 0x0000:040f that is reserved for the FLASH control fields (FCF).
|
||||
*
|
||||
* NOTE: The on-chip RAM is split evenly among SRAM_L and SRAM_U. The RAM is
|
||||
* also implemented such that the SRAM_L and SRAM_U ranges form a
|
||||
* contiguous block in the memory map.
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
vectflash (rx) : ORIGIN = 0x00000000, LENGTH = 1K
|
||||
cfmprotect (rx) : ORIGIN = 0x00000400, LENGTH = 16
|
||||
progflash (rx) : ORIGIN = 0x00000800, LENGTH = 1M
|
||||
datasram (rwx) : ORIGIN = 0x1fff0000, LENGTH = 128K
|
||||
}
|
||||
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_stext)
|
||||
EXTERN(__flashconfigbytes)
|
||||
SECTIONS
|
||||
{
|
||||
.vectors : {
|
||||
_svectors = ABSOLUTE(.);
|
||||
*(.vectors)
|
||||
_evectors = ABSOLUTE(.);
|
||||
} > vectflash
|
||||
|
||||
.cfmprotect : {
|
||||
KEEP(*(.cfmconfig))
|
||||
} > cfmprotect
|
||||
|
||||
.text : {
|
||||
_stext = ABSOLUTE(.);
|
||||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.got)
|
||||
*(.gcc_except_table)
|
||||
*(.gnu.linkonce.r.*)
|
||||
_etext = ABSOLUTE(.);
|
||||
} > progflash
|
||||
|
||||
.init_section : {
|
||||
_sinit = ABSOLUTE(.);
|
||||
*(.init_array .init_array.*)
|
||||
_einit = ABSOLUTE(.);
|
||||
} > progflash
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} > progflash
|
||||
|
||||
__exidx_start = ABSOLUTE(.);
|
||||
.ARM.exidx : {
|
||||
*(.ARM.exidx*)
|
||||
} > progflash
|
||||
__exidx_end = ABSOLUTE(.);
|
||||
|
||||
.data : {
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
} > datasram AT > progflash
|
||||
|
||||
_eronly = LOADADDR(.data);
|
||||
|
||||
.ramfunc ALIGN(4): {
|
||||
_sramfuncs = ABSOLUTE(.);
|
||||
*(.ramfunc .ramfunc.*)
|
||||
_eramfuncs = ABSOLUTE(.);
|
||||
} > datasram AT > progflash
|
||||
|
||||
_framfuncs = LOADADDR(.ramfunc);
|
||||
|
||||
.bss : {
|
||||
_sbss = ABSOLUTE(.);
|
||||
*(.bss .bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > datasram
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_info 0 : { *(.debug_info) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
############################################################################
|
||||
# configs/freedom-k64f/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
ASRCS =
|
||||
CSRCS = k64_boot.c k64_spi.c
|
||||
|
||||
ifeq ($(CONFIG_ARCH_LEDS),y)
|
||||
CSRCS += k64_autoleds.c
|
||||
else
|
||||
CSRCS += k64_userleds.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_BUTTONS),y)
|
||||
CSRCS += k64_buttons.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIB_BOARDCTL),y)
|
||||
CSRCS += k64_appinit.c k64_bringup.c
|
||||
else ifeq ($(CONFIG_BOARD_INITIALIZE),y)
|
||||
CSRCS += k64_bringup.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_USBDEV),y)
|
||||
CSRCS += k64_usbdev.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_USBMSC),y)
|
||||
CSRCS += k64_usbmsc.c
|
||||
endif
|
||||
|
||||
include $(TOPDIR)/configs/Board.mk
|
||||
@@ -0,0 +1,145 @@
|
||||
/************************************************************************************
|
||||
* configs/freedom-k64f/src/freedom-k64f.h
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __CONFIGS_FREEDOM_K64F_SRC_FREEDOM_K64F_H
|
||||
#define __CONFIGS_FREEDOM_K64F_SRC_FREEDOM_K64F_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
#include <stdint.h>
|
||||
#include <arch/kinetis/chip.h>
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/* How many SPI modules does this chip support? The LM3S6918 supports 2 SPI
|
||||
* modules (others may support more -- in such case, the following must be
|
||||
* expanded).
|
||||
*/
|
||||
|
||||
#if KINETIS_NSPI < 1
|
||||
# undef CONFIG_KINETIS_SPI1
|
||||
# undef CONFIG_KINETIS_SPI2
|
||||
#elif KINETIS_NSPI < 2
|
||||
# undef CONFIG_KINETIS_SPI2
|
||||
#endif
|
||||
|
||||
/* FREEDOM-K64F GPIOs ****************************************************************/
|
||||
/* A micro Secure Digital (SD) card slot is available on the FRDM-K64F connected to
|
||||
* the SD Host Controller (SDHC) signals of the MCU. This slot will accept micro
|
||||
* format SD memory cards. The SD card detect pin (PTE6) is an open switch that
|
||||
* shorts with VDD when card is inserted.
|
||||
*
|
||||
* There is no Write Protect pin available to the K64F.
|
||||
*/
|
||||
|
||||
#define GPIO_SD_CARDDETECT (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN6)
|
||||
|
||||
/* Two push buttons, SW2 and SW3, are available on FRDM-K64F board, where SW2 is
|
||||
* connected to PTC6 and SW3 is connected to PTA4. Besides the general purpose
|
||||
* input/output functions, SW2 and SW3 can be low-power wake up signal. Also, only
|
||||
* SW3 can be a non-maskable interrupt.
|
||||
*
|
||||
* Switch GPIO Function
|
||||
* --------- ---------------------------------------------------------------
|
||||
* SW2 PTC6/SPI0_SOUT/PD0_EXTRG/I2S0_RX_BCLK/FB_AD9/I2S0_MCLK/LLWU_P10
|
||||
* SW3 PTA4/FTM0_CH1/NMI_b/LLWU_P3
|
||||
*/
|
||||
|
||||
#define GPIO_SW2 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTC | PIN6)
|
||||
#define GPIO_SW3 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTA | PIN4)
|
||||
|
||||
/* An RGB LED is connected through GPIO as shown below:
|
||||
*
|
||||
* LED K64
|
||||
* ------ -------------------------------------------------------
|
||||
* RED PTB22/SPI2_SOUT/FB_AD29/CMP2_OUT
|
||||
* BLUE PTB21/SPI2_SCK/FB_AD30/CMP1_OUT
|
||||
* GREEN PTE26/ENET_1588_CLKIN/UART4_CTS_b/RTC_CLKOUT/USB0_CLKIN
|
||||
*/
|
||||
|
||||
#define GPIO_LED_R (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTB | PIN22)
|
||||
#define GPIO_LED_G (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTB | PIN21)
|
||||
#define GPIO_LED_B (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTE | PIN26)
|
||||
|
||||
/************************************************************************************
|
||||
* Public data
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: k64_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the FREEDOM-K64F board.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
void weak_function k64_spidev_initialize(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: k64_usbinitialize
|
||||
*
|
||||
* Description:
|
||||
* Called to setup USB-related GPIO pins for the FREEDOM-K64F board.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
void weak_function k64_usbinitialize(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: k64_bringup
|
||||
*
|
||||
* Description:
|
||||
* Bring up board features
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(CONFIG_LIB_BOARDCTL) || defined(CONFIG_BOARD_INITIALIZE)
|
||||
int k64_bringup(void);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_FREEDOM_K64F_SRC_FREEDOM_K64F_H */
|
||||
@@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
* config/freedom-k64f/src/k64_appinit.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#include "freedom-k64f.h"
|
||||
|
||||
#ifdef CONFIG_LIB_BOARDCTL
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_app_initialize
|
||||
*
|
||||
* Description:
|
||||
* Perform application specific initialization. This function is never
|
||||
* called directly from application code, but only indirectly via the
|
||||
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
|
||||
*
|
||||
* Input Parameters:
|
||||
* arg - The boardctl() argument is passed to the board_app_initialize()
|
||||
* implementation without modification. The argument has no
|
||||
* meaning to NuttX; the meaning of the argument is a contract
|
||||
* between the board-specific initalization logic and the the
|
||||
* matching application logic. The value cold be such things as a
|
||||
* mode enumeration value, a set of DIP switch switch settings, a
|
||||
* pointer to configuration data read from a file or serial FLASH,
|
||||
* or whatever you would like to do with it. Every implementation
|
||||
* should accept zero/NULL as a default configuration.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; a negated errno value is returned on
|
||||
* any failure to indicate the nature of the failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
#ifndef CONFIG_BOARD_INITIALIZE
|
||||
/* Perform board initialization */
|
||||
|
||||
return k64_bringup();
|
||||
#else
|
||||
return OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* CONFIG_LIB_BOARDCTL */
|
||||
@@ -0,0 +1,162 @@
|
||||
/****************************************************************************
|
||||
* configs/freedom-k64f/src/k64_autoleds.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
/* The Freedom K64F has a single RGB LED driven by the K64F as follows:
|
||||
*
|
||||
* LED K64
|
||||
* ------ -------------------------------------------------------
|
||||
* RED PTB22/SPI2_SOUT/FB_AD29/CMP2_OUT
|
||||
* BLUE PTB21/SPI2_SCK/FB_AD30/CMP1_OUT
|
||||
* GREEN PTE26/ENET_1588_CLKIN/UART4_CTS_b/RTC_CLKOUT/USB0_CLKIN
|
||||
*
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
|
||||
* the Freedom K64F. The following definitions describe how NuttX controls
|
||||
* the LEDs:
|
||||
*
|
||||
* SYMBOL Meaning LED state
|
||||
* RED GREEN BLUE
|
||||
* ------------------- ----------------------- -----------------
|
||||
* LED_STARTED NuttX has been started OFF OFF OFF
|
||||
* LED_HEAPALLOCATE Heap has been allocated OFF OFF ON
|
||||
* LED_IRQSENABLED Interrupts enabled OFF OFF ON
|
||||
* LED_STACKCREATED Idle stack created OFF ON OFF
|
||||
* LED_INIRQ In an interrupt (no change)
|
||||
* LED_SIGNAL In a signal handler (no change)
|
||||
* LED_ASSERTION An assertion failed (no change)
|
||||
* LED_PANIC The system has crashed FLASH OFF OFF
|
||||
* LED_IDLE K64 is in sleep mode (Optional, not used)
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "kinetis.h"
|
||||
#include "freedom-k64f.h"
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Summary of all possible settings */
|
||||
|
||||
#define LED_NOCHANGE 0 /* LED_IRQSENABLED, LED_INIRQ, LED_SIGNAL, LED_ASSERTION */
|
||||
#define LED_OFF_OFF_OFF 1 /* LED_STARTED */
|
||||
#define LED_OFF_OFF_ON 2 /* LED_HEAPALLOCATE */
|
||||
#define LED_OFF_ON_OFF 3 /* LED_STACKCREATED */
|
||||
#define LED_ON_OFF_OFF 4 /* LED_PANIC */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_autoled_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the on-board LED
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_autoled_initialize(void)
|
||||
{
|
||||
kinetis_pinconfig(GPIO_LED_R);
|
||||
kinetis_pinconfig(GPIO_LED_G);
|
||||
kinetis_pinconfig(GPIO_LED_B);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_autoled_on
|
||||
****************************************************************************/
|
||||
|
||||
void board_autoled_on(int led)
|
||||
{
|
||||
if (led != LED_NOCHANGE)
|
||||
{
|
||||
bool redoff = true;
|
||||
bool greenoff = true;
|
||||
bool blueoff = true;
|
||||
|
||||
switch (led)
|
||||
{
|
||||
default:
|
||||
case LED_OFF_OFF_OFF:
|
||||
break;
|
||||
|
||||
case LED_OFF_OFF_ON:
|
||||
blueoff = false;
|
||||
break;
|
||||
|
||||
case LED_OFF_ON_OFF:
|
||||
greenoff = false;
|
||||
break;
|
||||
|
||||
case LED_ON_OFF_OFF:
|
||||
redoff = false;
|
||||
break;
|
||||
}
|
||||
|
||||
kinetis_gpiowrite(GPIO_LED_R, redoff);
|
||||
kinetis_gpiowrite(GPIO_LED_G, greenoff);
|
||||
kinetis_gpiowrite(GPIO_LED_B, blueoff);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_autoled_off
|
||||
****************************************************************************/
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARCH_LEDS */
|
||||
@@ -0,0 +1,117 @@
|
||||
/************************************************************************************
|
||||
* configs/freedom-k64f/src/k64_boot.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "freedom-k64f.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: kinetis_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All Kinetis architectures must provide the following entry point. This entry
|
||||
* point is called early in the initialization -- after all memory has been
|
||||
* configured and mapped but before any devices have been initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
void kinetis_boardinitialize(void)
|
||||
{
|
||||
#if defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2)
|
||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
||||
* k64_spidev_initialize() has been brought into the link.
|
||||
*/
|
||||
|
||||
if (k64_spidev_initialize)
|
||||
{
|
||||
k64_spidev_initialize();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_USBDEV) && defined(CONFIG_KINETIS_USB)
|
||||
/* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not
|
||||
* disabled, and 3) the weak function k64_usbinitialize() has been brought
|
||||
* into the build.
|
||||
*/
|
||||
|
||||
if (k64_usbinitialize)
|
||||
{
|
||||
k64_usbinitialize();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
/* Configure on-board LEDs if LED support has been selected. */
|
||||
|
||||
board_autoled_initialize();
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_initialize
|
||||
*
|
||||
* Description:
|
||||
* If CONFIG_BOARD_INITIALIZE is selected, then an additional
|
||||
* initialization call will be performed in the boot-up sequence to a
|
||||
* function called board_initialize(). board_initialize() will be
|
||||
* called immediately after up_intitialize() is called and just before the
|
||||
* initial application is started. This additional initialization phase
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_BOARD_INITIALIZE
|
||||
void board_initialize(void)
|
||||
{
|
||||
/* Perform board initialization */
|
||||
|
||||
(void)k64_bringup();
|
||||
}
|
||||
#endif /* CONFIG_BOARD_INITIALIZE */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user