Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Add support for NXP Kinetis K28FA #2462

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions hw/bsp/board_mcu.h
Expand Up @@ -50,6 +50,9 @@
#elif TU_CHECK_MCU(OPT_MCU_KINETIS_KL, OPT_MCU_KINETIS_K32L, OPT_MCU_KINETIS_K)
#include "fsl_device_registers.h"

#elif TU_CHECK_MCU(OPT_MCU_KINETIS_K28F)
#include "fsl_device_registers.h"

#elif CFG_TUSB_MCU == OPT_MCU_NRF5X
#include "nrf.h"

Expand Down
56 changes: 56 additions & 0 deletions hw/bsp/kinetis_k28/boards/frdm_k28fa15/board.h
@@ -0,0 +1,56 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2019, Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* This file is part of the TinyUSB stack.
*/


#ifndef BOARD_H_
#define BOARD_H_

#include "fsl_device_registers.h"

// Green LED
#define LED_PIN_CLOCK kCLOCK_PortE
#define LED_GPIO GPIOE
#define LED_PORT PORTE
#define LED_PIN 6
#define LED_STATE_ON 1

// SW3 button1
#define BUTTON_PIN_CLOCK kCLOCK_PortD
#define BUTTON_GPIO GPIOD
#define BUTTON_PORT PORTD
#define BUTTON_PIN 0
#define BUTTON_STATE_ACTIVE 0

// UART
#define UART_PORT LPUART0
#define UART_PIN_CLOCK kCLOCK_PortC
#define UART_PIN_PORT PORTC
#define UART_PIN_RX 24u
#define UART_PIN_TX 25u
#define SOPT5_LPUART0RXSRC_LPUART_RX 0x00u /*!<@brief LPUART0 Receive Data Source Select: LPUART_RX pin */
#define SOPT5_LPUART0TXSRC_LPUART_TX 0x00u /*!<@brief LPUART0 Transmit Data Source Select: LPUART0_TX pin */

#endif /* BOARD_H_ */
18 changes: 18 additions & 0 deletions hw/bsp/kinetis_k28/boards/frdm_k28fa15/board.mk
@@ -0,0 +1,18 @@
MCU = MK28FA15

CFLAGS += -DCPU_MK28FN2M0AVMI15

# mcu driver cause following warnings
CFLAGS += -Wno-unused-parameter -Wno-redundant-decls

# All source paths should be relative to the top level.
LD_FILE = $(MCU_DIR)/gcc/MK28FN2M0Axxx15_flash.ld

# For flash-jlink target
JLINK_DEVICE = MK28FN2M0Axxx15

# For flash-pyocd target
PYOCD_TARGET = MK28FA15

# flash using pyocd
flash: flash-pyocd