DA14585 sleepmode code get stuck after OTP

⚠️
你好。。谢谢你来参加论坛。令人兴奋的消息!我们现在正在移动到我们的新论坛平台,将提供更好的功能,并包含在主对话网站的过程。所有帖子和账号都已迁移。我们现在只接受新论坛上的流量-请在//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
39个职位/0个新职位
Last post
马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20
DA14585 sleepmode code get stuck after OTP

你好,对话小组,

I am using a custom board for my project.

这个项目有一个压力传感器,通过gpio每30秒发送一次曼彻斯特编码的数据。我的对话芯片解码的数据和加载到广告字符串。我有一个电池,用来给我的电路通电。我正在启用睡眠以节省电池寿命。

到目前为止,我已经做了以下工作。由于我们正在开发自定义硬件,我对示例(ble\u app\u sleepmode)程序做了如下更改。

1) Changed the led port and button pin as per our schematic in user_periph_setup.h

2) Changed #define CFG_LP_CLK LP_CLK_XTAL32 to #define CFG_LP_CLK LP_CLK_RCX20 in da1458x_config_advanced.h, since we dont have a 32Khz external crystal.

3) 由于第2点,将#define CFG_XTAL16M_ADAPTIVE_setting更改为#undef CFG_XTAL16M_ADAPTIVE_setting。

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

我已经成功地用我的585devkit调试了这个项目,它运行起来没有任何问题。我现在面临以下问题。因为我的调试会话运行正常,所以我计划执行OTP。在我做了OTP之后,这个程序很长时间都没有运行。它跑了一会儿,然后停了下来。不知道为什么。

Regards,

Mark

Device:
马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20
I am attaching the project

I am attaching the project folder also.

Attachment:
PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
你好,库达,

你好,库达,

谢谢你的问题。

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

Do you mean that you have the debugger attached? If yes, this prevents the system to go into sleep mode. Are you completely sure that your application is running in our DK?

对于自定义板,是否尝试在调试模式下运行应用程序?例如,您是否尝试将固件下载到系统RAM?

Thanks, PM_Dialog

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined: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.

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.

Regards,

Mark

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
你好,MarkDsylva\u 2277

你好,MarkDsylva\u 2277

您能导出并共享您正在使用的OTP头文件吗?

Thanks, PM_DIalog

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

How to export OTP header?

Regards,

Mark

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
你好,MarkDsylva\u 2277

你好,MarkDsylva\u 2277

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

Thanks, PM_Dialog

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

I am getting a lot of errors while reading.

I am attaching the log.

Regards,

Mark

Attachment:
马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20
Hi PM_dialog,

Hi PM_dialog,

I managed to get the header. Its attached here.

Regards,

Mark

Attachment:
马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined: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
离线
Last seen:9小时14分钟前
Staff
Joined: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?

Thanks, PM_Dialog

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined: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.

是的,是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?

这些设备运行几分钟,当它从睡眠中醒来时就会停止。应用程序的运行时间变化很大。有时2分钟内停止,也可能需要15分钟。因为我的项目只与广告有关,所以我没有将它与对等设备连接。如果问题与软件有关,为什么在调试过程中没有发生?。

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

-> My biggest doubt is, if there is a bug in the application, why does it run for a certain amount of time and then stops.

->我有一个移动应用程序,用系统时间记录广告数据。根据我的项目,广告间隔是150毫秒,它是5秒后,广告停止做。根据我的日志,芯片会在广告停止前的5秒钟内唤醒并停止。

-> I also read from a online tutorial in your website, that the following line should be commented from rwip.c. if not using 32Khz external crstal

// Boost mode + RCX is not supported in DA14585/586
if (GetBits16(ANA_STATUS_REG, BOOST_SELECTED) == 1)

断言警告(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
离线
Last seen:9小时14分钟前
Staff
Joined: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.

Thanks, PM_Dialog

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined: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.

As I had said in the above post, I think the code hangs somewhere in the middle of the advertisement process (ie Waking up and sleeping between advertisemnt intervals). My code is in the user_sleepmode.c file, where I am handling the external interrupt and data decoding. After I receive the data, I start the advertisement and set an app_easy_timer for 5 seconds....after which I stop the advertisement. In between I dont have anything. How am I to check where the code hangs?. Any ideas?

Regards,

Mark

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined: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?

Thanks, PM_Dialog

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

-->不,代码不会停在任何地方。它运行起来没有任何问题。

--> I have disabled the watchdog.

Regards,

Mark

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
Hi Mark,

Hi Mark,

你能在启用WDOG的情况下运行它吗?现在,如果在调试模式下运行它,代码是否会卡在任何地方?请定义CFG\u WDOG宏并再次运行。

Thanks, PM_Dialog

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined: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.

Thanks, PM_Dialog

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

我使用的SDK是6.0.12

Regards,

Mark

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
Hi Mark,

Hi Mark,

我的建议是启用WDOG并以调试模式运行代码。另外,请启用CFG\u DEVELOPMENT\u DEBUG标志。这允许您热连接调试器,并在发生硬故障或NMI时获取调试信息。那么,启用这两个宏后,在调试模式下破坏它时,它是否会卡在任何地方?另外,没有必要为了调试而bunt OTP,只需通过keilide将固件下载到系统RAM中即可。

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

Thanks, PM_Dialog

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined: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
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
Hi Mark,

Hi Mark,

Where it gets stuck? Can you please share a screenshoot?

Thanks, PM_Dialog

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

I have disconnected the debugger. So I am not able to see where its getting stuck.

但是,当我在附加了调试器的情况下运行时,代码运行正常。

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

I am having a deadline to complete the project by tomorrow, and since the code is getting stuck between advertisement intervals, I am thinking of removing the otp copy sleep between advertisement intervals by passsing false to arch_set_extended_sleep(false) and changing the static const sleep_state_t app_default_sleep_mode = ARCH_EXT_SLEEP_ON...

Will this solve my issue for time being?.

Regards,

Mark

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
Hi Mark,

Hi Mark,

我已经用定义的CFG\u WDOG和CFG\u DEVELOPMENT\u DEBUG宏运行了您所附的项目。我在QFN40子板和我们的新的亲DK主板工作。为了使用板上按钮唤醒设备,我使用P1ï1作为LED。

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

__asm("BKPT #0\n"); // this pin has not been previously reserved!

In user_periph_setup.c you are configuring all the GPIOs to input pull down. This is not need as the default state is INPUT_PULLDOWN. You can easily read the GPIOs registers to clarify it. Additionally this peace of code reconfigures all the GPIOs which is not recommend.

另外,在user\u sleepmode.c文件中,您使用的是从未保留的GPIO!

Please find attached a diff file with the modifications I did in your code. With that modifications I am able to run your project in our 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!

您使用的DA14585软件包是什么?

Thanks, PM_Dialog

Attachment:
马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

Ok. I will do as you said.

我使用的是QFN40软件包。

GPIO保留问题是否会导致代码在执行OTP后挂起?。

Regards,

Mark

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
Since you are running the

因为您是在调试模式下运行项目,所以应该定义CFG\u DEVELOPMENT\u debug。这允许您模拟从OTP到系统RAM的OPT镜像。

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined: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?

If yes, then use your custom board and download the FW into System-RAM. Please make sure that OTP is empty. Is that working 100%?

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined: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
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
嗨,马克,请放下行李

嗨,马克,请放下行李fw into RAM first - is that working now?

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
嗨,马克,你能帮我吗

嗨,马克,你能帮我吗indicate which DK are you using? Which daughter board and which mother board? yes, the example is working correctly..

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20
你好,

你好,

Kit is DA14580DevKT-P_VC

Daughter board is DA14585.

Regards

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
Hi Mark, Yes the ble_app

Hi Mark, Yes the ble_app_sleepmode is runnign correctly in this board. I can run it in my side. Would it be possible to share a phote with the jumpers configuration?

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20
你好,

你好,

Photos are attached.

Regards,

Mark

Attachment:
PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
Hi Mark, Just tested the ble

嗨,马克,只是测试了ble_app_sleepmode例子on our DK - I am using the same DK with you and the same jumper configuration. Do you have any spare DK to test it? I'd suggest to worki on a clean SDK directory as well. Additionally, with the modification i had shared you yesterday, I am able to run your project in our DK... Are you building the project for DA14585? Thanks, PM_Dialog

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

--->Do you have any spare DK to test it?

No. I dont have one.

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

我从6.0.12.1020.2.zip文件中提取了sdk文件夹,打开ble\u app\u sleepmode项目并构建它并启动调试会话。我没有修改里面的任何东西。但我也面临同样的问题。我附上了截图。

Regards,

Mark

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
Hi Mark, are you able to run

Hi Mark, are you able to run 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?

马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20

你好,

I am not able to run any ble examples. I tried the blinky project. It worked fine.

Regards,

Mark

PM_Dialog
离线
Last seen:9小时14分钟前
Staff
Joined:2018-02-08 11:03
Hi Mark,

Hi Mark,

Please find attached my jumper configuration. All the BLE examples are running as expected. In case of ble_app_sleepmode, I am able to run it with the attached configuration. So please, try to unzip the SDK into a new folder and give again a try. I would suggest to have a short SDK path – probably unzip in under the C:\ . If it Is not running again, probably the board is damaged. Have you written the OTP in that device?

Thanks, PM_Dialog

Attachment:
马尔基尔瓦2277
离线
Last seen:3个月1周前
Joined:2019-06-19 04:20

Hi PM_Dialog,

I tried as you said.

1) 我拿出一个新的SDK副本,在D驱动器中创建了一个文件夹。我运行了睡眠模式的例子,没有修改任何东西。我一开始调试会话,它就卡在了nmi处理程序上。

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

Regards,

Mark