blhost configure-memory operation: what is it actually doing?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

blhost configure-memory operation: what is it actually doing?

546 Views
rdegliesposti
Contributor I

Hello,
I have a RT102x EVK on which I have enabled HAB and Encrypted XIP. With SPSDK I export a bootable image and then I write it to the Flash using J-Link. The firmware doesn't start. I have verified that it is correctly written by using SEC.
If I try to write the same binary using SEC's Flash Programmer tool, it runs.
Upon further investigation, after writing the flash using J-Link, I try to execute `secureprovisioningtool/ProvaCoro1/ext_memory_setup.sh`, and this way the firmware starts.
In particular, the last two commands seem to be what makes it work:

echo "### Configure FlexSPI NOR memory using options on address 0x2000 ###"
"$blhost" $blhost_connect -j -- fill-memory 0x2000 4 0xC0000007 word
if [ $? -ge 2 ]; then
    exit 2
fi

"$blhost" $blhost_connect -j -- configure-memory 9 0x2000
if [ $? -ge 2 ]; then
    exit 2
fi

I would like to understand what they are actually doing, considering that the contents of the flash memory remain untouched.

Thanks

Tags (1)
1 Reply

434 Views
mayliu1
NXP Employee
NXP Employee

Hi @rdegliesposti ,

Thank you so much for your interest in our products and for using our community.

Q:I would like to understand what they are actually doing, considering that the contents of the flash memory remain untouched.

A: Yes. Those two blhost commands are not programming the flash contents. 

1: fill-memory writes the FlexSPI configuration option to RAM.

2: configure-memory tells the ROM bootloader/flashloader to use that RAM-resident option block to initialize/configure the external FlexSPI NOR interface.

After that, the flash becomes accessible in the required mode, but its contents are still unchanged until a later command such as flash-erase-region , write-memory , or flash-image is issued.”

For more detail information, you can refer to the application note below:

https://www.nxp.com/docs/en/nxp/application-notes/AN12238.pdf

mayliu1_0-1777257834092.pngmayliu1_0-1777257834092.png

 

Best Regards

May Liu

 

0 Kudos
Reply