Converting MCUXpresso project to XIP in QSPI

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting MCUXpresso project to XIP in QSPI

720 Views
hemlock
Contributor II

I'm currently trying to convert an MCUXPresso/Amazon FreeRTOS project to XIP on QSPI on the FRDM-K82 board and am having some difficulty.

I'm following the demo_apps_hello_world_qspi/doc/readme.txt reference as well as the "Kinetis Bootloader QuadSPI User's Guide" section "Creating application for QuadSPI memory.

According to these documents the following must occur:

1) the linker file for an application to be executed out of QSPI needs to be updated to point to the QSPI memory at location 0x68001000

2) the flash config FOPT bits need to be set to 0b10 -- "ROM -> QSPI Yes"
3) the preprocessor directive BOOTLOADER_CONFIG needs to be defined in the project properties
4) the NXP Kinetis Bootloader needs to be running on the chip, by pressing sw2/NMI during power-on
5) a valid QSPI config binary, such as the one included in "NXP_Kinetis_Bootloader_2_0_0/apps/QCBGenerator/binaries/qspi_config_block.bin" needs to be loaded into 0x68000000

6) a valid board file, such as the one located in "NXP_Kinetis_Bootloader_2_0_0/apps/demo_qspi/qspi_image_0000.bd" needs to be modified to point to your user application's .srec file and the qspi_config_block.bin from (5) above.
7) the user-application.axf file needs to be converted to motorola format, via a command like: 

arm-none-eabi-objcopy -v -O srec "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.srec" - this file needs to be in the same directory as the BD file and qspi_config_block.bin and the elftosb utility
8)  an SB file needs to be generated via the command ./elftosb.exe -V -c qspi_image_0000.bd -o user-application.sb
9) the sb file is loaded onto the QSPI by contacting the Kinetis bootloader with the 'blhost' utility: 

"./blhost.exe -u -- receive-sb-file user-application.sb"

However - when I run the blhost.exe 'receieve-sb-file' command - the sb file seemingly fails to flash the last 32 bytes:

blhost.exe -u -- receive-sb-file agent-poc.sb
Inject command 'receive-sb-file'
Preparing to send 23648 (0x5c60) bytes to the target.
Successful generic response to command 'receive-sb-file'
usb hid detected receiver data abort
Data phase write aborted by status 0x2712 kStatus_AbortDataPhase
Response status = 10004 (0x2714) No response packet from target device.
Wrote 23616 of 23648 bytes.


I have a sample program that should configure and manipulate the RGB LED on the board, and have confirmed this happens when I run out of on-board flash, but the bootloader does not seem to jump to or run this code in the QSPI-- or perhaps the code is not successfully flashed or perhaps the QSPI config is incorrect?

Let me know if anyone else has seen this issue and has a solution.  Or if there's an application note that describes how to configure MCUXpresso projects to run out of the QSPI

Find attached: screenshots of my memory configuration and FOPT settings, and my map file, qspi_config_block.bin, BD file and srec

0 Kudos
5 Replies

298 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Yes, it seems this demo compiled by MCUXpresso can't work. I guess there are some problems in link file. I'll ask someone for help. I have also test this demo by IAR and KEIL. They are ok. You can use those IDE to get around this problem.

Regards,

Jing

0 Kudos

298 Views
hemlock
Contributor II

I am able to build demo applications in KDS that will run out of QSPI memory, but the blhost utility seems to similarly report "kStatus_AbortDataPhase "

And typically misses the last 32 bytes -- even when the program is flashed 'successfully.'  (Note that 23648-23616=32)


see my previous question:

FRDM-K82 QSPI XIP problem 

0 Kudos

298 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi john,

I think this is not a problem. Please look at page26 figure 13 in Kinetis Bootloader QuadSPI User's Guide.pdf.

blhost_xip.png

I guess this is because data in sb file is orgnized in block. The last block will be filled with useless data.

Regards,

Jing

0 Kudos

298 Views
hemlock
Contributor II

I filed a support ticket 00168837 on this question

0 Kudos

298 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

When you are testing by MCUXPRESSO, are you using semihost console or UART console?

In this case, you must choose UART console, while the semihost console is default configuration.

Regards,

Jing

0 Kudos