DA14695 FreeRTOS blinky example freezes

⚠️
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.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
13 posts / 0 new
Last post
ZephraimMcKladden
Offline
Last seen:5 months 1 week ago
Joined:2020-08-18 21:31
DA14695 FreeRTOS blinky example freezes

I'm still using the DA14695 USB-DevKit and modified the pxp_reporter example, where I modified main.c and replaced pxp_reporter_task.c with blinker_task.c, which you can see here:

https://gist.github.com/tetrodoxin/34c8a2ef9af80b0d3e30c4d213b5ca40

When I build an flash it, I can start it and the LED blinks, for about 4 seconds, then the program seems to freeze, and the LED stays in one state, depending on the used timer delay.

Also, the callOS_TASK_DELETE(OS_GET_CURRENT_TASK());in system_init() never returns. I don't know, if this is connected, but I also don't know where to look for the problem.

Any suggestions? Thanks in advance!

Device:
PM_Dialog
Offline
Last seen:3 hours 48 min ago
Staff
Joined:2018-02-08 11:03
Hi ZephraimMcKladden,

Hi ZephraimMcKladden,

Could you please run it in debug mode and specify where it freezes?

Thanks, PM_Dialog

ZephraimMcKladden
Offline
Last seen:5 months 1 week ago
Joined:2020-08-18 21:31
Unfortunately not.

Unfortunately not.
As I described in this topic:
https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...

I'm currently not able to run my projects in DebugMode on my 14695 USB-Kit (not Pro-DK).

And as I altered the timer delay value, I observed, that it's not a matter of how many executions, but a matter of time (about 4sec) till it freezes.

ZephraimMcKladden
Offline
Last seen:5 months 1 week ago
Joined:2020-08-18 21:31
And regarding my second

And regarding my second question:
Is it maybe normal, that any code afterOS_TASK_DELETE(OS_GET_CURRENT_TASK());is never executed, because that call ends the current task completely?

ZephraimMcKladden
Offline
Last seen:5 months 1 week ago
Joined:2020-08-18 21:31
Meanwhile I found out:

Meanwhile I found out:
基于pxp_reporter作为我的例子是,有一个lot of BLE stuff in it. If I rewrite the original pxp_reporter to always blink the LED, that works. If I remove the BLE functions step by step it ends with the function ble_enable(), if I remove that, the freezing occurs after some seconds. So... maybe the device goes into some kind of sleep, which is prevented by the BLE functions??? Possible?

PM_Dialog
Offline
Last seen:3 hours 48 min ago
Staff
Joined:2018-02-08 11:03
Hi ZephraimMcKladden,

Hi ZephraimMcKladden,

Not sure what the steps you have done, but glad that you go it working. Yes, the pxp_reporter project of the SDK uses sleep mode by default – please check pm_sleep_mode_set(pm_mode_extended_sleep); in the system_init(). When the system is in any of the available sleep mode, all the peripheral domains are powered down.

Thanks, PM_Dialog

ZephraimMcKladden
Offline
Last seen:5 months 1 week ago
Joined:2020-08-18 21:31
I also tried to use pm_sleep

I also tried to use pm_sleep_mode_set(pm_active) but the "freeze" still occurs.

What triggers the power down?
And how is BLE-Manager preventing it?
Does an GPIO Pin still be powered on, even in extended sleep mode?

PM_Dialog
Offline
Last seen:3 hours 48 min ago
Staff
Joined:2018-02-08 11:03
Hi ZephraimMcKladden,

Hi ZephraimMcKladden,

延迟道歉。你能请注明w吗here the code freezes?

Thanks, PM_Dialog

ZephraimMcKladden
Offline
Last seen:5 months 1 week ago
Joined:2020-08-18 21:31
As I said:

As I said:
It's not a special piece of code, where it freezes, it's the time.

Therefore I guess, it's entering sleep mode. Is there any way I can totally disable sleep mode?

PM_Dialog
Offline
Last seen:3 hours 48 min ago
Staff
Joined:2018-02-08 11:03
Hi ZephraimMcKladden,

Hi ZephraimMcKladden,

Still I am not able to understand what you mean with this : “It's not a special piece of code, where it freezes, it's the time.”

Normally, if you attach the debug ger, you should be able to check where is freezes. Is it a WDOG expiration? Assertion? NMI?

To disable the sleep mode, you should call pm_sleep_mode_set(pm_active).

Thanks, PM_Dialog

ZephraimMcKladden
Offline
Last seen:5 months 1 week ago
Joined:2020-08-18 21:31
What I mean is:

What I mean is:

I have a timer set and a task, waiting to be notified by that timer (OS_TASK_NOTIFY_WAIT after sys_watchdog_suspend). After being notified, all the loop does is toggling the green LED. Now, if I change the timer intervall, that loop might run 20 times (for short intervals) or only 2 times (for long intervals), but in total, the LED never blinks longer than 5 seconds.

Hence, I conclude, that it is not a single point/step/command/function call in the code, that causes the sleep. I guess, the device is just going into sleep mode after a certain time (4-5 seconds).

I triedpm_sleep_mode_set(pm_mode_active);inside the system_init task (as this is a FreeRTOS project) but this doesn't seem to have any effect.

And as I wrote further above, if I use function ble_enable() and thus enable the Bluetooth functionality, that seems to prevent the sleep. But is that meant to be the only way to keep the 1469x awake?

What am I missing here?

ZephraimMcKladden
Offline
Last seen:5 months 1 week ago
Joined:2020-08-18 21:31
Meanwhile I found, if I run

Meanwhile I found, if I run the example in Debug Mode, it doesn't go to sleep, thus my observed "freeze" does not occur.

Here, the used example was the freertos_retarget project from the SDK. I still have no clue, how to prevent sleep mode, when using FreeRTOS. Again:pm_sleep_mode_set(pm_mode_active);does nothing.

PM_Dialog
Offline
Last seen:3 hours 48 min ago
Staff
Joined:2018-02-08 11:03
Hi ZephraimMcKladden,

Hi ZephraimMcKladden,

How did you check that it doesn’t got into sleep?

Thanks, PM_Dialog