mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
configs/freedom-kl25z: Change references to NuTiny to Freedom KL25Z
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
README.txt
|
README.txt
|
||||||
==========
|
==========
|
||||||
|
|
||||||
This is the README file for the port of NuttX to the Freescale
|
This is the README file for the port of NuttX to the Freescale Freedom KL25Z
|
||||||
Freedom KL25Z board. This board has the K25Z120LE3AN chip
|
board. This board has the MKL25Z128 chip with a built-in SDA debugger.
|
||||||
with a built-in SDA debugger.
|
|
||||||
|
|
||||||
Contents
|
Contents
|
||||||
========
|
========
|
||||||
@@ -14,13 +13,13 @@ Contents
|
|||||||
- LEDs
|
- LEDs
|
||||||
- Serial Console
|
- Serial Console
|
||||||
- mbed
|
- mbed
|
||||||
- NuTiny-specific Configuration Options
|
- Freedom KL25Z-specific Configuration Options
|
||||||
- Configurations
|
- Configurations
|
||||||
|
|
||||||
Development Environment
|
Development Environment
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
Either Linux or Cygwin under Windows can be used for the development environment.
|
||||||
The source has been built only using the GNU toolchain (see below). Other
|
The source has been built only using the GNU toolchain (see below). Other
|
||||||
toolchains will likely cause problems.
|
toolchains will likely cause problems.
|
||||||
|
|
||||||
@@ -36,7 +35,7 @@ NuttX Buildroot Toolchain
|
|||||||
=========================
|
=========================
|
||||||
|
|
||||||
A GNU GCC-based toolchain is assumed. The files */setenv.sh should
|
A GNU GCC-based toolchain is assumed. The files */setenv.sh should
|
||||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
be modified to point to the correct path to the Cortex-M0 GCC toolchain (if
|
||||||
different from the default in your PATH variable).
|
different from the default in your PATH variable).
|
||||||
|
|
||||||
If you have no Cortex-M0 toolchain, one can be downloaded from the NuttX
|
If you have no Cortex-M0 toolchain, one can be downloaded from the NuttX
|
||||||
@@ -67,29 +66,36 @@ NuttX Buildroot Toolchain
|
|||||||
|
|
||||||
See the file configs/README.txt in the buildroot source tree. That has more
|
See the file configs/README.txt in the buildroot source tree. That has more
|
||||||
details PLUS some special instructions that you will need to follow if you are
|
details PLUS some special instructions that you will need to follow if you are
|
||||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
building a Cortex-M0 toolchain for Cygwin under Windows.
|
||||||
|
|
||||||
LEDs
|
LEDs
|
||||||
====
|
====
|
||||||
|
|
||||||
The NuTiny has a single green LED that can be controlled from sofware.
|
The Freedom KL25Z has a single RGB LED driven by the KL25Z as follows:
|
||||||
This LED is connected to PIN17. It is pulled high so a low value will
|
|
||||||
illuminate the LED.
|
------------- --------
|
||||||
|
RGB LED KL25Z128
|
||||||
|
------------- --------
|
||||||
|
Red Cathode PTB18
|
||||||
|
Green Cathode PTB19
|
||||||
|
Blue Cathode PTD1
|
||||||
|
|
||||||
|
NOTE: PTD1 is also connected to the I/O header on J2 pin 10 (also known as D13).
|
||||||
|
|
||||||
If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||||
NuTiny. The following definitions describe how NuttX controls the LEDs:
|
Freedom KL25Z. The following definitions describe how NuttX controls the LEDs:
|
||||||
|
|
||||||
SYMBOL Meaning LED state
|
SYMBOL Meaning LED state
|
||||||
Initially all LED is OFF
|
Initially all LED is OFF
|
||||||
------------------- ----------------------- ------------- ------------
|
------------------- ----------------------- --------------------------
|
||||||
LED_STARTED NuttX has been started LED ON
|
LED_STARTED NuttX has been started
|
||||||
LED_HEAPALLOCATE Heap has been allocated LED ON
|
LED_HEAPALLOCATE Heap has been allocated
|
||||||
LED_IRQSENABLED Interrupts enabled LED ON
|
LED_IRQSENABLED Interrupts enabled
|
||||||
LED_STACKCREATED Idle stack created LED ON
|
LED_STACKCREATED Idle stack created
|
||||||
LED_INIRQ In an interrupt LED should glow
|
LED_INIRQ In an interrupt
|
||||||
LED_SIGNAL In a signal handler LED might glow
|
LED_SIGNAL In a signal handler
|
||||||
LED_ASSERTION An assertion failed LED ON while handling the assertion
|
LED_ASSERTION An assertion failed
|
||||||
LED_PANIC The system has crashed LED Blinking at 2Hz
|
LED_PANIC The system has crashed
|
||||||
LED_IDLE K25Z1XX is in sleep mode (Optional, not used)
|
LED_IDLE K25Z1XX is in sleep mode (Optional, not used)
|
||||||
|
|
||||||
Serial Console
|
Serial Console
|
||||||
@@ -127,8 +133,8 @@ to the SDA bootloader is this boot loader from mbed:
|
|||||||
http://mbed.org/handbook/mbed-FRDM-KL25Z-Getting-Started
|
http://mbed.org/handbook/mbed-FRDM-KL25Z-Getting-Started
|
||||||
http://mbed.org/handbook/Firmware-FRDM-KL25Z
|
http://mbed.org/handbook/Firmware-FRDM-KL25Z
|
||||||
|
|
||||||
NuTiny-specific Configuration Options
|
Freedom KL25Z-specific Configuration Options
|
||||||
=====================================
|
============================================
|
||||||
|
|
||||||
CONFIG_ARCH - Identifies the arch/ subdirectory. This should
|
CONFIG_ARCH - Identifies the arch/ subdirectory. This should
|
||||||
be set to:
|
be set to:
|
||||||
@@ -150,7 +156,7 @@ NuTiny-specific Configuration Options
|
|||||||
CONFIG_ARCH_CHIP_name - For use in C code to identify the exact
|
CONFIG_ARCH_CHIP_name - For use in C code to identify the exact
|
||||||
chip:
|
chip:
|
||||||
|
|
||||||
CONFIG_ARCH_CHIP_K25Z120LE3AN=y
|
CONFIG_ARCH_CHIP_MKL25Z128=y
|
||||||
|
|
||||||
CONFIG_ARCH_BOARD - Identifies the configs subdirectory and
|
CONFIG_ARCH_BOARD - Identifies the configs subdirectory and
|
||||||
hence, the board that supports the particular chip or SoC.
|
hence, the board that supports the particular chip or SoC.
|
||||||
@@ -199,7 +205,7 @@ NuTiny-specific Configuration Options
|
|||||||
the delay actually is 100 seconds.
|
the delay actually is 100 seconds.
|
||||||
|
|
||||||
Individual subsystems can be enabled as follows. These settings are for
|
Individual subsystems can be enabled as follows. These settings are for
|
||||||
all of the K25Z100/120 line and may not be available for the K25Z120LE3AN
|
all of the K25Z100/120 line and may not be available for the MKL25Z128
|
||||||
in particular:
|
in particular:
|
||||||
|
|
||||||
AHB
|
AHB
|
||||||
|
|||||||
@@ -134,7 +134,33 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* LED definitions ******************************************************************/
|
/* LED definitions ******************************************************************/
|
||||||
/* The KwikStik-K40 board has no MCU driven, GPIO-based LEDs */
|
/* The Freedom KL25Z has a single RGB LED driven by the KL25Z as follows:
|
||||||
|
*
|
||||||
|
* ------------- --------
|
||||||
|
* RGB LED KL25Z128
|
||||||
|
* ------------- --------
|
||||||
|
* Red Cathode PTB18
|
||||||
|
* Green Cathode PTB19
|
||||||
|
* Blue Cathode PTD1
|
||||||
|
*
|
||||||
|
* NOTE: PTD1 is also connected to the I/O header on J2 pin 10 (also known as D13).
|
||||||
|
*
|
||||||
|
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||||
|
* Freedom KL25Z. The following definitions describe how NuttX controls the LEDs:
|
||||||
|
*
|
||||||
|
* SYMBOL Meaning LED state
|
||||||
|
* Initially all LED is OFF
|
||||||
|
* ------------------- ----------------------- --------------------------
|
||||||
|
* LED_STARTED NuttX has been started
|
||||||
|
* LED_HEAPALLOCATE Heap has been allocated
|
||||||
|
* LED_IRQSENABLED Interrupts enabled
|
||||||
|
* LED_STACKCREATED Idle stack created
|
||||||
|
* LED_INIRQ In an interrupt
|
||||||
|
* LED_SIGNAL In a signal handler
|
||||||
|
* LED_ASSERTION An assertion failed
|
||||||
|
* LED_PANIC The system has crashed
|
||||||
|
* LED_IDLE K25Z1XX is in sleep mode (Optional, not used)
|
||||||
|
*/
|
||||||
|
|
||||||
#define LED_STARTED 0
|
#define LED_STARTED 0
|
||||||
#define LED_HEAPALLOCATE 1
|
#define LED_HEAPALLOCATE 1
|
||||||
@@ -146,7 +172,7 @@
|
|||||||
#define LED_PANIC 7
|
#define LED_PANIC 7
|
||||||
|
|
||||||
/* Button definitions ***************************************************************/
|
/* Button definitions ***************************************************************/
|
||||||
/* The KwikStik-K40 board has no standard GPIO contact buttons */
|
/* The Freedom KL25Z board has no standard GPIO contact buttons */
|
||||||
|
|
||||||
/* Alternative pin resolution *******************************************************/
|
/* Alternative pin resolution *******************************************************/
|
||||||
/* If there are alternative configurations for various pins in the
|
/* If there are alternative configurations for various pins in the
|
||||||
|
|||||||
@@ -34,8 +34,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************************************/
|
****************************************************************************************************/
|
||||||
|
|
||||||
#ifndef __CONFIGS_NUTINY_NUC120_SRC_NUTINY_NUC120_H
|
#ifndef __CONFIGS_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H
|
||||||
#define __CONFIGS_NUTINY_NUC120_SRC_NUTINY_NUC120_H
|
#define __CONFIGS_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@@ -50,31 +50,41 @@
|
|||||||
****************************************************************************************************/
|
****************************************************************************************************/
|
||||||
/* Configuration ************************************************************************************/
|
/* Configuration ************************************************************************************/
|
||||||
|
|
||||||
/* NuTiny-EVB-120 GPIOs *****************************************************************************/
|
/* Freedom KL25Z GPIOs ******************************************************************************/
|
||||||
/* The NuTiny has a single green LED that can be controlled from sofware. This LED
|
/* The Freedom KL25Z has a single RGB LED driven by the KL25Z as follows:
|
||||||
* is connected to PIN17 (PB.0). It is pulled high so a low value will illuminate the LED.
|
*
|
||||||
|
* ------------- --------
|
||||||
|
* RGB LED KL25Z128
|
||||||
|
* ------------- --------
|
||||||
|
* Red Cathode PTB18
|
||||||
|
* Green Cathode PTB19
|
||||||
|
* Blue Cathode PTD1
|
||||||
|
*
|
||||||
|
* NOTE: PTD1 is also connected to the I/O header on J2 pin 10 (also known as D13).
|
||||||
*
|
*
|
||||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||||
* NuTiny. The following definitions describe how NuttX controls the LEDs:
|
* Freedom KL25Z. The following definitions describe how NuttX controls the LEDs:
|
||||||
*
|
*
|
||||||
* SYMBOL Meaning LED state
|
* SYMBOL Meaning LED state
|
||||||
* Initially all LED is OFF
|
* Initially all LED is OFF
|
||||||
* ------------------- ----------------------- ------------- ------------
|
* ------------------- ----------------------- --------------------------
|
||||||
* LED_STARTED NuttX has been started LED ON
|
* LED_STARTED NuttX has been started
|
||||||
* LED_HEAPALLOCATE Heap has been allocated LED ON
|
* LED_HEAPALLOCATE Heap has been allocated
|
||||||
* LED_IRQSENABLED Interrupts enabled LED ON
|
* LED_IRQSENABLED Interrupts enabled
|
||||||
* LED_STACKCREATED Idle stack created LED ON
|
* LED_STACKCREATED Idle stack created
|
||||||
* LED_INIRQ In an interrupt LED should glow
|
* LED_INIRQ In an interrupt
|
||||||
* LED_SIGNAL In a signal handler LED might glow
|
* LED_SIGNAL In a signal handler
|
||||||
* LED_ASSERTION An assertion failed LED ON while handling the assertion
|
* LED_ASSERTION An assertion failed
|
||||||
* LED_PANIC The system has crashed LED Blinking at 2Hz
|
* LED_PANIC The system has crashed
|
||||||
* LED_IDLE NUC1XX is in sleep mode (Optional, not used)
|
* LED_IDLE K25Z1XX is in sleep mode (Optional, not used)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define GPIO_LED (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN0)
|
#define GPIO_LED_R (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN18)
|
||||||
|
#define GPIO_LED_G (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN19)
|
||||||
|
#define GPIO_LED_B (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_PORTD | GPIO_PIN1)
|
||||||
|
|
||||||
/* Button definitions ***************************************************************/
|
/* Button definitions ***************************************************************/
|
||||||
/* The NuTiny has no buttons */
|
/* The Freedom KL25Z has no buttons */
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
@@ -94,7 +104,7 @@
|
|||||||
* Name: kl_spiinitialize
|
* Name: kl_spiinitialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the NuTiny-EVB-120 board.
|
* Called to configure SPI chip select GPIO pins for the Freedom KL25Z board.
|
||||||
*
|
*
|
||||||
****************************************************************************************************/
|
****************************************************************************************************/
|
||||||
|
|
||||||
@@ -105,7 +115,7 @@ void weak_function kl_spiinitialize(void);
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called from kl_usbinitialize very early in inialization to setup USB-related
|
* Called from kl_usbinitialize very early in inialization to setup USB-related
|
||||||
* GPIO pins for the NuTiny-EVB-120 board.
|
* GPIO pins for the Freedom KL25Z board.
|
||||||
*
|
*
|
||||||
****************************************************************************************************/
|
****************************************************************************************************/
|
||||||
|
|
||||||
@@ -127,5 +137,5 @@ void kl_ledinit(void);
|
|||||||
|
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
#endif /* __CONFIGS_NUTINY_NUC120_SRC_NUTINY_NUC120_H */
|
#endif /* __CONFIGS_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H */
|
||||||
|
|
||||||
|
|||||||
@@ -33,25 +33,30 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
/* The NuTiny has a single green LED that can be controlled from sofware.
|
/* The Freedom KL25Z has a single RGB LED driven by the KL25Z as follows:
|
||||||
* This LED is connected to PIN17. It is pulled high so a low value will
|
*
|
||||||
* illuminate the LED.
|
* ------------- --------
|
||||||
|
* RGB LED KL25Z128
|
||||||
|
* ------------- --------
|
||||||
|
* Red Cathode PTB18
|
||||||
|
* Green Cathode PTB19
|
||||||
|
* Blue Cathode PTD1
|
||||||
*
|
*
|
||||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||||
* NuTiny. The following definitions describe how NuttX controls the LEDs:
|
* Freedom KL25Z. The following definitions describe how NuttX controls the LEDs:
|
||||||
*
|
*
|
||||||
* SYMBOL Meaning LED state
|
* SYMBOL Meaning LED state
|
||||||
* Initially all LED is OFF
|
* Initially all LED is OFF
|
||||||
* ------------------- ----------------------- ------------- ------------
|
* ------------------- ----------------------- --------------------------
|
||||||
* LED_STARTED NuttX has been started LED ON
|
* LED_STARTED NuttX has been started
|
||||||
* LED_HEAPALLOCATE Heap has been allocated LED ON
|
* LED_HEAPALLOCATE Heap has been allocated
|
||||||
* LED_IRQSENABLED Interrupts enabled LED ON
|
* LED_IRQSENABLED Interrupts enabled
|
||||||
* LED_STACKCREATED Idle stack created LED ON
|
* LED_STACKCREATED Idle stack created
|
||||||
* LED_INIRQ In an interrupt LED should glow
|
* LED_INIRQ In an interrupt
|
||||||
* LED_SIGNAL In a signal handler LED might glow
|
* LED_SIGNAL In a signal handler
|
||||||
* LED_ASSERTION An assertion failed LED ON while handling the assertion
|
* LED_ASSERTION An assertion failed
|
||||||
* LED_PANIC The system has crashed LED Blinking at 2Hz
|
* LED_PANIC The system has crashed
|
||||||
* LED_IDLE NUC1XX is is sleep mode (Optional, not used)
|
* LED_IDLE K25Z1XX is in sleep mode (Optional, not used)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -70,9 +75,6 @@
|
|||||||
#include "kl_gpio.h"
|
#include "kl_gpio.h"
|
||||||
#include "freedom-kl25z.h"
|
#include "freedom-kl25z.h"
|
||||||
|
|
||||||
//extern void blueled(int on);
|
|
||||||
//int i=0;
|
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_LEDS
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -98,7 +100,7 @@
|
|||||||
/* Dump GPIO registers */
|
/* Dump GPIO registers */
|
||||||
|
|
||||||
#if defined(CONFIG_DEBUG_VERBOSE) && defined(CONFIG_DEBUG_LEDS)
|
#if defined(CONFIG_DEBUG_VERBOSE) && defined(CONFIG_DEBUG_LEDS)
|
||||||
# define led_dumpgpio(m) kl_dumpgpio(GPIO_LED, m)
|
# define led_dumpgpio(m) kl_dumpgpio(GPIO_LED_B, m)
|
||||||
#else
|
#else
|
||||||
# define led_dumpgpio(m)
|
# define led_dumpgpio(m)
|
||||||
#endif
|
#endif
|
||||||
@@ -126,10 +128,9 @@
|
|||||||
void kl_ledinit(void)
|
void kl_ledinit(void)
|
||||||
{
|
{
|
||||||
led_dumpgpio("Before configuration");
|
led_dumpgpio("Before configuration");
|
||||||
//kl_configgpio(GPIO_LED);
|
//kl_configgpio(GPIO_LED_R);
|
||||||
/* Blink blue LED to indicate we are here */
|
//kl_configgpio(GPIO_LED_G);
|
||||||
//for (; ; i++)
|
//kl_configgpio(GPIO_LED_B);
|
||||||
// blueled(i & 0x10000);
|
|
||||||
led_dumpgpio("After configuration");
|
led_dumpgpio("After configuration");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +140,7 @@ void kl_ledinit(void)
|
|||||||
|
|
||||||
void up_ledon(int led)
|
void up_ledon(int led)
|
||||||
{
|
{
|
||||||
kl_gpiowrite(GPIO_LED, false);
|
kl_gpiowrite(GPIO_LED_B, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -148,7 +149,7 @@ void up_ledon(int led)
|
|||||||
|
|
||||||
void up_ledoff(int led)
|
void up_ledoff(int led)
|
||||||
{
|
{
|
||||||
kl_gpiowrite(GPIO_LED, true);
|
kl_gpiowrite(GPIO_LED_B, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_ARCH_LEDS */
|
#endif /* CONFIG_ARCH_LEDS */
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ NuttX Buildroot Toolchain
|
|||||||
=========================
|
=========================
|
||||||
|
|
||||||
A GNU GCC-based toolchain is assumed. The files */setenv.sh should
|
A GNU GCC-based toolchain is assumed. The files */setenv.sh should
|
||||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
be modified to point to the correct path to the Cortex-M0 GCC toolchain (if
|
||||||
different from the default in your PATH variable).
|
different from the default in your PATH variable).
|
||||||
|
|
||||||
If you have no Cortex-M0 toolchain, one can be downloaded from the NuttX
|
If you have no Cortex-M0 toolchain, one can be downloaded from the NuttX
|
||||||
@@ -67,7 +67,7 @@ NuttX Buildroot Toolchain
|
|||||||
|
|
||||||
See the file configs/README.txt in the buildroot source tree. That has more
|
See the file configs/README.txt in the buildroot source tree. That has more
|
||||||
details PLUS some special instructions that you will need to follow if you are
|
details PLUS some special instructions that you will need to follow if you are
|
||||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
building a Cortex-M0 toolchain for Cygwin under Windows.
|
||||||
|
|
||||||
LEDs
|
LEDs
|
||||||
====
|
====
|
||||||
|
|||||||
Reference in New Issue
Block a user