Read Unique ID from PSoC5LP with PSoC Programmer (ppcli)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
immanuel
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

How can I read the unique id from PSoC 5LP devices within ppcli?

Refering to PSoC 5LP Registers TRM and according to code generated (CyLib.c and cydevice_trm.h the unique is stored at addresses like 0x4900 010x (with exception of CYREG_MLOGIC_REV_ID referring to 0x400046ec).

How can I retrieve these values for production purposes before flashing user code (i.e. without executing user code)?

I tried things like PSoC3_ReadRow 0x4900 0x0n 0x00 (n = 0..F) but the given results do not seem to contain right values.

Is there a function for reading data from random (existing) addresses in address space?

0 Likes
1 Solution
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @immanuel

I apologize for the delay in my response. I did get an update from the internal team. The issue with accessing these registers is because direct reads to these registers do not work if the device is acquired in Test Mode. So to read these memories the DAP registers need to reconfigured.

Here is the result of the CyGetUniqueId() API - 

Address Value
   
0x49000103 0x60
0x49000104 0x00
0x400046EC 0x02
0x49000102 0x19
0x49000101 0x15
0x49000100 0x20
0x49000105 0x05
0x49000106 0x93

 

The commands to read these registers are as follows - 

OpenPort "<port>" .
SetProtocol 8 
SetProtocolConnector 1 
SetProtocolClock 152 

JTAG_EnumerateDevices

DAP_WriteRaw 0x0 0x0000001E
DAP_WriteRaw 0x1 0x50000000
DAP_WriteRaw 0x2 0x00000000
DAP_WriteRaw 0x4 0x22000002

DAP_ReadIO 0x49000100
DAP_ReadIO 0x49000104
DAP_ReadIO 0x400046EC


After this, you can call the DAP_Acquire API again to acquire the device in Test Mode to program the device. Please note that this works only with SWD protocol. Please try this out and let me know if this works for you. Here are the PPCLI logs when I tried these APIs for your reference - 

Rakshith_0-1621449346753.png

Thanks and Regards,
Rakshith M B

View solution in original post

9 Replies
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @immanuel

You can use the DAP_ReadIO() API here. Please refer to the PSoC Programmer CLI User Guide for details regarding this API. 

Usage - 

Rakshith_0-1620069019964.png

Also, can you please let me know if you are referring to the JTAG ID or the Unique ID? How is Unique ID used in production programming?

Please note that PSoC Programmer and MiniProg3 device is not recommended for production programming. We suggest customers who need production programming support to consult our 3rd party programming vendors on our General Programming page or through our distribution partners: https://www.cypress.com/go/distributors 

Thanks and Regards,
Rakshith M B
0 Likes

Hi @Rakshith,

thanks for your quick response,

I tried DAP_ReadIO too, but the resulting values not seem right.

This is what I tried:

"c:\Program Files (x86)\Cypress\Programmer\ppcli" "--runfile script.cli"
command not found
1 OK
OpenPort "KitProg/08190A1C02179400" .
<
0 OK
SetAcquireMode "Reset"
<
0 OK
SetProtocol 8
<
1 OK
SetProtocolClock 224
<
0 OK
SetProtocolConnector 1
<
0 OK
SetPowerVoltage 5.0
<
0 OK
DAP_AcquireChip
<
0 OK
DAP_GetJtagID
<2e 10 60 69
0 OK
DAP_ReadIO 0x49000100
<0x2e106000
0 OK
DAP_ReadIO 0x49000101
<0x2e100000
0 OK
DAP_ReadIO 0x49000102
<0x2e000000
0 OK
DAP_ReadIO 0x49000103
<0x00000000
0 OK
DAP_ReadIO 0x49000104
<0x00000000
0 OK
DAP_ReadIO 0x49000105
<0x00000000
0 OK
DAP_ReadIO 0x49000106
<0x00000000
0 OK
DAP_ReadIO 0x49000107
<0x00000000
0 OK
PSoC3_DebugPortConfig 0
<
0 OK
PSoC3_ReadRow 0x4900 0x00 0x00
<00 80 00 20 11 00 00 00 99 15 00 00 99 15 00 00 08 b5 4f f0 40 23 d3 f8 fa 26 03 f5 40 53 c3 f8 bc 26 01 f0 c1 fa 00 00 08 00 02 23 00 00 08 76 08 00 03 23 00 00 10 76 08 00 04 23 00 00 30 76 05 00 05 23 00 00 20 70 05 00 06 23 00 00 30 70 05 00 fe 23 00 00 70 70 40 00 08 22 00 00 30 51 10 00 09 22 00 00 c0 51 10 00 fe 22 00 00 f0 51 80 05 0b 22 00 00 00 00 80 03 0c 22 00 00 00 06 80 00 0d 22 00 00 00 0a 00 04 0e 22 00 00 00 0c 80 01 0f 22 00 00 00 14 80 05 10 22 00 00 00 16 00 01 11 22 00 00 00 40 80 00 12 22 00 00 00 42 00 01 13 22 00 00 00 43 80 00 14 22 00 00 00 45 80 00 15 22 00 00 00 47 80 00 16 22 00 00 00 49 80 00 17 22 00 00 00 4c 80 00 18 22 00 00 00 4d 10 00 fe 22 00 00 10 50 80 00 1a 23 00 00 80 0a 10 00 1b 23 00 00 00 50 80 00 1c 23 00 00 80 4d
0 OK
PSoC3_ReadRow 0x4900 0x01 0x00
<80 00 1d 23 00 00 80 4c 80 00 1e 23 00 00 80 47 80 00 1f 23 00 00 00 46 80 00 20 23 00 00 80 46 80 00 21 23 00 00 80 45 80 00 22 23 00 00 00 44 80 00 23 23 00 00 80 44 80 00 24 23 00 00 80 1b 80 00 25 23 00 00 80 15 80 00 26 23 00 00 80 09 80 00 27 23 00 00 00 0b 80 00 28 23 00 00 80 0b 80 00 29 23 00 00 80 05 80 00 2a 23 00 00 80 49 80 00 2b 23 00 00 00 48 80 00 2c 23 00 00 80 48 80 00 2d 23 00 00 80 42 80 00 2e 23 00 00 00 41 80 00 fe 23 00 00 80 41 01 00 00 00 01 00 00 00 01 00 00 00 00 48 01 40 01 00 00 00 00 20 01 40 01 00 00 00 00 20 00 40 10 b5 05 4c 23 78 33 b9 04 4b 13 b1 04 48 af f3 00 80 01 23 23 70 10 bd 40 81 ff 1f 00 00 00 00 ec 16 00 00 08 b5 03 4b 1b b1 03 49 03 48 af f3 00 80 08 bd 00 00 00 00 44 81 ff 1f ec 16 00 00 70 b5 00 26 0c 4d 0d 4c
0 OK
PSoC3_ReadRow 0x4900 0x02 0x00
<64 1b a4 10 a6 42 09 d1 01 f0 ea fa 00 26 0a 4d 0a 4c 64 1b a4 10 a6 42 05 d1 70 bd 55 f8 04 3b 98 47 01 36 ee e7 55 f8 04 3b 98 47 01 36 f2 e7 ec 17 00 00 ec 17 00 00 ec 17 00 00 f4 17 00 00 38 b5 4f f4 80 43 1a 46 01 21 08 46 00 f0 a8 fb 04 46 00 f0 83 ff 05 46 04 23 ff 22 01 21 00 f0 9b ff 4f f4 b7 42 44 f6 10 61 28 46 00 f0 a8 ff 29 46 20 46 00 f0 44 ff 01 21 20 46 00 f0 f6 fe 38 bd 00 00 08 b5 00 f0 53 fd 00 f0 05 fc 00 f0 45 fb ff f7 d5 ff 00 f0 55 fb 00 21 08 46 00 f0 57 fd 10 48 00 f0 e8 fc 00 21 01 20 00 f0 50 fd 0d 48 00 f0 e1 fc 00 f0 81 fd 00 28 fb d0 0c 21 00 20 00 f0 45 fd 00 f0 45 fb 80 b2 00 f0 6c fd 0b 21 01 20 00 f0 3c fd 04 4b 93 f8 80 00 00 f0 53 fd e8 e7 f0 16 00 00 00 17 00 00 00 5b 00 40 08 b5 9d f8 08 e0 0e f1 ff 3c 5f fa 8c fc bc f1
0 OK
PSoC3_ReadRow 0x4900 0x03 0x00
<03 0f 55 d8 01 38 09 28 2e d8 df e8 00 f0 05 2d 2d 05 2d 2d 0f 19 2d 23 0f 2b 03 d9 26 48 00 7e 40 b2 22 e0 24 48 00 7f 40 b2 1e e0 0f 2b 03 d9 21 48 40 7e 40 b2 18 e0 1f 48 40 7f 40 b2 14 e0 0f 2b 03 d9 1c 48 80 7e 40 b2 0e e0 1a 48 80 7f 40 b2 0a e0 0f 2b 03 d9 17 48 c0 7e 40 b2 04 e0 15 48 c0 7f 40 b2 00 e0 00 20 01 eb 40 11 01 fb 02 f2 d1 0b c2 f3 cf 32 0d 2b 11 d8 c3 f1 0e 00 8a b2 02 41 92 b2 0e f1 ff 3c 59 1c 0b 48 00 eb 8c 03 99 70 0e f1 ff 33 08 49 21 f8 23 20 08 bd 0e f1 ff 33 05 49 01 eb 83 03 0f 21 99 70 f1 e7 00 20 00 f0 13 ff f2 e7 00 01 00 49 64 81 ff 1f 70 b5 06 46 01 f0 73 f9 05 46 11 4c 94 f8 f8 30 43 f0 03 03 84 f8 f8 30 94 f8 f9 30 43 f0 03 03 84 f8 f9 30 0b 4b 83 f8 92 60 03 20 00 f0 10 ff 94 f8 f8 30 03 f0 fc 03 84 f8 f8 30 94 f8 f9 30
0 OK
PSoC3_ReadRow 0x4900 0x04 0x00
<03 f0 fc 03 84 f8 f9 30 28 46 01 f0 54 f9 70 bd 00 46 00 40 00 58 00 40 2d e9 f0 41 04 46 b4 4b 00 22 1a 70 01 28 09 d0 02 2c 5a d0 03 2c 00 f0 b1 80 04 2c 00 f0 05 81 bd e8 f0 81 ad 4b 38 22 1a 70 04 22 9a 70 06 22 da 70 00 26 1e 71 5e 71 0f 22 9a 71 1e 72 5e 72 9e 72 01 27 1f 75 a6 4d 14 23 85 f8 84 30 09 23 85 f8 85 30 0a 23 85 f8 86 30 85 f8 87 60 11 22 85 f8 8a 20 12 22 85 f8 8b 20 85 f8 8c 70 85 f8 8e 60 85 f8 8f 60 85 f8 90 30 43 23 85 f8 91 30 44 20 ff f7 91 ff 58 23 85 f8 94 30 85 f8 95 60 05 23 85 f8 9a 30 02 23 85 f8 9b 30 85 f8 9c 60 85 f8 9d 60 30 46 00 f0 93 fc 8e 4b fa 22 1a 60 39 46 24 20 00 f0 b2 fc 39 46 95 20 00 f0 3e fd 89 49 1d 20 00 f0 a2 fe a2 e7 84 4b 38 22 1a 70 04 22 9a 70 07 22 da 70 00 27 1f 71 5f 71 3f 22 9a 71 1b 22 1a 72 71 22
0 OK
PSoC3_ReadRow 0x4900 0x05 0x00
<5a 72 9f 72 01 26 1e 75 7b 4d 50 23 85 f8 84 30 27 23 85 f8 85 30 2c 23 85 f8 86 30 85 f8 87 70 55 23 85 f8 8a 30 5a 23 85 f8 8b 30 4f f0 05 08 85 f8 8c 80 85 f8 8e 60 11 23 85 f8 8f 30 19 23 85 f8 90 30 97 23 85 f8 91 30 4c 20 ff f7 38 ff 58 23 85 f8 94 30 85 f8 95 70 85 f8 9a 80 85 f8 9b 60 85 f8 9c 70 0a 23 85 f8 9d 30 30 46 00 f0 3b fc 62 4b 4f f4 fa 42 1a 60 31 46 08 20 00 f0 59 fc 31 46 25 20 00 f0 e5 fc 5e 49 1d 20 00 f0 49 fe 4b e7 57 4b 38 22 1a 70 04 22 9a 70 06 22 da 70 00 26 1e 71 5e 71 3f 22 9a 71 1e 72 5e 72 9e 72 01 27 1f 75 50 4d 50 23 85 f8 84 30 27 23 85 f8 85 30 2c 23 85 f8 86 30 85 f8 87 60 55 23 85 f8 8a 30 5a 23 85 f8 8b 30 4f f0 05 08 85 f8 8c 80 85 f8 8e 70 11 23 85 f8 8f 30 19 23 85 f8 90 30 97 23 85 f8 91 30 44 20 ff f7 e1 fe 58 23
0 OK
PSoC3_ReadRow 0x4900 0x06 0x00
<85 f8 94 30 85 f8 95 60 85 f8 9a 80 02 23 85 f8 9b 30 85 f8 9c 60 85 f8 9d 60 30 46 00 f0 e4 fb 36 4b 4f f4 7a 42 1a 60 39 46 08 20 00 f0 02 fc 39 46 25 20 00 f0 8e fc 33 49 1d 20 00 f0 f2 fd f7 e6 2c 4b 38 22 1a 70 04 22 9a 70 06 22 da 70 00 25 1d 71 5d 71 3f 22 9a 71 1d 72 5d 72 9d 72 01 26 1e 75 24 4c 50 23 84 f8 84 30 27 23 84 f8 85 30 2c 23 84 f8 86 30 84 f8 87 50 55 23 84 f8 8a 30 5a 23 84 f8 8b 30 05 27 84 f8 8c 70 84 f8 8e 60 11 23 84 f8 8f 30 19 23 84 f8 90 30 97 23 84 f8 91 30 44 20 ff f7 8b fe 58 23 84 f8 94 30 84 f8 95 50 84 f8 9a 70 02 23 84 f8 9b 30 84 f8 9c 50 84 f8 9d 50 28 46 00 f0 8e fb 0b 4b 4f f4 7a 42 1a 60 31 46 08 20 00 f0 ac fb 31 46 25 20 00 f0 38 fc 09 49 1d 20 00 f0 9c fd a4 e6 00 bf 76 81 ff 1f 00 4e 00 40 00 58 00 40 5c 81 ff 1f
0 OK
PSoC3_ReadRow 0x4900 0x07 0x00
<99 09 00 00 9b 09 00 00 9d 09 00 00 9f 09 00 00 2d e9 f0 41 82 b0 37 4d 01 27 2f 70 00 24 36 4b 1c 70 10 20 00 f0 72 fb 10 20 00 f0 ff fb 07 21 1d 20 00 f0 8c fd 31 4b 4f f0 04 08 83 f8 96 80 83 f8 97 40 83 f8 9e 40 2d 4a d1 79 41 f0 18 01 d1 71 83 f8 93 40 82 f8 88 40 82 f8 89 40 0a 22 83 f8 80 20 83 f8 81 40 83 f8 83 40 12 22 83 f8 88 20 13 22 83 f8 89 20 83 f8 8d 40 21 4e 14 23 73 70 00 97 08 23 4f f4 00 42 48 f6 b6 51 20 46 ff f7 ae fd 02 23 00 93 10 23 4f f4 00 42 49 f2 da 01 38 46 ff f7 a4 fd 03 23 00 93 10 23 4f f4 00 42 49 f2 da 01 20 46 ff f7 9a fd cd f8 00 80 10 23 4f f4 00 42 49 f2 da 01 20 46 ff f7 90 fd 2b 78 01 3b 0c 4a 02 eb 83 03 9b 78 b3 73 2b 78 01 3b 32 f8 23 30 b3 81 28 78 ff f7 15 fe 02 b0 bd e8 f0 81 2c 81 ff 1f 60 81 ff 1f 00 58 00 40
0 OK
PSoC3_ReadRow 0x4900 0x08 0x00
<00 5b 00 40 00 4e 00 40 64 81 ff 1f 10 b5 00 f0 4e ff 04 46 3d 4b 1a 78 d2 b2 3d 4b 93 f8 aa 10 41 f0 01 01 83 f8 aa 10 93 f8 aa 10 41 f0 10 01 83 f8 aa 10 93 f8 ba 10 41 f0 01 01 83 f8 ba 10 93 f8 ba 10 41 f0 10 01 83 f8 ba 10 03 f5 40 73 93 f8 f8 10 41 f0 02 01 83 f8 f8 10 93 f8 f9 10 41 f0 02 01 83 f8 f9 10 2a 49 91 f8 91 30 43 f0 03 03 81 f8 91 30 02 2a 40 d0 03 20 00 f0 c8 fc 25 4b 93 f8 f8 20 02 f0 fd 02 83 f8 f8 20 93 f8 f9 20 02 f0 fd 02 83 f8 f9 20 03 f5 90 53 93 f8 77 20 42 f0 06 02 83 f8 77 20 7a 22 83 f8 82 20 a3 f5 a8 53 93 f8 a1 20 42 f0 01 02 83 f8 a1 20 93 f8 b1 20 42 f0 01 02 83 f8 b1 20 93 f8 a2 20 42 f0 01 02 83 f8 a2 20 93 f8 b2 20 42 f0 01 02 83 f8 b2 20 4f f0 e0 23 4f f0 00 52 c3 f8 80 22 c3 f8 00 21 20 46 00 f0 de fe 10 bd 91 f8 92 30
0 OK
PSoC3_ReadRow 0x4900 0x09 0x00
<43 f0 08 03 81 f8 92 30 b7 e7 00 bf 2c 81 ff 1f 00 43 00 40 00 58 00 40 00 46 00 40 08 b5 07 4b 1b 78 2b b9 06 4b 1b 78 2b b1 04 4b 01 22 1a 70 ff f7 6c ff 08 bd ff f7 eb fe f6 e7 74 81 ff 1f 75 81 ff 1f 02 4a 13 78 43 f0 01 03 13 70 70 47 00 4e 00 40 0d 4b 1b 7d 03 f0 03 02 13 f0 02 0f 0a d1 0a 4b 18 8a 80 b2 09 4b 1b 78 13 b1 09 4b 00 22 1a 70 00 b2 70 47 04 4b 18 7c 5b 7c 40 ea 03 20 03 2a f0 d1 01 4b 9b 7c ed e7 00 4e 00 40 76 81 ff 1f 60 81 ff 1f 70 47 70 47 70 47 70 47 70 b5 82 b0 15 46 1e 46 0b 4c 0a 23 23 70 00 22 01 92 00 92 0a 46 01 46 18 46 00 f0 ad fb 32 46 29 46 20 78 00 f0 80 fb 02 21 20 78 00 f0 6a fb 20 78 02 b0 70 bd 00 bf 2d 81 ff 1f 06 4b 93 f8 a8 20 42 f0 01 02 83 f8 a8 20 93 f8 b8 20 42 f0 01 02 83 f8 b8 20 70 47 00 43 00 40 07 4b 93 f8
0 OK
PSoC3_ReadRow 0x4900 0x0A 0x00
<20 20 02 f0 fd 02 83 f8 20 20 93 f8 20 20 00 f0 02 00 02 43 83 f8 20 20 70 47 00 bf 00 58 00 40 01 4b 83 f8 80 00 70 47 00 5b 00 40 06 4b 93 f8 20 30 c3 f3 81 03 03 f1 92 43 06 33 93 f8 20 31 db b2 02 4a 13 72 70 47 00 58 00 40 00 46 00 40 08 b5 08 4b 93 f8 20 20 02 f0 f3 02 83 f8 20 20 93 f8 20 20 00 f0 0c 00 02 43 83 f8 20 20 ff f7 dd ff 08 bd 00 58 00 40 10 b5 06 4b 00 24 83 f8 20 40 83 f8 21 40 20 46 ff f7 e2 ff 20 46 ff f7 b5 ff 10 bd 00 58 00 40 08 b5 07 4b 1b 78 2b b1 ff f7 9c ff 64 20 ff f7 bb ff 08 bd ff f7 e4 ff 01 4b 01 22 1a 70 f3 e7 77 81 ff 1f 10 b5 0f 4c 94 f8 20 20 02 f0 9f 02 84 f8 20 20 94 f8 20 20 02 f0 f0 02 84 f8 20 20 94 f8 20 30 03 43 43 f0 10 03 84 f8 20 30 01 20 00 f0 92 fb 94 f8 20 30 03 f0 ef 03 84 f8 20 30 10 bd 00 bf 00 51 00 40
0 OK
PSoC3_ReadRow 0x4900 0x0B 0x00
<38 b5 05 46 13 4c 94 f8 20 30 43 f0 20 03 84 f8 20 30 94 f8 20 30 03 f0 bf 03 84 f8 20 30 00 20 00 f0 76 fb 94 f8 20 30 03 f0 f0 03 84 f8 20 30 94 f8 20 30 43 ea 05 00 40 f0 10 00 84 f8 20 00 01 20 00 f0 65 fb 94 f8 20 30 03 f0 ef 03 84 f8 20 30 38 bd 00 51 00 40 70 b5 40 4b 93 f8 20 20 02 f0 80 02 83 f8 20 20 93 f8 22 20 02 f0 f0 02 42 f0 0f 02 83 f8 22 20 93 f8 23 20 02 f0 f0 02 83 f8 23 20 93 f8 24 20 02 f0 f0 02 83 f8 24 20 93 f8 20 20 02 f0 df 02 83 f8 20 20 93 f8 20 20 42 f0 40 02 83 f8 20 20 4f f4 ca 76 02 e0 01 3e 85 b3 7e b3 00 20 00 f0 2b fb 28 4c 94 f8 20 30 43 f0 10 03 84 f8 20 30 01 20 00 f0 21 fb 94 f8 21 50 ed b2 94 f8 20 30 03 f0 ef 03 84 f8 20 30 00 20 00 f0 15 fb 05 f0 08 05 94 f8 20 30 43 f0 10 03 84 f8 20 30 01 20 00 f0 0a fb 94 f8 20 30
0 OK
PSoC3_ReadRow 0x4900 0x0C 0x00
<03 f0 ef 03 84 f8 20 30 00 2d d0 d1 0a 20 00 f0 ff fa cc e7 11 4b 93 f8 20 20 02 f0 bf 02 83 f8 20 20 93 f8 20 20 02 f0 80 02 83 f8 20 20 93 f8 22 20 02 f0 f0 02 83 f8 22 20 93 f8 23 20 02 f0 f0 02 42 f0 0f 02 83 f8 23 20 93 f8 24 20 02 f0 f0 02 42 f0 0f 02 83 f8 24 20 70 bd 00 51 00 40 10 b5 04 46 ff f7 78 ff 20 09 ff f7 49 ff 04 f0 0f 00 ff f7 45 ff 10 bd 38 b5 05 46 00 78 01 24 04 e0 ff f7 ed ff 28 5d 01 34 e4 b2 00 28 f8 d1 38 bd 08 b5 ff f7 e4 ff 08 bd 10 b5 04 46 ff f7 5b ff 20 09 ff f7 0a ff 04 f0 0f 00 ff f7 06 ff 10 bd 08 b5 28 20 00 f0 93 fa 03 20 ff f7 fe fe 05 20 00 f0 8d fa 03 20 ff f7 f8 fe 0f 20 00 f0 87 fa 03 20 ff f7 f2 fe 01 20 00 f0 81 fa 02 20 ff f7 ec fe 05 20 00 f0 7b fa 06 20 ff f7 d5 ff 0e 20 ff f7 d2 ff 2c 20 ff f7 cf ff 08 20 ff f7
0 OK
PSoC3_ReadRow 0x4900 0x0D 0x00
<cc ff 01 20 ff f7 c9 ff 0c 20 ff f7 c6 ff 03 20 ff f7 c3 ff 05 20 00 f0 63 fa 08 bd 08 b5 0c 20 ff f7 bb ff 01 4b 01 22 1a 70 08 bd 78 81 ff 1f 08 b5 06 4b 1b 78 13 b1 ff f7 f0 ff 08 bd ff f7 b8 ff 02 4b 01 22 1a 70 f6 e7 00 bf 79 81 ff 1f 08 b5 03 28 07 d8 df e8 00 f0 02 07 0c 11 81 f0 80 00 ff f7 9a ff 08 bd 40 39 c8 b2 ff f7 95 ff f9 e7 6c 39 c8 b2 ff f7 90 ff f4 e7 2c 39 c8 b2 ff f7 8b ff ef e7 00 00 38 b5 04 46 03 09 05 4d e8 5c ff f7 7e ff 04 f0 0f 04 28 5d ff f7 79 ff 38 bd 00 bf 0c 17 00 00 10 b5 04 46 00 0a ff f7 eb ff e0 b2 ff f7 e8 ff 10 bd 00 00 01 4b 93 f8 6b 00 70 47 00 64 00 40 10 b5 00 24 04 e0 20 46 00 f0 60 fb 01 34 e4 b2 01 2c f8 d9 01 4b ff 22 1a 70 10 bd 2e 81 ff 1f 10 b5 04 46 ff f7 ec ff 20 46 00 f0 3f fb 01 4b 1c 70 10 bd 2e 81 ff 1f
0 OK
PSoC3_ReadRow 0x4900 0x0E 0x00
<4f f0 40 23 b3 f8 80 00 80 b2 70 47 4f f0 40 22 92 f8 82 30 00 f0 f8 00 40 b2 03 43 db b2 82 f8 82 30 70 47 4f f0 40 23 93 f8 82 00 00 f0 07 00 70 47 00 00 70 b5 04 46 0e 46 ff f7 f3 ff 05 46 ff f7 de ff a0 42 5a d0 34 4b 93 f8 a2 30 03 f0 01 02 c5 b9 00 b1 b4 b9 50 b9 4f f0 40 23 a3 f8 80 40 93 f8 82 20 02 f0 bf 02 83 f8 82 20 46 e0 4f f0 40 23 93 f8 82 20 42 f0 40 02 83 f8 82 20 a3 f8 80 40 3b e0 32 b3 4f f0 40 23 00 21 59 70 01 25 1d 74 19 75 19 7a 01 f0 7f 01 19 72 93 f8 82 30 13 f0 08 0f 00 d0 ac b9 4f f0 40 23 58 80 07 21 59 70 4f f0 40 23 5b 78 13 f0 01 0f f9 d1 16 49 91 f8 a2 30 03 f0 fe 03 81 f8 a2 30 4f f0 40 23 00 21 59 70 11 4b 93 f8 a2 30 13 f0 01 0f 10 d0 4f f0 40 23 5c 80 56 b1 03 22 4f f0 40 23 5a 70 4f f0 40 23 5b 78 13 f0 01 0f f9 d1 70 bd
0 OK
PSoC3_ReadRow 0x4900 0x0F 0x00
<01 22 f3 e7 4f f0 40 23 a3 f8 80 40 03 49 91 f8 a2 30 13 43 81 f8 a2 30 f1 e7 00 bf 00 43 00 40 01 4b 18 88 80 b2 70 47 00 41 00 40 04 4a 93 78 00 f0 f8 00 40 b2 03 43 db b2 93 70 70 47 00 bf 00 41 00 40 02 4b 98 78 00 f0 07 00 70 47 00 bf 00 41 00 40 70 b5 04 46 0e 46 ff f7 f3 ff 05 46 ff f7 de ff a0 42 53 d0 2f 4b 93 f8 a1 30 03 f0 01 02 85 b9 00 b1 74 b9 30 b9 2c 4b 1c 80 9a 78 02 f0 bf 02 9a 70 43 e0 28 4b 9a 78 42 f0 40 02 9a 70 1c 80 3c e0 3a b3 4f f0 40 23 00 21 59 70 01 25 1d 75 19 74 19 7a 01 f0 7f 01 19 72 03 f5 80 73 9b 78 13 f0 08 0f 00 d0 ac b9 4f f0 40 23 58 80 07 21 59 70 4f f0 40 23 5b 78 13 f0 01 0f f9 d1 15 49 91 f8 a1 30 03 f0 fe 03 81 f8 a1 30 4f f0 40 23 00 21 59 70 0f 4b 93 f8 a1 30 13 f0 01 0f 10 d0 4f f0 40 23 5c 80 56 b1 03 22 4f f0
0 OK
PSoC3_ReadRow 0x4900 0x10 0x00
<40 23 5a 70 4f f0 40 23 5b 78 13 f0 01 0f f9 d1 70 bd 01 22 f3 e7 05 4b 1c 80 03 49 91 f8 a1 30 13 43 81 f8 a1 30 f3 e7 00 43 00 40 00 41 00 40 7f 23 0c 4a 13 70 0c 4a 80 21 11 70 07 e0 da 00 02 f1 80 42 02 f5 f0 42 01 3b db b2 13 70 00 2b f5 d1 db 00 03 f1 80 43 03 f5 f0 43 00 22 1a 70 70 47 00 bf 30 81 ff 1f 2f 81 ff 1f 17 28 15 d8 69 b1 03 01 0a 49 5a 5c 42 f0 20 02 5a 54 00 01 07 4a 83 5c 43 f0 01 03 83 54 00 20 70 47 03 01 03 49 5a 5c 02 f0 df 02 5a 54 f0 e7 01 20 70 47 10 70 00 40 17 28 0b d8 00 01 06 4a 83 5c 03 f0 f1 03 49 00 01 f0 0e 01 19 43 81 54 00 20 70 47 01 20 70 47 10 70 00 40 41 f6 ff 73 99 42 0e d0 41 f6 ff 73 9a 42 0d d0 17 28 0e d8 c0 00 00 f1 80 40 00 f5 ec 40 81 80 c2 80 00 20 70 47 4f f4 00 51 ed e7 4f f4 00 52 ee e7 01 20 70 47 00 00
0 OK
quit
<OK
<OK

c:\Projekte\programm-psoc

The ID I need to know is the Unique ID. We use them for address purposes of electronic modules idetified by unique psoc id.

I know about better programmers for production. 

Thank you for your advice,

Immanuel

0 Likes

Hello.

I know you are using ppcli.  But, I would first retrieve the correct values (as a test at your lab bench) using API, CyGetUniqueId(uint32* uniqueId).  There's a thread with example code to print the UniqueID through UART.
https://community.cypress.com/t5/PSoC-5-3-1-MCU/PSoC-UUID/td-p/155436

That thread also refers to KBA229815.

Then, knowing the correct values (a good starting point), work on implementing ppcli commands.

I suppose you could also view UniqueID values via debugger, but that sometimes throws me off dealing with MSB/LSB byte ordering.

I suspect you already know all this.  Just ignore my rambling.

BTW, are you using Miniprog or Kitprog?

0 Likes

Hello @BiBi_1928986

thanks for your answer.

I use CyGetUniqueId(uint32* uniqueId) in the project to be flashed later. But flashing - and executing - the code is not yet done at this point so I have to retrieve the unique id from within the PSoC Programmer.

My idea was using the programming interface to retreive the ID without the need to connect the UART for this.

At the moment the programmer I can use is the KitProg (Fw. 2.21 or similar).

I also thought about using OpenOCD  for programming and readout but was not successful until now.

 

 

0 Likes

Hello.

I tried Kitprog from KIT-059 (2.21), and had the same incorrect results as you did.  I used:
DAP_ReadIO 0x49000100
swdior 0x49000100
DAP_PoolIO 0x49000100 0x15 2000    Note: 0x15 was for my PSoC.
None of the above produced the correct value at 0x49000100.
PSoC Programmer 3.28.0
ppcli ref doc rev T

However, those commands produced the correct result at 0x400046EC (RevID).  So, the commands work, just not at the 0x4900010x locations.

I printed the values read using CyGetUniqueId(uint32* uniqueId), and then entered the Debugger to verify those memory locations.  They matched.

I suspect we are missing something.

Why can the Debugger show the correct contents of 0x4900010x but not when read from ppcli?  That's some thing only Cypress can answer.

0 Likes

Hello,

That is what i suspect too. Code execution (by calling CyGetUniqueId) as well as debugger funtionality gets the excepted values.

Maybe there is a prerequisite that is not satisfied when using DAP_ReadIO from within ppcli. The value shown in screen dump in your answer, @Rakshith, seems to be a possible one. 

Am I missing a command in  advance? Some kind of memory mapping or enable?

B.t.w. @Rakshith, did you wrote the Python_Ex.py for using the COM interface? I used that succesfully for flashing PSoCs after modifying for python3x. But I though could not read the memory areas containing the unique id.

 
 

 

 

0 Likes
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @immanuel@BiBi_1928986

I am able to recreate the issue. Only the registers that contain the unique ID give out erroneous values when read using the DAP_ReadIO API. I have requested the internal team for help regarding this. I will add a response on this thread as soon as I get an update from the team. 

Thanks and Regards,
Rakshith M B
0 Likes

Hello @Rakshith,

that sounds promising. I am looking forward to hear about an update.

Thank you.

Immanuel

0 Likes
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @immanuel

I apologize for the delay in my response. I did get an update from the internal team. The issue with accessing these registers is because direct reads to these registers do not work if the device is acquired in Test Mode. So to read these memories the DAP registers need to reconfigured.

Here is the result of the CyGetUniqueId() API - 

Address Value
   
0x49000103 0x60
0x49000104 0x00
0x400046EC 0x02
0x49000102 0x19
0x49000101 0x15
0x49000100 0x20
0x49000105 0x05
0x49000106 0x93

 

The commands to read these registers are as follows - 

OpenPort "<port>" .
SetProtocol 8 
SetProtocolConnector 1 
SetProtocolClock 152 

JTAG_EnumerateDevices

DAP_WriteRaw 0x0 0x0000001E
DAP_WriteRaw 0x1 0x50000000
DAP_WriteRaw 0x2 0x00000000
DAP_WriteRaw 0x4 0x22000002

DAP_ReadIO 0x49000100
DAP_ReadIO 0x49000104
DAP_ReadIO 0x400046EC


After this, you can call the DAP_Acquire API again to acquire the device in Test Mode to program the device. Please note that this works only with SWD protocol. Please try this out and let me know if this works for you. Here are the PPCLI logs when I tried these APIs for your reference - 

Rakshith_0-1621449346753.png

Thanks and Regards,
Rakshith M B