DA14585.sleepmode code get stuck after OTP

⚠️
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 athttps://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
39 posts / 0 new
最后一篇
MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
DA14585.sleepmode code get stuck after OTP

Hello Dialog Team,

我正在为我的项目使用定制板。

This project has a pressure sensor that sends manchester coded data every 30sec through gpio. My dialog chip decodes the data and loads it in the advertisement string. I have a battery attached for powering up my circuit. I am enabling sleep to save battery life.

I have done the following so far. Since we are developing our custom hardware, I did the following changes to the example (ble_app_sleepmode) program as follows.

1)根据我们的user_periph_setup.h中的原理图改变了LED端口和按钮引脚

2)将#define cfg_lp_clk lp_clk_xxtal32更改为#define cfg_lp_clk lp_clk_rcx20在da1458x_config_advanced.h中,因为我们没有32khz外部水晶。

3) Changed #define CFG_XTAL16M_ADAPTIVE_SETTLING to #undef CFG_XTAL16M_ADAPTIVE_SETTLING because of point 2.

4) #undef CFG_CODE_LOCATION_EXT and #define CFG_CODE_LOCATION_OTP in da1458x_config_advanced.h

I have successfully debugged the project with my 585devkit and it ran without any problems. I am facing the following problems now. Since my debug session is running properly I have planned to do the OTP. After I did the OTP, the program doesnt run for a long time. It runs for a while and then halts I think. No idea why.

Regards,

Mark

Device:
MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
I am attaching the project

I am attaching the project folder also.

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi kuda,

Hi kuda,

Thanks for your question.

>>>> I am facing the following problems now. Since my debug session is running properly I have planned to do the OTP.

你的意思是你有调试器附着吗?如果是,则防止系统进入睡眠模式。您是否完全确定您的应用程序在我们的DK中运行?

In case of your custom board, did you try to run you application in debug mode? For example, did you try to download fw to System-RAM?

谢谢,PM_DIALOG.

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

Yes. I downloaded the code to sys-RAM and it worked perfectly without any problems.

在向OTP下载代码后,我断开了调试器。我卸下了电池并将其插入。它运行几分钟,然后陷入困境。

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi MarkDsylva_2277

Hi MarkDsylva_2277

Can you please export and share the OTP Header that you are using?

谢谢,PM_DIALOG.

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

如何导出OTP标题?

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi MarkDsylva_2277

Hi MarkDsylva_2277

From the SmartSnippets Toolbox. You need to connect to the OTP Header and export it to file.

谢谢,PM_DIALOG.

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

读书时我会得到很多错误。

我正在附加日志。

Regards,

Mark

附件:
MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
嗨pm_dialog,

嗨pm_dialog,

我设法得到了标题。它附在这里。

Regards,

Mark

附件:
MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

Please update me on the status as I am waiting for your reply for further development in my project.

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi Mark,

Hi Mark,

Both application flags are set to “Yes” which is correct. What the package are you using? WLCSP34, QFN40 or QFN48 ? I the OTP header you have selected the QFN40. Additionally, the clock source is selected to the external Crystal oscillator, but in your initial post you are using the interval RCX. What changes have you done in the OTP Header? Have you burnt the “Device and Package” and ”Sleep Clock Source” or it is the default configuration?

>>>After I downloaded the code to OTP, I disconnected the debugger. I removed the battery and inserted it back. It runs for a few minutes and then it gets stuck.

Since it is running for a few minutes, this means that the device is booting correctly from the OTP. Probably the issue might be related to the SW. Does the device advertise and stops suddenly? Are you able to connect it with a peer device?

谢谢,PM_DIALOG.

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

---> What the package are you using? WLCSP34, QFN40 or QFN48 ? I the OTP header you have selected the QFN40.

Yes it is QFN40.

----> Additionally, the clock source is selected to the external Crystal oscillator, but in your initial post you are using the interval RCX. What changes have you done in the OTP Header? Have you burnt the “Device and Package” and ”Sleep Clock Source” or it is the default configuration?

I have an external crystal connected. But for low power crystal selection I dont have a 32Khz external crystal connected to my dialog chip. So I changed it from #define CFG_LP_CLK LP_CLK_XTAL32 to #define CFG_LP_CLK LP_CLK_RCX20. I didnt change anything else in the header. I only changed the application flags to Yes.

----> Since it is running for a few minutes, this means that the device is booting correctly from the OTP. Probably the issue might be related to the SW. Does the device advertise and stops suddenly? Are you able to connect it with a peer device?

The devices runs for a few minutes and when it wakes up from sleep its stops. The running time of the application varies a lot. Somtimes it stops in 2 mins or it may take 15mins also. Since my project is related to advertisement only, I didnt connect it with a peer device. If the issue is related to software, Why hasnt it occured during debugging?.

-----------------------------------------------------------------------------------------------------------------------------------------------------

- >我最大的疑问是,如果应用程序中有一个错误,为什么它运行一段时间,然后停止。

-> I have a mobile app that logs the advertisement data with system time. As per my project, the advertisement interval is 150ms and it is done for 5 seconds after which advertisement stops. As per my log, the chip wakes up and stops in between those 5 seconds time before advertisement stops.

- >我还从您的网站上的在线教程读取,应从RWIP.c.中评论以下行。如果不使用32kHz外部乳房

// DA14585 / 586不支持Boost Mode + RCX
if(getBits16(ANA_Status_reg,Boost_selected)== 1)

ASSERT_WARNING(0);

I didnt try commenting this because I dont have many chips left with me as we are in lockdown due to Covid-19. My code ran in debug for more than a week straight. After I did OTP I started facing problems. Please support me on this as it is very urgent.

--------------------------------------------------------------------------------------------------

It would be better if you can guide me on certain aspects because I am using a custom board and I simply cant waste chips after finding out bugs after doing the OTP. I will be asked question from my mangement on how many chips will u waste for this?.

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi Mark,

Hi Mark,

You mentioned that you tested your project in development mode. Please keep in mind that when the debugger is attached, this prevents the system to go into sleep mode. Have you ever tested without the debugger attached?

Portably your issue is related with the waking up from sleep mode.

For example, if you download the same FW into the Sys-Ram (without the debugger attached) or into SPI Flash, is that running correctly?

Regarding the OTP Header seems to be correct. If the OTP Header and the OTP Image were not burnt correctly, the device will not be able to boot! In your case, the DA14585 is booting correctly and starts advertising.

谢谢,PM_DIALOG.

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

——>你提到你测试项目development mode. Please keep in mind that when the debugger is attached, this prevents the system to go into sleep mode. Have you ever tested without the debugger attached?

I tried to start the debug session from keil and stopped the debug session by pressing the same debug button. The code didnt run.

正如我在上面的帖子中所说,我认为代码挂在广告过程中间的某处(即在广告间隔之间醒来和睡觉)。我的代码位于user_sleepmode.c文件中,在那里我正在处理外部中断和数据解码。收到数据后,我启动广告并设置APP_EASY_TIMER 5秒钟......之后我停止广告。在我之间,我没有任何东西。我怎么检查代码挂起的地方?有任何想法吗?

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi Mark,

Hi Mark,

So the problem is related to the SW. Let’s try to investigate what might be the root cause. If you run the application code in your custom board with the debugger attached, does it stop anywhere? If yes, can you please share a screenshot where it gets stuck? Is the watchdog enabled ore disabled?

谢谢,PM_DIALOG.

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

--> No. The code doesnt stop anywhere. It runs without any problems.

- >我已经禁用了看门狗。

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi Mark,

Hi Mark,

Can you please run it with the WDOG enabled? Now, if you run it in debug mode, does the code stuck anywhere? Please define the CFG_WDOG macro and run it again.

谢谢,PM_DIALOG.

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi Mark,

Hi Mark,

Additionally what is the SDk that you are using? I am unable to build the provided example code in our SDK.

谢谢,PM_DIALOG.

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

The SDK I am using is 6.0.12

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi Mark,

Hi Mark,

My suggestion would be to have the WDOG enabled and run the code in debug mode. Additionally, please enable the CFG_DEVELOPMENT_DEBUG flag. This allows you to hot attach debugger and get debug information if a hardfault or NMI is occurred. So, with these 2 macros enabled, does is get stuck anywhere when ruining it in debug mode? Additionallym there is no need to bunt the OTP in order to debug it - just download the firmware into the System-RAM through the Keil IDE.

In the meanwhile, I will try to run the attached project in our development boards.

谢谢,PM_DIALOG.

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

I did as you said.

I #defined both the macros and uploaded the code by pressing the debug button and then pressed the same button again. The code got stuck again.

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi Mark,

Hi Mark,

它被困在哪里?你能分享截图吗?

谢谢,PM_DIALOG.

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

我已断开调试器。所以我无法看到它被困的地方。

But when I run with the debugger attached, the code runs properly.

------------------------------------------------------------------------------------

我在明天完成项目的截止日期,因为代码在广告间隔之间被卡住,我正在考虑通过将假到ARCH_SET_EXTEDDE_SLEEP(FALSE)将FALST删除广告间隔之间的OTP复制睡眠,并更改静态const sleep_state_t app_default_sleep_mode= ARCH_EXT_SLEEP_ON ...

这将解决我的问题吗?

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi Mark,

Hi Mark,

I have run your attached project with the CFG_WDOG and the CFG_DEVELOPMENT_DEBUG macros defined. I am working on an QFN40 daughter board and our new Pro-DK motherboard. In order to use the on-board button to wake-up the device, I am using the P1_1 for the LED.

在调试模式下运行代码时,卡住in GPIO_SetPinFunction() in gpio.c file in the following line.

__asm(“bkpt#0 \ n”);//此PIN尚未保留!

在user_periph_setup.c中,您正在配置所有GPIO以输入下拉。这不需要,因为默认状态是input_pulldown。您可以轻松阅读GPIO寄存器以澄清它。此外,这种代码的平安重新配置了不推荐的所有GPIO。

Also, in the user_sleepmode.c files you are using a GPIO which is never reserved!

请在您在代码中找到的修改附加了一个diff文件。使用该修改,我能够在我们的DKS中运行项目。

The OTP stand for One Time Programmable, so you should make sure that your project is totally running before burning it!

In development stage, it is recommended to have the WDOG and the development debug enabled, Otherwise, if the code gets stuck somewhere you will be never notified for this! In conclusion, burning the OTP image and OTP header requires that the application code is running 100%. Otherwise, the chip will never boot form OTP!

What is the package of DA14585 that you are using?

谢谢,PM_DIALOG.

附件:
MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

Ok. I will do as you said.

I am using a QFN40 package.

Will GPIO reservation problems cause the code to hang after doing OTP?.

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
既然你正在运行

既然你正在运行project in debug mode, you should have the CFG_DEVELOPMENT_DEBUG defined. This allows you to simulate the OPT mirroring from the OTP to System-RAM.

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
I would suggest to run the

I would suggest to run the project in out DK. Is it running correctly?

如果是,则使用您的自定义板并将FW下载到系统RAM中。请确保OTP为空。这是100%的工作吗?

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

I took a fresh copy of sleepmode example from your skd and tried to download it to the ram in the 585 daughter board. I didnt modify anything in any of the code. When I pressed the debug button and started the code it immediately got stopped at the nmi_handler. Will your example code work as such without modification in the 585 daughter board?.

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
嗨,马克,请downoload

HI MARK,请先将FW降至RAM - 现在工作吗?

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi Mark, can you please

Hi Mark, can you please indicate which DK are you using? Which daughter board and which mother board? yes, the example is working correctly..

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi,

Hi,

套件是da14580devkt-p_vc

Daughter board is DA14585.

Regards

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
嗨,Mark,是的ble_app

嗨Mark,是的BLE_APP_SLEEPMODE在此板中正确运行。我可以在我身边跑。是否有可能与跳线配置共享一个phote?

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi,

Hi,

Photos are attached.

Regards,

Mark

附件:
PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
嗨马克,刚测试了ble

嗨Mark,刚刚在我们的DK上测试了BLE_APP_SLEEPMODE示例 - 我正在使用与您和相同的跳线配置相同的DK。你有备用DK吗?我也建议在干净的SDK目录上工作。此外,通过修改我昨天分享了您,我能够在我们的DK中运行您的项目......您是否在为DA14585构建项目?谢谢,PM_DIALOG.

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

--->你有备用DK是否测试它?

No. I dont have one.

--> I'd suggest to worki on a clean SDK directory as well.

I extracted the sdk folder from the 6.0.12.1020.2.zip file and opened the ble_app_sleepmode project and built it and started the debug session. I didnt modify anything else inside. But I am facing the same issue. I have attached the screenshot.

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
嗨,马克,你能跑吗?

嗨,马克,你能跑吗?any of the other SDK project? For example, the ble_app_barebone. All the SDK examples are running in our DKs out-of-the-box and as provided by the SDK. In this specific device, have you burnt the OTP?

MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20

Hi,

我无法运行任何BLE示例。我尝试了眨眼项目。它的工作正常。

Regards,

Mark

PM_DIALOG.
Offline
最后一次露面:1 day 11 hours ago
职员
加入:2018-02-08 11:03
Hi Mark,

Hi Mark,

请找到我的跳线配置。所有BLE示例都按预期运行。在BLE_APP_SLEEPMODE的情况下,我能够使用附加配置运行它。所以请尝试将SDK解压缩到一个新文件夹中,再次尝试。我建议有一个简短的SDK路径 - 可能在C:\下解压缩。如果它没有再次运行,可能会损坏。您是否在该设备中写了OTP?

谢谢,PM_DIALOG.

附件:
MarkDsylva_2277
Offline
最后一次露面:3 months 1 week ago
加入:2019-06-19 04:20

Hi PM_Dialog,

I tried as you said.

1) I took out a fresh copy of the SDK and created a folder in D drive. I ran the sleepmode example without modifiying anything. As soon as I started the debug session it got stuck at the nmi handler.

2) I connected the smart snippets tool and checked reading the OTP memory. It read only zeros.

Regards,

Mark