DA14585 sleepmode code get stuck after OTP

Learn MoreFAQsTutorials

39帖子/ 0新
Last post
markdsylva_2277.
离线
Last seen:1 week 4 days ago
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_APP_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_settling更改为#undef cfg_xtal16m_adaptive_settling。

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

我已成功使用585devkit调试项目,而且没有任何问题。我现在面临以下问题。由于我的调试会话正常运行,我计划执行OTP。在我做了OTP之后,程序不会运行很长时间。它运行了一段时间,然后暂停停止。不知道为什么。

Regards,

Mark

Device:
markdsylva_2277.
离线
Last seen:1 week 4 days ago
Joined:2019-06-19 04:20
I am attaching the project

I am attaching the project folder also.

Attachment:
PM_Dialog
离线
Last seen:4 hours 51 min ago
Staff
Joined:2018-02-08 11:03
嗨Kuda,

嗨Kuda,

谢谢你的问题。

>>>>我现在正面临以下问题。由于我的调试会话正常运行,我计划执行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?

如果您的定制板,您是否尝试在调试模式下运行您的应用程序?例如,您是否尝试将FW下载到System-RAM?

Thanks, PM_Dialog

markdsylva_2277.
离线
Last seen:1 week 4 days ago
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:4 hours 51 min ago
Staff
Joined:2018-02-08 11:03
hi markdsylva_2277.

hi markdsylva_2277.

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

Thanks, PM_DIalog

markdsylva_2277.
离线
Last seen:1 week 4 days ago
Joined:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

How to export OTP header?

Regards,

Mark

PM_Dialog
离线
Last seen:4 hours 51 min ago
Staff
Joined: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.

Thanks, PM_Dialog

markdsylva_2277.
离线
Last seen:1 week 4 days ago
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:
markdsylva_2277.
离线
Last seen:1 week 4 days ago
Joined:2019-06-19 04:20
Hi PM_dialog,

Hi PM_dialog,

I managed to get the header. Its attached here.

Regards,

Mark

Attachment:
markdsylva_2277.
离线
Last seen:1 week 4 days ago
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:4 hours 51 min ago
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

markdsylva_2277.
离线
Last seen:1 week 4 days ago
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.

——>,因为它运行几分钟,这个问题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?

这些设备运行几分钟,当它从睡眠停止时醒来。应用程序的运行时间变化很大。Somtips它在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.

- >我有一个移动应用程序,用系统时间记录广告数据。根据我的项目,广告间隔是150ms,它在广告停止后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)

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
离线
Last seen:4 hours 51 min ago
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

markdsylva_2277.
离线
Last seen:1 week 4 days ago
Joined:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

--->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?

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:4 hours 51 min ago
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

markdsylva_2277.
离线
Last seen:1 week 4 days ago
Joined:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

- >否。代码不停止任何地方。它没有任何问题。

--> I have disabled the watchdog.

Regards,

Mark

PM_Dialog
离线
Last seen:4 hours 51 min ago
Staff
Joined:2018-02-08 11:03
Hi Mark,

Hi Mark,

您能用WDOG运行它吗?现在,如果在调试模式下运行它,代码在任何地方粘在一起?请定义CFG_WDOG宏并再次运行它。

Thanks, PM_Dialog

PM_Dialog
离线
Last seen:4 hours 51 min ago
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

markdsylva_2277.
离线
Last seen:1 week 4 days ago
Joined:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

我使用的SDK是6.0.12

Regards,

Mark

PM_Dialog
离线
Last seen:4 hours 51 min ago
Staff
Joined:2018-02-08 11:03
Hi Mark,

Hi Mark,

我的建议是将启用WDOG并在调试模式下运行代码。此外,请启用CFG_Development_debug标志。这允许您热连接调试器,并且如果发生硬盘或NMI,则获取调试信息。所以,通过启用这2个宏,在调试模式下毁了它时会粘在任何地方?另外,不需要禁止OTP才能调试它 - 只需将固件下载到系统内通过Keil IDE。

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

Thanks, PM_Dialog

markdsylva_2277.
离线
Last seen:1 week 4 days ago
Joined:2019-06-19 04:20
Hi PM_Dialog,

Hi PM_Dialog,

I did as you said.

我#定义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:4 hours 51 min ago
Staff
Joined:2018-02-08 11:03
Hi Mark,

Hi Mark,

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

Thanks, PM_Dialog

markdsylva_2277.
离线
Last seen:1 week 4 days ago
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:4 hours 51 min ago
Staff
Joined:2018-02-08 11:03
Hi Mark,

Hi Mark,

我已经使用CFG_Wdog和CFG_Development_debug宏运行附加项目。我正在研究一个QFN40女儿板和我们的新款Pro-DK主板。为了使用板载按钮唤醒设备,我正在使用LED的P1_1。

在调试模式下运行代码时,它会在以下行中的GPIO.C文件中陷入GPIO_SETPINFUNCTION()。

__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_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:
markdsylva_2277.
离线
Last seen:1 week 4 days ago
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:4 hours 51 min ago
Staff
Joined:2018-02-08 11:03
Since you are running the

由于您在调试模式下运行项目,因此您应该定义CFG_Development_debug。这允许您模拟从OTP到系统RAM的OPT镜像。

PM_Dialog
离线
Last seen:4 hours 51 min ago
Staff
Joined:2018-02-08 11:03
我建议运行

我建议运行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%?

markdsylva_2277.
离线
Last seen:1 week 4 days ago
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:4 hours 51 min ago
Staff
Joined:2018-02-08 11:03
Hi Mark, please downoload the

Hi Mark, please downoload the fw into RAM first - is that working now?

PM_Dialog
离线
Last seen:4 hours 51 min ago
Staff
Joined: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.
离线
Last seen:1 week 4 days ago
Joined:2019-06-19 04:20
你好,

你好,

Kit is DA14580DevKT-P_VC

Daughter board is DA14585.

Regards

PM_Dialog
离线
Last seen:4 hours 51 min ago
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?

markdsylva_2277.
离线
Last seen:1 week 4 days ago
Joined:2019-06-19 04:20
你好,

你好,

Photos are attached.

Regards,

Mark

Attachment:
PM_Dialog
离线
Last seen:4 hours 51 min ago
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

markdsylva_2277.
离线
Last seen:1 week 4 days ago
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_APP_SLEEPMODE项目并建立并启动调试会话。我没有修改里面的任何东西。但我面临着同样的问题。我附上了截图。

Regards,

Mark

PM_Dialog
离线
Last seen:4 hours 51 min ago
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?

markdsylva_2277.
离线
Last seen:1 week 4 days ago
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:4 hours 51 min ago
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:
markdsylva_2277.
离线
Last seen:1 week 4 days ago
Joined:2019-06-19 04:20

Hi PM_Dialog,

I tried as you said.

1)我拍出了SDK的新鲜副本,并在D驱动器中创建了一个文件夹。我在没有修改任何内容的情况下运行sleepMode示例。一旦我开始调试会话,它就被困在NMI处理程序。

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

Regards,

Mark