DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
What's in store for DevOps in 2023? Hear from the experts in our "DZone 2023 Preview: DevOps Edition" on Fri, Jan 27!
Save your seat
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Maintenance
  4. Debug and Execute Code From FLASH on the Seeed Arch Mix NXP i.MX RT1052 Board

Debug and Execute Code From FLASH on the Seeed Arch Mix NXP i.MX RT1052 Board

Learn more about debugging and executing code from FLASH.

Erich Styger user avatar by
Erich Styger
·
Jul. 30, 19 · Tutorial
Like (2)
Save
Tweet
Share
6.92K Views

Join the DZone community and get the full member experience.

Join For Free

In my previous article, "Seeed Studio Arch Mix NXP i.MX RT1052 Board," I described how I can use and debug the Seeed Arch Mix Board. But so far, I only had things running in RAM. Ultimately, I want to use the QSPI FLASH memory on the device with my firmware and running code on it. This article shows how to get from RAM execution to SPI FLASH in-place execution (XiP).

Image title

Seeed Arch Mix NXP i.MX RT1052 Board

�� Executing from FLASH is typically slower than running from RAM. But running from FLASH does not need any special loading at runtime.

With still no schematics of the board available (I have asked Seeed for that), I had to do some reverse engineering to find out more about the Arch Mix board.

�� UPDATE: Seeed has uploaded the schematics of the board to http://wiki.seeedstudio.com/Arch_Mix/

I have found the 'ShareBoard' (see links at the end of this article), which seems to be like the predecessor of the Seeed Arch Mix board. That way, I have found out some of the address mapping and peripherals.

I have set up the board for SWD debugging (see "Seeed Studio Arch Mix NXP i.MX RT1052 Board"). I'm using the Eclipse-based MCUXpresso IDE V11.0.0 with the NXP LPC-Link2 debug probe with a 3D printed enclosure.

Image title

Debugging the Seeed Arch Mix i.MX RT1052 Board with LPC-Link2 and MCUXpresso IDE

So here is how to go from 'RAM' to 'SPI FLASH' with the NXP i.MX RT1052 on the Seeed Arch Mix board...

Because there is not much documentation available, I looked at the i.MX RT1020 board projects (see " First Steps with the NXP i.MX RT1020 EVK Board ") as this board is using the same SPI FLASH device.

Image title

i.MX RT1052 with the i.MX RT1020-EVK

First, create an 'empty' project with the Wizard in the MCUXpresso IDE using 'New Project...'. Select the MIMXRT1052xxxxB with the MCUXpresso SDK:

Image title

SDK Wizard

The RT1052 on the board uses the CVL5B package:

Image title

MIMXRT1052CVL5B

So, I select that package to be used:

Image title

Selecting CVL5B Package

The rest leave with the defaults and have the project created. That project is set up for RAM only:

Image title

RAM project

So debugging that project will run it in RAM (actually the DTC RAM), as seen in the disassembly window of the IDE:

Image title

Running in RAM

So how to add the ability to download and debug in the external SPI FLASH?

The FLASH chip on the board is the IS25LP064A-BLE (64 MBit (8 MByte), the same as on the i.MX RT1020-EVK.

Image title

S25LP064A

First, copy the XiP folder from the i.MX RT1020 project as it contains all the needed data to configure and identify the external FLASH device. The files can be renamed t match the 1050/52:

Image title

Copy of XiP

Don't forget to include that new folder for the build (see "Include Source Files for a Build in Eclipse").

The files need the fsl_common, so make sure it is added to the project. Manage the SDK components:

Image title

Manage SDK components

Make sure the common driver is added:

Image title

Common SDK component

To make the FLASH device size known, add the following define to board.h:

#define BOARD_FLASH_SIZE (0x800000U)


Image title

board.h with BOARD_FLASH_SIZE

These files need three defines in the project settings, so have them added:

XIP_EXTERNAL_FLASH=1
XIP_BOOT_HEADER_ENABLE=1
XIP_BOOT_HEADER_DCD_ENABLE=1


Image title

XIP Defines in Compiler Settings

Finally, add the Flash at the beginning of the Memory list in the project settings:

Image title

Added Flash Memory

  • Type: Flash
  • Location: 0x60000000
  • Size: 0x80000
  • Driver: MIMXRT1050-EVK_IS25WP064A.cfx

That's it. Build the project and debug it:

Image title

Running and debugging in FLASH memory the Seeed Arch Mix i.MX RT1052

Victory! We have programmed the Flash and are debugging it!

The project is available as an example on my GitHub. Below are some additional links to help you get started:

  • Project on GitHub
  • Getting Started with the Seeed Arch Mix: Seeed Studio Arch Mix NXP i.MX RT1052 Board
  • Seed Arch Mix Board: https://www.seeedstudio.com/Arch-Mix-p-2901.html
  • ShareBoard i.MX RT1050: https://github.com/Share-Board/ShareBoard-iMXRT1050
  • ShareBoard schematics: https://github.com/Share-Board/ShareBoard-iMXRT1050/blob/master/PCB/V0.40/ShareBoard-i.MXRT1050_REV4.pdf
  • i.MX RT Drivers in RT-Thread: https://github.com/RT-Thread/rt-thread/tree/8ed3470d2a485c49ec4f5d4a5ec53e94edf7a2c8/bsp/imxrt1052-evk/drivers
  • RT1050 QSPI Boot Image discussion: https://community.nxp.com/thread/473345
Mix (build tool) Debug (command) Flash memory

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What Is a Kubernetes CI/CD Pipeline?
  • Bye Bye, Regular Dev [Comic]
  • Better Performance and Security by Monitoring Logs, Metrics, and More
  • ChatGPT Prompts for Agile Practitioners

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: