Read OTP field in DA14585

Learn MoreFAQsTutorials

4 posts / 0 new
Last post
dlo
Offline
Last seen:2 days 23 hours ago
加入:2017-05-26 16:21
Read OTP field in DA14585

I am trying to migrate an old DA14580 project to the DA14585:

The old code:

int cnt = 100000;
SetBits16(CLK_AMBA_REG, OTP_ENABLE, 1); // enable OTP clock
while ((GetWord16(ANA_STATUS_REG) & LDO_OTP_OK) != LDO_OTP_OK && cnt--)
// set OTP in read mode
SetWord32(OTPC_MODE_REG, 0x1);
uint8_t *otp_major = (uint8_t *)0x47F54;
uint8_t *otp_minor = (uint8_t *)0x47F56;
memcpy(&user_beacon_config.major_ALT_val1, otp_major, 2);
memcpy(&user_beacon_config.minor_ALT_val2, otp_minor, 2);
SetBits16(CLK_AMBA_REG, OTP_ENABLE, 0); //disable OTP clock

The new code:

int cnt = 100000;
SetBits16(CLK_AMBA_REG, OTP_ENABLE, 1); // enable OTP clock
while ((GetWord16(ANA_STATUS_REG) & LDO_VDD_OK) != LDO_VDD_OK && cnt--)
// set OTP in read mode
SetWord32(OTPC_MODE_REG, 0x1);
uint8_t *otp_major = (uint8_t *)0x47F54;
uint8_t *otp_minor = (uint8_t *)0x47F56;
memcpy (&beacon_data[主要],otp_major, 2);
memcpy(&beacon_data[MINOR], otp_minor, 2);
SetBits16(CLK_AMBA_REG, OTP_ENABLE, 0); //disable OTP clock

Is it correct to use LDO_VDD_OK instead of LDO_OTP_OK?

I think the DA14585 has a larger OTP size, does the memory location still works ok?

Thank you

Device:
PM_Dialog
Offline
Last seen:5 hours 52 min ago
工作人员
加入:2018-02-08 11:03
Hi dlo,

Hi dlo,

if I undestood correctly, you are trying to port an existing application based on DA14580 and SDK5.0.4 to DA14585 and SDK6.0.14. Is my understanding correct?

According to datasheets:

DA14585 : ANA_STATUS_REG [LDO_VDD_OK] : Indicates that LDO_VDD is in regulation

DA14580 : ANA_STATUS_REG [LDO_OTP_OK] : Indicates that LDO_OTP is in regulation

So, I assume that it might not be a problem.

In case of DA14585, please see datasheet and section 9 Memory Map. The OTP starts from 0x07F80000 and ends to 0x07F8FFFF.

Please also check out theUM-B-082: DA14585 & DA14586 SDK6 Porting Guideuser guide.

Hope it is helpful!

Thanks, PM_Dialog

dlo
Offline
Last seen:2 days 23 hours ago
加入:2017-05-26 16:21
Thank you PM!

Thank you PM!

I have been consulting the UM-B-082. I did miss the OTP start and end from the datasheet, and will go back to review it. Thank you!

PM_Dialog
Offline
Last seen:5 hours 52 min ago
工作人员
加入:2018-02-08 11:03
Hi dlo,

Hi dlo,

Thanks for accepting my answer. If you have any follwo-up question please create a new forum post.

Thanks, PM_Dialog