Skip to content

Commit 83359a2

Browse files
committed
Added RT1062 EVKB support and tested on real hardware. Updated documentation.
1 parent de9a3cd commit 83359a2

File tree

6 files changed

+69
-41
lines changed

6 files changed

+69
-41
lines changed

arch.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,11 @@ ifeq ($(TARGET),imx_rt)
434434
CFLAGS+=-I$(MCUXPRESSO)/boards/evkmimxrt1060/xip/
435435
endif
436436

437+
ifeq ($(MCUXPRESSO_CPU),MIMXRT1062DVL6B)
438+
ARCH_FLASH_OFFSET=0x60000000
439+
CFLAGS+=-I$(MCUXPRESSO)/boards/evkbmimxrt1060/xip/
440+
endif
441+
437442
ifeq ($(MCUXPRESSO_CPU),MIMXRT1061CVJ5B)
438443
ARCH_FLASH_OFFSET=0x60000000
439444
CFLAGS+=-I$(MCUXPRESSO)/boards/evkmimxrt1060/xip/

docs/Targets.md

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,15 +1379,19 @@ wolfBoot support for iMX-RT1060/iMX-RT1050 has been tested using MCUXpresso SDK
13791379

13801380
DCP support (hardware acceleration for SHA256 operations) can be enabled by using PKA=1 in the configuration file.
13811381

1382-
Firmware can be directly uploaded to the target by copying `factory.bin` to the virtual USB drive associated to the device, or by loading the image directly into flash using a JTAG/SWD debugger.
1383-
1384-
The RT1050 EVKB board comes wired to use the 64MB HyperFlash. If you'd like to use QSPI there is a rework that can be performed (see AN12183). The default onboard QSPI 8MB ISSI IS25WP064A (`CONFIG_FLASH_IS25WP064A`). To use a 64Mbit Winbond W25Q64JV define `CONFIG_FLASH_W25Q64JV` (16Mbit, 32Mbit, 128Mbit, 256Mbit and 512Mbit versions are also available). These options are also available for the RT1042 and RT1061 target.
1385-
13861382
You can also get the SDK and CMSIS bundles using these repositories:
13871383
* https://github.com/nxp-mcuxpresso/mcux-sdk
13881384
* https://github.com/nxp-mcuxpresso/CMSIS_5
13891385
Use MCUXSDK=1 with this option, since the pack paths are different.
13901386

1387+
Example:
1388+
```
1389+
MCUXSDK?=1
1390+
MCUXPRESSO?=$(PWD)/../mcux-sdk
1391+
MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/MIMXRT1062
1392+
MCUXPRESSO_CMSIS?="$(PWD)/../CMSIS_5/CMSIS"
1393+
```
1394+
13911395
### Custom Device Configuration Data (DCD)
13921396

13931397
On iMX-RT10xx it is possible to load a custom DCD section from an external
@@ -1401,58 +1405,61 @@ section, e.g.:
14011405
If an external `.dcd_data` section is provided, the option `NXP_CUSTOM_DCD=1` must
14021406
be added to the configuration.
14031407

1408+
### Flashing
14041409

1405-
### Testing Update
1406-
1407-
First make the update partition, pre-triggered for update
1410+
Firmware can be directly uploaded to the target by copying `factory.bin` to the virtual USB drive associated to the device, or by loading the image directly into flash using a JTAG/SWD debugger.
14081411

1409-
```sh
1410-
tools/scripts/prepare_update.sh
1411-
```
1412+
The RT1050 EVKB board comes wired to use the 64MB HyperFlash. If you'd like to use QSPI there is a rework that can be performed (see AN12183). The default onboard QSPI 8MB ISSI IS25WP064A (`CONFIG_FLASH_IS25WP064A`). To use a 64Mbit Winbond W25Q64JV define `CONFIG_FLASH_W25Q64JV` (16Mbit, 32Mbit, 128Mbit, 256Mbit and 512Mbit versions are also available). These options are also available for the RT1042 and RT1061 target.
14121413

1413-
Then connect to the board with JLinkExe, for the rt1040 do:
1414+
If you have updated the MCULink to use JLink then you can connect to the board with JLinkExe using one of the following commands:
14141415

14151416
```sh
14161417
# HyperFlash
14171418
JLinkExe -if swd -speed 5000 -Device "MIMXRT1042xxxxB"
1419+
JLinkExe -if swd -speed 5000 -Device "MIMXRT1052XXX6A"
1420+
JLinkExe -if swd -speed 5000 -Device "MIMXRT1062XXX6B"
14181421
# QSPI
14191422
JLinkExe -if swd -speed 5000 -Device "MIMXRT1042xxxxB?BankAddr=0x60000000&Loader=QSPI"
1423+
JLinkExe -if swd -speed 5000 -Device "MIMXRT1052XXX6A?BankAddr=0x60000000&Loader=QSPI"
1424+
JLinkExe -if swd -speed 5000 -Device "MIMXRT1062XXX6B?BankAddr=0x60000000&Loader=QSPI"
14201425
```
14211426

1422-
For the rt1050 do:
1427+
Flash using:
14231428

14241429
```sh
1425-
# HyperFlash
1426-
JLinkExe -if swd -speed 5000 -Device "MIMXRT1052XXX6A"
1427-
# QSPI
1428-
JLinkExe -if swd -speed 5000 -Device "MIMXRT1052XXX6A?BankAddr=0x60000000&Loader=QSPI"
1430+
loadbin factory.bin 0x60000000
14291431
```
14301432

1431-
For the rt-1060:
1433+
### Testing Update
1434+
1435+
First make the update partition, pre-triggered for update:
14321436

14331437
```sh
1434-
# HyperFlash
1435-
JLinkExe -if swd -speed 5000 -Device "MIMXRT1062XXX6B"
1436-
# QSPI
1437-
JLinkExe -if swd -speed 5000 -Device "MIMXRT1062XXX6B?BankAddr=0x60000000&Loader=QSPI"
1438+
./tools/scripts/prepare_update.sh
14381439
```
14391440

1440-
Now flash the board:
1441+
Run the "loadbin" commands to flash the update:
14411442

14421443
```sh
1443-
loadbin factory.bin 0x60000000
14441444
loadbin update.bin 0x60030000
14451445
```
14461446

1447+
Reboot device. Expected output:
1448+
1449+
```
1450+
wolfBoot Test app, version = 1
1451+
wolfBoot Test app, version = 8
1452+
```
1453+
14471454
### NXP iMX-RT Debugging JTAG / JLINK
14481455

14491456
```sh
1450-
# rt-1040
1457+
# Start JLink GDB server for your device
14511458
JLinkGDBServer -Device MIMXRT1042xxxxB -speed 5000 -if swd -port 3333
1452-
# rt-1050
14531459
JLinkGDBServer -Device MIMXRT1052xxx6A -speed 5000 -if swd -port 3333
1454-
# rt-1060
14551460
JLinkGDBServer -Device MIMXRT1062xxx6B -speed 5000 -if swd -port 3333
1461+
1462+
# From wolfBoot directory
14561463
arm-none-eabi-gdb
14571464
add-symbol-file test-app/image.elf 0x60010100
14581465
mon reset init
@@ -2214,8 +2221,8 @@ Note:
22142221
### Running on 64-bit QEMU
22152222

22162223
Two example configuration files are available: `config/examples/x86_fsp_qemu.config` and `config/examples/x86_fsp_qemu_seal.config`.
2217-
Both will try to load a 64bit ELF/Multiboot2 payload from the emulated sata drive.
2218-
The second one is an example of configuration that also do measure boot and seal/unseal secrets using a TPM.
2224+
Both will try to load a 64bit ELF/Multiboot2 payload from the emulated sata drive.
2225+
The second one is an example of configuration that also do measure boot and seal/unseal secrets using a TPM.
22192226

22202227
A test ELF/Multiboot2 image is provided as well. To test `config/examples/x86_fsp_qemu.config` use the following steps:
22212228

@@ -2502,7 +2509,7 @@ To compile a flashable image run the following steps:
25022509
cp config/examples/kontron_vx3060_s2.config .config
25032510
./tools/scripts/x86_fsp/tgl/tgl_download_fsp.sh
25042511
make tpmtools
2505-
./tools/scripts/x86_fsp/tgl/assemble_image.sh -k
2512+
./tools/scripts/x86_fsp/tgl/assemble_image.sh -k
25062513
make CFLAGS_EXTRA="-DHAVE_ECC256"
25072514
./tools/scripts/x86_fsp/tgl/assemble_image.sh -n /path/to/original/flash/dump
25082515
```

hal/imx_rt.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
#include "evkmimxrt1060_flexspi_nor_config.h"
4444
#define USE_GET_CONFIG
4545
#endif
46+
#ifdef CPU_MIMXRT1062DVL6B
47+
#include "evkbmimxrt1060_flexspi_nor_config.h"
48+
#define USE_GET_CONFIG
49+
#endif
4650
#ifdef CPU_MIMXRT1061CVJ5B
4751
#include "evkmimxrt1060_flexspi_nor_config.h"
4852
#endif
@@ -262,7 +266,7 @@ const flexspi_nor_config_t FLASH_CONFIG_SECTION qspiflash_config = {
262266

263267

264268
/** Flash configuration in the .flash_config section of flash **/
265-
#ifdef CPU_MIMXRT1062DVL6A
269+
#if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1062DVL6B)
266270
#define CONFIG_FLASH_SIZE (8 * 1024 * 1024) /* 8MBytes */
267271
#define CONFIG_FLASH_PAGE_SIZE 256UL /* 256Bytes */
268272
#define CONFIG_FLASH_SECTOR_SIZE (4 * 1024) /* 4KBytes */
@@ -590,7 +594,10 @@ const flexspi_nor_config_t FLASH_CONFIG_SECTION qspiflash_config = {
590594

591595

592596
#ifndef __FLASH_BASE
593-
#if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1061CVJ5B) || defined(CPU_MIMXRT1052DVJ6B) || defined(CPU_MIMXRT1042XJM5B)
597+
#if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1062DVL6B) || \
598+
defined(CPU_MIMXRT1061CVJ5B) || \
599+
defined(CPU_MIMXRT1052DVJ6B) || \
600+
defined(CPU_MIMXRT1042XJM5B)
594601
#define __FLASH_BASE 0x60000000
595602
#elif defined(CPU_MIMXRT1064DVL6A)
596603
#define __FLASH_BASE 0x70000000
@@ -709,7 +716,9 @@ static void clock_init(void)
709716
CCM_CBCDR_AHB_PODF(2) |
710717
CCM_CBCDR_IPG_PODF(2);
711718

712-
#if defined(CPU_MIMXRT1064DVL6A) || defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1061CVJ5B)
719+
#if defined(CPU_MIMXRT1064DVL6A) || \
720+
defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1062DVL6B) || \
721+
defined(CPU_MIMXRT1061CVJ5B)
713722
/* Configure FLEXSPI2 CLOCKS */
714723
CCM->CBCMR =
715724
(CCM->CBCMR &

test-app/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,11 @@ ifeq ($(TARGET),imx_rt)
295295
-I$(MCUXPRESSO)/boards/evkmimxrt1060/xip/
296296
APP_OBJS+=$(MCUXPRESSO_DRIVERS)/system_MIMXRT1062.o
297297
endif
298+
ifeq ($(MCUXPRESSO_CPU),MIMXRT1062DVL6B)
299+
CFLAGS+=-I$(MCUXPRESSO_DRIVERS)/project_template/ \
300+
-I$(MCUXPRESSO)/boards/evkbmimxrt1060/xip/
301+
APP_OBJS+=$(MCUXPRESSO_DRIVERS)/system_MIMXRT1062.o
302+
endif
298303
ifeq ($(MCUXPRESSO_CPU),MIMXRT1064DVL6A)
299304
CFLAGS+=-I$(MCUXPRESSO_DRIVERS)/project_template/ \
300305
-I$(MCUXPRESSO)/boards/evkmimxrt1064/xip/

test-app/app_imx_rt.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ void init_debug_console(void)
6464
DbgConsole_Init(UART_INSTANCE, UART_BAUDRATE, UART_TYPE, uartClkSrcFreq);
6565
}
6666

67-
#if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1064DVL6A)
67+
#if defined(CPU_MIMXRT1064DVL6A) || \
68+
defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1062DVL6B)
6869
/* Pin settings (same for both 1062 and 1064) */
6970
void rt1060_init_pins(void)
7071
{
@@ -151,7 +152,8 @@ void rt1040_init_pins(void)
151152
void main(void)
152153
{
153154
imx_rt_init_boot_clock();
154-
#if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1064DVL6A)
155+
#if defined(CPU_MIMXRT1064DVL6A) || \
156+
defined(CPU_MIMXRT1062DVL6A) || defined(MIMXRT1062DVL6B)
155157
rt1060_init_pins();
156158
#elif defined(CPU_MIMXRT1052DVJ6B)
157159
rt1050_init_pins();

test-app/imx_rt_clock_config.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,21 @@ void imx_rt_init_boot_clock(void)
125125
#if !(defined(XIP_EXTERNAL_FLASH) && (XIP_EXTERNAL_FLASH == 1))
126126
/* Disable Flexspi clock gate. */
127127
CLOCK_DisableClock(kCLOCK_FlexSpi);
128-
#ifdef CPU_MIMXRT1062DVL6A
128+
#if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1062DVL6B)
129129
/* Set FLEXSPI_PODF. */
130130
CLOCK_SetDiv(kCLOCK_FlexspiDiv, 1);
131131
/* Set Flexspi clock source. */
132132
CLOCK_SetMux(kCLOCK_FlexspiMux, 3);
133133
#endif
134-
#ifdef CPU_MIMXRT1062DVL6A
134+
#if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1062DVL6B)
135135
/* Set FLEXSPI_PODF. */
136136
CLOCK_SetDiv(kCLOCK_FlexspiDiv, 2);
137137
/* Set Flexspi clock source. */
138138
CLOCK_SetMux(kCLOCK_FlexspiMux, 1);
139139
#endif
140140
#endif
141141

142-
#ifdef CPU_MIMXRT1062DVL6A
142+
#if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1062DVL6B)
143143
/* Disable Flexspi2 clock gate. */
144144
CLOCK_DisableClock(kCLOCK_FlexSpi2);
145145
/* Set FLEXSPI2_PODF. */
@@ -214,12 +214,12 @@ void imx_rt_init_boot_clock(void)
214214
/* Disable CAN clock gate. */
215215
CLOCK_DisableClock(kCLOCK_Can1);
216216
CLOCK_DisableClock(kCLOCK_Can2);
217-
#ifdef CPU_MIMXRT1062DVL6A
217+
#if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1062DVL6B)
218218
CLOCK_DisableClock(kCLOCK_Can3);
219219
#endif
220220
CLOCK_DisableClock(kCLOCK_Can1S);
221221
CLOCK_DisableClock(kCLOCK_Can2S);
222-
#ifdef CPU_MIMXRT1062DVL6A
222+
#if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1062DVL6B)
223223
CLOCK_DisableClock(kCLOCK_Can3S);
224224
#endif
225225
/* Set CAN_CLK_PODF. */
@@ -346,7 +346,7 @@ void imx_rt_init_boot_clock(void)
346346
CCM_ANALOG->PLL_ENET = (CCM_ANALOG->PLL_ENET & (~CCM_ANALOG_PLL_ENET_DIV_SELECT_MASK)) | CCM_ANALOG_PLL_ENET_DIV_SELECT(1);
347347
/* Enable Enet output. */
348348
CCM_ANALOG->PLL_ENET |= CCM_ANALOG_PLL_ENET_ENABLE_MASK;
349-
#ifdef CPU_MIMXRT1062DVL6A
349+
#if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1062DVL6B)
350350
/* Set Enet2 output divider. */
351351
CCM_ANALOG->PLL_ENET = (CCM_ANALOG->PLL_ENET & (~CCM_ANALOG_PLL_ENET_ENET2_DIV_SELECT_MASK)) | CCM_ANALOG_PLL_ENET_ENET2_DIV_SELECT(0);
352352
/* Enable Enet2 output. */
@@ -400,7 +400,7 @@ void imx_rt_init_boot_clock(void)
400400
IOMUXC_MQSConfig(IOMUXC_GPR,kIOMUXC_MqsPwmOverSampleRate32, 0);
401401
/* Set ENET1 Tx clock source. */
402402
IOMUXC_EnableMode(IOMUXC_GPR, kIOMUXC_GPR_ENET1RefClkMode, false);
403-
#ifdef CPU_MIMXRT1062DVL6A
403+
#if defined(CPU_MIMXRT1062DVL6A) || defined(CPU_MIMXRT1062DVL6B)
404404
/* Set ENET2 Tx clock source. */
405405
#if defined(FSL_IOMUXC_DRIVER_VERSION) && (FSL_IOMUXC_DRIVER_VERSION != (MAKE_VERSION(2, 0, 0)))
406406
IOMUXC_EnableMode(IOMUXC_GPR, kIOMUXC_GPR_ENET2RefClkMode, false);

0 commit comments

Comments
 (0)