Device Serial Number

8 replies [Last post]
PhilYoung
Offline
Joined: 2011-07-18

Has anybody managed yet to get the device serial number using the IAP?.

The documentation is clearly broken.

#define IAP_LOCATION *(volatile unsigned int *)(0x104000100);

( why the semicolon ???, crap coding ).

NXP obviously never tested this since the address has too many digits, last I checked the M4 was a 32 bit core, not 36!.

neither 0x10400010 nor 0x10400100 work.

does anybody know the correct address, or simply where the serial number is stored.

0
Your rating: None

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
wellsk's picture
wellsk
Offline
Joined: 2011-05-17

See the code here for IAP use with the internal FLASH IAP programming example for DFUSec. This was used with the 18xx, but the 43xx has the same address - I just use the 18xx binary on the 43xx. The example also shows how to query the serial number and FLASH using IAP.

http://sw.lpcware.com/?p=lpc18xx.git&a=blob&h=48c7b37269c7e5117e8ce69273...

The IAP address and basic query code is:

typedef void (* IAP)(uint32_t *, uint32_t *);
#define IAP_LOCATION *((uint32_t *) 0x10400100);
static IAP iap_entry;
static uint32_t command[6], result[5];

/* Initialize IAP */
command[0] = IAP_INIT;
iap_entry(command, result);
if (result[0] == IAP_COMMAND_SUCCESS) {
        /* Get part ID */
        command[0] = IAP_READ_PART_ID;

        /* result[1] amd result[2] should contain partid1 and partid2 after the call
        iap_entry(command, result);

Kevin Wells

NXP Semiconductors

Kevin Wells

NXP Semiconductors

PhilYoung
Offline
Joined: 2011-07-18

Thanks Kevin, but this doesn't work.

I'm using an LPC4330.

at 0x10400100 I see the value 0x12345678 so clearly it isn't the entry point for the IAP on the LPC4330.

_rdword(0x10400100)
0x12345678

0x10400100 5678 LDRSB r0,[r7,r1]
0x10400102 1234 ASRS r4,r6,#8
0x10400104 72F0 STRB r0,[r6,#0x0B]
0x10400106 1040 ASRS r0,r0,#1
0x10400108 73C8 STRB r0,[r1,#0x0F]
0x1040010A 1040 ASRS r0,r0,#1
0x1040010C 0000 MOVS r0,r0

PhilYoung
Offline
Joined: 2011-07-18

Ok. The Errata says the IAP is not present on the flashless parts, so where do I find the device serial number?.

wellsk's picture
wellsk
Offline
Joined: 2011-05-17

Sorry, I can take a look at this on Monday in the office. I believe these values are directly or partially mapped in the OTP fuse block, but I don't have a board nearby to verify this..

Kevin Wells

NXP Semiconductors

Kevin Wells

NXP Semiconductors

PhilYoung
Offline
Joined: 2011-07-18

looks like it is mapped at 0x40045004, the user manual says reserved but from 2 boards this seems different.

wellsk's picture
wellsk
Offline
Joined: 2011-05-17

It looks like you can indirectly get these via the OTP registers if the IAP call can't be used in FLASH-less devices. The partial list is here is below with the ID1 and ID2 values and the devices they map to..

ID1 is read at address 0x40045000

ID2 is read at address 0x4004500C

ID1, ID2, Part numbers

0xF001D830, 0x00000000 /* LPC1857FET256/LPC1857FET180/LPC1857FBD208 */
0xF001D830, 0x00000044 /* LPC1853FET256/LPC1853FET180/LPC1853FBD208 */
0xF001DA30, 0x00000000 /* LPC1837FET256/LPC1837FET180/LPC1837FET100/LPC1837FBD144 */
0xF001DA30, 0x00000044 /* LPC1833FET256/LPC1833FET180/LPC1833FET100/LPC1833FBD144 */
/* 43xx variants with FLASH */
0xA001C830, 0x00000000 /* LPC4357FET256/LPC4357FET180/LPC4357FBD208 */
0xA001C830, 0x00000044 /* LPC4353FET256/LPC4353FET180/LPC4353FBD208 */
/* 18xx non-FLASH variants */
0xF0009830, 0x00000000 /* LPC1850FET256/LPC1850FET180/LPC1850FBD208 */
0xF0009A30, 0x00000000 /* LPC1830FET256/LPC1830FET180/LPC1830FET100/LPC1830FBD144 */
0xF00A9B3C, 0x00000000 /* LPC1820FET100/LPC1820FBD144/LPC1820FBD100 */
0xF00B1B3F, 0x00000000 /* LPC1810FET100/LPC1810FBD144 */

 

The above lists may not be complete...

Example: The NGX Xplorer 1830 board (memory dump below) has 0xF0009A30 for ID1 and 0x00000000 for ID2.

Kevin Wells

NXP Semiconductors

Kevin Wells

NXP Semiconductors

bigkahuna
Offline
Joined: 2012-09-26

I found this discussion useful as I have been using LPC1857FET256 in our product.

The issue is for this processor, 0x4004500C memory location contains 0x1EF40000 for the 1 boards that I have tested AND containted 0x0EF40000 for the other board.

Can you please post how to decode the 0x4004500C memory location? If it doesn't serve any purpose that purhaps it should be ignored.

PreviewAttachmentSize
LPC1857_ID2_Issue.png2.65 KB
VijayM
Offline
Joined: 2012-08-22

The above gives explanation about the part identification numbers according to Table 1037 of User Manual 10503. How we can read the Device serial number? Is there any way through which we can read the chip revision ("A" or "C" ) information?

feedback