FRDM-K82 - Secure Boot on External flash

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

FRDM-K82 - Secure Boot on External flash

1,318 Views
swaminathanrath
NXP Employee
NXP Employee

Hi,

I had downloaded the code from the below link.

 

https://nxp1-my.sharepoint.com/personal/donnie_garcia_nxp_com/_layouts/15/onedrive.aspx?slrid=712029...

 

Issue 1 – FRDM -K82 Board.

 

Example code is downloading and executing as expected.

When I had placed the virtual comport example code in internal flash, I could download the code in Factory and programming mode.

 

After placing some of the Application codes in external flash. I could not flash the Application code in Factory mode using blhost.

 

a) Linker script changed, which is attached for your reference.

b) Pinmux.c changed, which is attached for your reference

c) I had followed – “Payment Solutions QuadSPI XIP Guide 1_r0.2.doc” and executed using IAR.

 

Issue 2 – Customer Target -  uses Different NOR Flash – 1MB(Attached for your reference).

 

a) I could not download the Bubble code

              i)  When I did #define OFFCHIP_END_ADDR    0x68080000, Bubble code is downloading in Customer Target board without any issues.

ii) Virtual Com port code when placed in internal flash, it is downloading in Customer target board and running in customer target.

 

4)  When I had used virtual com port code, placed some of the codes in external flash and Below is elftosb output.

Corrections made in FRDM-K82- USB CDC Class.

 

 

pastedImage_1.png

 

 

d) When blhost is executed, I am receiving the below error.

pastedImage_2.png

 

Thanks & regards,

Swaminathan.R

0 Kudos
5 Replies

982 Views
carlos_chavez
NXP Employee
NXP Employee

Please close this thread as it will be supported in a different support forum.

-Carlos

0 Kudos

982 Views
carlos_chavez
NXP Employee
NXP Employee

Hello Swaminathan,

It looks like you got passed the download issues that you were originally facing.  Now, first and foremost, are you using the Payment Solution package in a POS application?  Can you provide more details about the observed failure with the certificate verification?  Is it an application level failure or is it a tool failure?

 

Best Regards,

Carlos

0 Kudos

982 Views
swaminathanrath
NXP Employee
NXP Employee

Hi Carlos,

I had changed the application linker script.

My elftosb screenshot is given below.

C:\Users\b44984\Desktop\blhost & elftosb>elftosb -V -c factory.bd -o factory.sb
creating encrypted range 0x68000000 len 0x3600
Boot Section 0x00000000:
LOAD | adr=0x20004000 | len=0x00000200 | crc=0x0719eed2 | flg=0x0000
ENA | adr=0x20004000 | cnt=0x00000004 | flg=0x0100
ERAS | adr=0x68000000 | cnt=0x00010000 | flg=0x0000
ERAS | adr=0x68010000 | cnt=0x00010000 | flg=0x0000
ERAS | adr=0x68020000 | cnt=0x00010000 | flg=0x0000
ERAS | adr=0x68030000 | cnt=0x00010000 | flg=0x0000
ERAS | adr=0x68040000 | cnt=0x00010000 | flg=0x0000
ERAS | adr=0x68050000 | cnt=0x00010000 | flg=0x0000
ERAS | adr=0x0003f000 | cnt=0x00001000 | flg=0x0000
CALL | adr=0x00004da1 | arg=0x11223344 | flg=0x0000
LOAD | adr=0x00000000 | len=0x00001a0f | crc=0x2f8e0c69 | flg=0x0000
LOAD | adr=0x68000000 | len=0x00003600 | crc=0xc4e54740 | flg=0x0000
CALL | adr=0x00004dcf | arg=0x6d1a853c | flg=0x0000

blhost output

C:\Users\b44984\Desktop\blhost & elftosb>blhost -u -- receive-sb-file factory.sb

Inject command 'receive-sb-file'
Preparing to send 21376 (0x5380) bytes to the target.
Successful generic response to command 'receive-sb-file'
(1/1)3%usb hid detected receiver data abort
Data phase write aborted by status 0x2712 kStatus_AbortDataPhase
Possible JUMP or RESET command received.
Response status = 10200 (0x27d8) kStatusMemoryRangeInvalid
Wrote 832 of 21376 bytes.

Thanks & regards,

Swaminathan.R

0 Kudos

982 Views
swaminathanrath
NXP Employee
NXP Employee

Hi Carlos,

Now i could download the code.

Whereas it is failing in certificate verification. Can you please check it out and let me know on this.

Thanks & regards,

Swaminathan.R

0 Kudos

982 Views
carlos_chavez
NXP Employee
NXP Employee

Hi Swaminathan,

Firstly, from a quick look at this question, the link that you attached appears to no longer exist and I do not have access to the "Payment Solutions QuadSPI XIP" package.  Also, I am not sure what you mean when you state that you could download code in Factory and programming mode.  What do you mean by this?

However, based on the error messages that you received:

According to the Kinetis blhost User's Guide, there is a note about the kStatus_AborDataPhase error.

Note that if the SB file contains a JUMP command, the receive-sb-file command is aborted at the point of the jump, and a status of kStatus_AbortDataPhase is returned.
For the kStatusMemoryRangeInvalid error message, I have seen that when attempting to use 'blhost' to download into QuadSPI alias memory space.  I do not have your 'factory.bd' file to confirm this, but are you loading directly into 0x0400_0000?  Based on the errata below found in https://www.nxp.com/docs/en/errata/KINETIS_K_1N03P.pdf, the ROM Bootloader does not recognize that memory space.
 e9626:   ROM Bootloader: Aliased QuadSPI address space is not supported by the Kinetis Bootloader command APIs
Description:
The Kinetis ROM Bootloader does not recognize QuadSPI alias space, starting at
0x0400_0000, as a valid address space. This means that API commands used to program
data into this space will not succeed, and attempts to boot directly to an address in the alias
space will return status error code ‘kStatus_OutOfRange'.
Workaround:
To program the alias memory space, use the normal QuadSPI address space starting at
address 0x6800_0000.
To begin executing code from the aliased space, the bootloader must first jump to the normal
QuadSPI address space starting at 0x6800_0000, or to internal Flash address space, and then
the code located in that address space should then jump to an address in the aliased space.
The SDK has an example of how to implement the workaround in the "hello_world_qspi_alias" demo apps.
0 Kudos