Skip to content

Commit ac60a03

Browse files
authored
Merge pull request hathach#1901 from hathach/add-metro-rt1011
Add metro rt1011
2 parents 002ca34 + fbf99b8 commit ac60a03

File tree

9 files changed

+665
-11
lines changed

9 files changed

+665
-11
lines changed

.github/workflows/trigger.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,5 @@ jobs:
5555
git push origin ${{ github.event.release.tag_name }}
5656
5757
# Send POST reqwuest to release https://docs.github.com/en/rest/reference/repos#create-a-release
58-
bb={{ github.event.release.body }}
59-
bb=${bb//\n/\\\n}
58+
bb="For release note, please checkout https://github.com/hathach/tinyusb/releases/tag/${{ github.event.release.tag_name }}"
6059
curl -X POST -H "Authorization: token ${{ secrets.API_TOKEN_GITHUB }}" -H "Accept: application/vnd.github.v3+json" --data '{"tag_name": "${{ github.event.release.tag_name }}", "name": "${{ github.event.release.name }}", "body": "$bb", "draft": ${{ github.event.release.draft }}, "prerelease": ${{ github.event.release.prerelease }}}' https://api.github.com/repos/hathach/tinyusb_src/releases

examples/rules.mk

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,7 @@ $(BUILD)/$(PROJECT).elf: $(OBJ)
170170
endif
171171

172172
# UF2 generation, iMXRT need to strip to text only before conversion
173-
ifeq ($(FAMILY),imxrt)
174-
$(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).elf
175-
@echo CREATE $@
176-
@$(OBJCOPY) -O ihex -R .flash_config -R .ivt $^ $(BUILD)/$(PROJECT)-textonly.hex
177-
$(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -c -o $@ $(BUILD)/$(PROJECT)-textonly.hex
178-
else
173+
ifneq ($(FAMILY),imxrt)
179174
$(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).hex
180175
@echo CREATE $@
181176
$(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -c -o $@ $^
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2019, Ha Thach (tinyusb.org)
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*
24+
* This file is part of the TinyUSB stack.
25+
*/
26+
27+
28+
#ifndef BOARD_H_
29+
#define BOARD_H_
30+
31+
#include "fsl_device_registers.h"
32+
33+
// required since iMX RT10xx SDK include this file for board size
34+
#define BOARD_FLASH_SIZE (8*1024*1024)
35+
36+
// LED
37+
#define LED_PINMUX IOMUXC_GPIO_03_GPIOMUX_IO03
38+
#define LED_PORT GPIO1
39+
#define LED_PIN 3
40+
#define LED_STATE_ON 1
41+
42+
// D2 as button
43+
#define BUTTON_PINMUX IOMUXC_GPIO_13_GPIOMUX_IO13
44+
#define BUTTON_PORT GPIO1
45+
#define BUTTON_PIN 13
46+
#define BUTTON_STATE_ACTIVE 0
47+
48+
// UART
49+
#define UART_PORT LPUART1
50+
#define UART_RX_PINMUX IOMUXC_GPIO_09_LPUART1_RXD
51+
#define UART_TX_PINMUX IOMUXC_GPIO_10_LPUART1_TXD
52+
53+
#endif /* BOARD_H_ */
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CFLAGS += -DCPU_MIMXRT1011DAE5A -DCFG_EXAMPLE_VIDEO_READONLY
2+
MCU_VARIANT = MIMXRT1011
3+
4+
# LD file with uf2
5+
LD_FILE = $(BOARD_PATH)/$(BOARD).ld
6+
7+
# For flash-jlink target
8+
JLINK_DEVICE = MIMXRT1011DAE5A
9+
10+
# For flash-pyocd target
11+
PYOCD_TARGET = mimxrt1010
12+
13+
# flash using pyocd
14+
flash: flash-uf2
15+
flash-uf2: $(BUILD)/$(PROJECT).uf2
16+
@echo copying $<
17+
@$(CP) $< /media/$(USER)/METROM7BOOT
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright 2019 NXP
3+
* All rights reserved.
4+
*
5+
* SPDX-License-Identifier: BSD-3-Clause
6+
*/
7+
8+
#include "evkmimxrt1010_flexspi_nor_config.h"
9+
10+
/* Component ID definition, used by tools. */
11+
#ifndef FSL_COMPONENT_ID
12+
#define FSL_COMPONENT_ID "platform.drivers.xip_board"
13+
#endif
14+
15+
/*******************************************************************************
16+
* Code
17+
******************************************************************************/
18+
#if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1)
19+
#if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__)
20+
__attribute__((section(".boot_hdr.conf")))
21+
#elif defined(__ICCARM__)
22+
#pragma location = ".boot_hdr.conf"
23+
#endif
24+
25+
const flexspi_nor_config_t qspiflash_config = {
26+
.memConfig =
27+
{
28+
.tag = FLEXSPI_CFG_BLK_TAG,
29+
.version = FLEXSPI_CFG_BLK_VERSION,
30+
.readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad,
31+
.csHoldTime = 3u,
32+
.csSetupTime = 3u,
33+
.sflashPadType = kSerialFlash_4Pads,
34+
.serialClkFreq = kFlexSpiSerialClk_100MHz,
35+
.sflashA1Size = 16u * 1024u * 1024u,
36+
.lookupTable =
37+
{
38+
// Read LUTs
39+
FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 24),
40+
FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
41+
},
42+
},
43+
.pageSize = 256u,
44+
.sectorSize = 4u * 1024u,
45+
.blockSize = 64u * 1024u,
46+
.isUniformBlockSize = false,
47+
};
48+
#endif /* XIP_BOOT_HEADER_ENABLE */

0 commit comments

Comments
 (0)