diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-04-24 16:46:38 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-04-24 16:46:38 -0600 |
commit | 2b0558a4003a031a7e6dc0c95670473e018d8b98 (patch) | |
tree | 2c0a2c31f3b62533b88d995ad899ae21a0a8e0e7 /nuttx | |
parent | 3abdc6aa5c3dca639e5d73d23bf93fe8d9259937 (diff) | |
download | px4-nuttx-2b0558a4003a031a7e6dc0c95670473e018d8b98.tar.gz px4-nuttx-2b0558a4003a031a7e6dc0c95670473e018d8b98.tar.bz2 px4-nuttx-2b0558a4003a031a7e6dc0c95670473e018d8b98.zip |
Minor Freedom-KL25Z updates
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/arch/arm/src/kl/kl_irq.c | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/kl/kl_lowputc.c | 28 | ||||
-rw-r--r-- | nuttx/arch/arm/src/kl/kl_serial.c | 5 | ||||
-rw-r--r-- | nuttx/configs/freedom-kl25z/README.txt | 49 | ||||
-rw-r--r-- | nuttx/configs/freedom-kl25z/nsh/defconfig | 4 | ||||
-rw-r--r-- | nuttx/configs/freedom-kl25z/ostest/defconfig | 4 | ||||
-rw-r--r-- | nuttx/sched/task_delete.c | 1 |
7 files changed, 53 insertions, 40 deletions
diff --git a/nuttx/arch/arm/src/kl/kl_irq.c b/nuttx/arch/arm/src/kl/kl_irq.c index a400c2cae..783fc42a4 100644 --- a/nuttx/arch/arm/src/kl/kl_irq.c +++ b/nuttx/arch/arm/src/kl/kl_irq.c @@ -359,7 +359,7 @@ int up_prioritize_irq(int irq, int priority) irq == KL_IRQ_PENDSV || irq == KL_IRQ_SYSTICK || (irq >= KL_IRQ_EXTINT && irq < NR_IRQS)); - DEBUGASSERT(priority >= NVIC_SYSH_DISABLE_PRIORITY && + DEBUGASSERT(priority >= NVIC_SYSH_PRIORITY_MAX && priority <= NVIC_SYSH_PRIORITY_MIN); /* Check for external interrupt */ diff --git a/nuttx/arch/arm/src/kl/kl_lowputc.c b/nuttx/arch/arm/src/kl/kl_lowputc.c index 33aab79e0..208bf2c0f 100644 --- a/nuttx/arch/arm/src/kl/kl_lowputc.c +++ b/nuttx/arch/arm/src/kl/kl_lowputc.c @@ -56,18 +56,35 @@ #include "chip/kl_uart.h" #include "chip/kl_pinmux.h" - /************************************************************************** * Private Definitions **************************************************************************/ - + +#warning "Revisit" +#undef BOARD_CORECLK_FREQ +#define BOARD_CORECLK_FREQ 48000000 + /* Select UART parameters for the selected console */ +#if defined(CONFIG_UART0_SERIAL_CONSOLE) # define CONSOLE_BASE KL_UART0_BASE # define CONSOLE_FREQ 48000000 # define CONSOLE_BAUD CONFIG_UART0_BAUD # define CONSOLE_BITS CONFIG_UART0_BITS # define CONSOLE_PARITY CONFIG_UART0_PARITY +#elif defined(CONFIG_UART1_SERIAL_CONSOLE) +# define CONSOLE_BASE KL_UART1_BASE +# define CONSOLE_FREQ 48000000 +# define CONSOLE_BAUD CONFIG_UART1_BAUD +# define CONSOLE_BITS CONFIG_UART1_BITS +# define CONSOLE_PARITY CONFIG_UART1_PARITY +#elif defined(CONFIG_UART2_SERIAL_CONSOLE) +# define CONSOLE_BASE KL_UART2_BASE +# define CONSOLE_FREQ 48000000 +# define CONSOLE_BAUD CONFIG_UART2_BAUD +# define CONSOLE_BITS CONFIG_UART2_BITS +# define CONSOLE_PARITY CONFIG_UART2_PARITY +#endif /************************************************************************** * Private Types @@ -215,7 +232,7 @@ void kl_lowsetup(void) //#if defined(HAVE_SERIAL_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) // kl_uartconfigure(CONSOLE_BASE, CONSOLE_BAUD, CONSOLE_FREQ, -// CONSOLE_PARITY, CONSOLE_BITS); +// CONSOLE_PARITY, CONSOLE_BITS); //#endif } @@ -249,9 +266,8 @@ void kl_uartreset(uintptr_t uart_base) ******************************************************************************/ #ifdef HAVE_UART_DEVICE -void kl_uartconfigure(uintptr_t uart_base, uint32_t baud, - uint32_t clock, unsigned int parity, - unsigned int nbits) +void kl_uartconfigure(uintptr_t uart_base, uint32_t baud, uint32_t clock, + unsigned int parity, unsigned int nbits) { uint32_t sbr; uint32_t brfa; diff --git a/nuttx/arch/arm/src/kl/kl_serial.c b/nuttx/arch/arm/src/kl/kl_serial.c index caaa2c8af..6e4477c0b 100644 --- a/nuttx/arch/arm/src/kl/kl_serial.c +++ b/nuttx/arch/arm/src/kl/kl_serial.c @@ -69,6 +69,11 @@ * Pre-processor Definitions ****************************************************************************/ /* Some sanity checks *******************************************************/ + +#warning "Revisit" +#undef BOARD_CORECLK_FREQ +#define BOARD_CORECLK_FREQ 48000000 + /* Is there at least one UART enabled and configured as a RS-232 device? */ #ifndef HAVE_UART_DEVICE diff --git a/nuttx/configs/freedom-kl25z/README.txt b/nuttx/configs/freedom-kl25z/README.txt index a650cb873..617d416d2 100644 --- a/nuttx/configs/freedom-kl25z/README.txt +++ b/nuttx/configs/freedom-kl25z/README.txt @@ -13,7 +13,7 @@ Contents - NuttX Buildroot Toolchain - LEDs - Serial Console - - Debugging + - mbed - NuTiny-specific Configuration Options - Configurations @@ -97,42 +97,35 @@ Serial Console As with most NuttX configurations, the Freedom KL25Z configurations depend on having a serial console to interact with the software. The -Freedom KL25Z, however, has not on-board RS-232 drivers so will be +Freedom KL25Z, however, has no on-board RS-232 drivers so will be necessary to connect the Freedom KL25Z UART pins to an external RS-232 driver board or TTL-to-Serial USB adaptor. -By default UART1 is used as the serial console on these boards. K25Z120LE3AN -is provided as an LQFP48 package and, for this case, the UART1 RX signal -(RXD1) is on PB.4, pin 8, and the TX signal (TXD1) is on PB.5, pin 9. -These pins are available on the Freedom KL25Z JP5. +By default UART0 is used as the serial console on this boards. The UART0 +is configured to work with the OpenSDA USB CDC/ACM port: - NOTE: The TX vs RX labeling may be confusing. On one RS-232 driver board, - I had to connect the K25Z120 TXD0 pin to the driver boards RXD pin. How - confusing! + ------ ------------------------------- ----------------------------- + PIN PIN FUNCTIONS BOARD SIGNALS + ------ ------------------------------- ----------------------------- + Pin 27 PTA1/TSI0_CH2/UART0_RX/FTM2_CH0 UART1_RX_TGTMCU and D0 (PTA1) + Pin 28 PTA2/TSI0_CH3/UART0_TX/FTM2_CH1 UART1_TX_TGTMCU and D1 (PTA2) -UART0 is an alternative that can be selected by modifying the default -configuation. UART0 RX (RXD0) is on PB.0, pin 17, and the TX signal (TXD0) -is on PB.1, pin 18. These pins are available on the Freedom KL25Z JP1. +But the UART Tx/Rx signals are also available on J1: - NOTE: PB.0, pin 17, is also used to control the user LED on board (labeled - "IO"). CONFIG_ARCH_LED should not be selected if UART0 is used. + ---------------- --------- + UART0 SIGNAL J1 pin + ---------------- --------- + UART0_RX (PTA1) J1, pin 2 + UART0_TX (PTA2) J1, pin 4 -The K25Z120LE3AN does not support UART2. - -Debugging -========= - -The Freedom KL25Z includes a built-in SDA debugger. Unfortunately, -full debug support is available only with the Keil and IAR toolchains. -There is, however, a free program called ICP (In-Circuit Programmer). It -can be used to burn programs into FLASH (aka APROM). +mbed +==== -The ICP program can also be used to burn an ISP program into LDROM. The -ISP (In-System Programmer) is available free from the Nuvton website. +The Freedom KL25Z includes a built-in SDA debugger. An alternative +to the SDA bootloader is this boot loader from mbed: -Then NuttX build does not set the configuration words at 0x0030000-0x00300004. -You should uncheck the Config box when burning APROM or the previous contents -of the configuration words will be erased. +http://mbed.org/handbook/mbed-FRDM-KL25Z-Getting-Started +http://mbed.org/handbook/Firmware-FRDM-KL25Z NuTiny-specific Configuration Options ===================================== diff --git a/nuttx/configs/freedom-kl25z/nsh/defconfig b/nuttx/configs/freedom-kl25z/nsh/defconfig index c7d279994..5fa8616b9 100644 --- a/nuttx/configs/freedom-kl25z/nsh/defconfig +++ b/nuttx/configs/freedom-kl25z/nsh/defconfig @@ -23,8 +23,8 @@ CONFIG_HOST_LINUX=y # Binary Output Formats # # CONFIG_RRLOAD_BINARY is not set -CONFIG_INTELHEX_BINARY=y -# CONFIG_MOTOROLA_SREC is not set +# CONFIG_INTELHEX_BINARY=y +CONFIG_MOTOROLA_SREC=y CONFIG_RAW_BINARY=y # diff --git a/nuttx/configs/freedom-kl25z/ostest/defconfig b/nuttx/configs/freedom-kl25z/ostest/defconfig index 10a18b7b2..9a7491efe 100644 --- a/nuttx/configs/freedom-kl25z/ostest/defconfig +++ b/nuttx/configs/freedom-kl25z/ostest/defconfig @@ -23,8 +23,8 @@ CONFIG_HOST_LINUX=y # Binary Output Formats # # CONFIG_RRLOAD_BINARY is not set -CONFIG_INTELHEX_BINARY=y -# CONFIG_MOTOROLA_SREC is not set +# CONFIG_INTELHEX_BINARY=y +CONFIG_MOTOROLA_SREC=y CONFIG_RAW_BINARY=y # diff --git a/nuttx/sched/task_delete.c b/nuttx/sched/task_delete.c index f6a19a790..637b536ec 100644 --- a/nuttx/sched/task_delete.c +++ b/nuttx/sched/task_delete.c @@ -235,7 +235,6 @@ int task_delete(pid_t pid) * don't bother to unlock the TCB since it will be going away. */ - DEBUGASSERT(!nonblocking); exit(EXIT_SUCCESS); } |