Problem with result returned from LPC804 IAP boot code version readout in SDK v2.6.0

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

Problem with result returned from LPC804 IAP boot code version readout in SDK v2.6.0

Jump to solution
969 Views
roberto74
Contributor I

Hi all,

Recently I ran into the problem the boot code version readout (by IAP on a LPC804) is not behaving as described in API documentation of LPC804 SDK v2.6.0.

In my tests run in DEBUG the second 32-bit word of the result array is always zero but in RELEASE build it gets random values. It seems the second 32-bit word is not read at all by the boot rom function to readout the boot code version.

So I searched in the user manual (UM11065) and compared source code from "older" LPC804 example code bundle v1.6 and current SDK v2.6.0 (see below).

Description of result according to UM11065 - User Manual LPC804 rev 1.3 (4.6.6 on page 37):

Description:      This command is used to read the boot code version number.

Result:              Result0: 2 bytes of boot code version number. Read as <byte1(Major)>.<byte0(Minor)>


Code snippet from LPC804 Example Code Bundle v1.6:

uint32_t ReadBootcodeVersion(void)
{
IAP.cmd = IAP_READ_BOOT_VER;
IAP_Call (&IAP.cmd, &IAP.stat);
printf("Boot Version is 0x%X\n\n",IAP.res[0] );
if (IAP.stat) return (0);

return (IAP.res[0]);
}

Code snippet from LPC804 SDK v2.6.0:

/*!
* brief Read boot code version number.

* This function is used to read the boot code version number.
*
* param bootCodeVersion Address to store the boot code version.
*
* retval #kStatus_IAP_Success Api was executed successfully.

* note Boot code version is two 32-bit words. Word 0 is the major version, word 1 is the minor version.
*/
status_t IAP_ReadBootCodeVersion(uint32_t *bootCodeVersion)
{
uint32_t command[5], result[5];

command[0] = kIapCmd_IAP_Read_BootromVersion;
iap_entry(command, result);
bootCodeVersion[0] = result[1];
bootCodeVersion[1] = result[2];

return translate_iap_status(result[0]);
}

The result description in the user manual UM11065 seems to be inline with the implementation of LPC804 example code bundle v1.6 but the current SDK v2.6.0 is different and the API description of IAP_ReadBootCodeVersion() is not conform the user manual description.

Please explain how I should interpret the result from IAP_Read_BootromVersion.

Kind regards,

Robert

Labels (1)
0 Kudos
1 Solution
759 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello  Robert Beekmans ,

The User Manual LPC804 rev 1.3 is right, 

Boot code version has 2 bytes , Read as <byte1(Major)>.<byte0(Minor)>.

So in the  SDKv2.6, when read boot code version, you only need to read 

bootCodeVersion[0] = result[1];

I also test on my side:

IAP read boot code version:

pastedImage_4.png

ISP read Boot code version:

pastedImage_5.png

Hope it helps,


Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
760 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello  Robert Beekmans ,

The User Manual LPC804 rev 1.3 is right, 

Boot code version has 2 bytes , Read as <byte1(Major)>.<byte0(Minor)>.

So in the  SDKv2.6, when read boot code version, you only need to read 

bootCodeVersion[0] = result[1];

I also test on my side:

IAP read boot code version:

pastedImage_4.png

ISP read Boot code version:

pastedImage_5.png

Hope it helps,


Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
759 Views
roberto74
Contributor I

Hi Alice,

Thank you for your answer and I can confirm my LPC804 device also returns 0xD01 so as you stated the User Manual rev. 1.3 and LPC804 Example Code Bundle v1.6 are correct.

Hopefully you can confirm the API description of IAP_ReadBootCodeVersion(uint32_t *bootCodeVersion)

will be fixed in the next release of the SDK so it will not confuse others as well?

Kind regards,

Robert

0 Kudos
759 Views
roberto74
Contributor I

Hi all,

Please note this issue is not fixed in the lastest LPC804 SDK v2.7.0 (Dec 2019).

Kind regards,

Robert

0 Kudos