⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
dlo
Offline
Last seen:6 days 2 hours ago
加入:2017-05-26 16:21
OTP定制数据读

I'm trying to read OTP memory with the following 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 *)0x47F58;
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

I've written data to the OTP address 7F54: 6C 7F55: 00 7F56: 00 7F57: 00 7F58: 00 using the PLT

but it seems when the program is running, it's not grabbing the data correctly. My advertisement strings show both major and minor to be 0.

Alternatively to test this, can I just write the custom data field with values I want and leave the rest of the OTP header fields intact for programming at a later time? Field such as 32kHz field selection, BD Address, etc...?

Device:
PM_Dialog
Offline
Last seen:21 hours 17 min ago
Staff
加入:2018-02-08 11:03
Hi dlo,

Hi dlo,

我对你的工作issue and I will get back to you shortly.

Thanks, PM_Dialog

dlo
Offline
Last seen:6 days 2 hours ago
加入:2017-05-26 16:21
Hi PM_Dialog,

Hi PM_Dialog,

I think I got it sorted out, thanks for the support!

PM_Dialog
Offline
Last seen:21 hours 17 min ago
Staff
加入:2018-02-08 11:03
Hi dlo,

Hi dlo,

Glad that you figured your issue out.

Thanks, PM_Dialog