Hello
I am willing to put my device into extended sleep thanks to idle task of free_rtos. Up to now I am facing some issues.
My code is based on sample code from Dialog. The system is booting, freertos is starting, tasks are being loaded properly.
我正在在主要任务中运行一个循环,我确实闪烁了LED以检查系统是否存在并执行1秒睡眠。
I can trace the system until WFI is being executed properly. At that time breath timer is switched-off and led shut down.
At the exit of the WFI, breath timer does not wake-up.
目前呼吸呼吸呼吸_cfg,hw_led_set_ledx_src(...),hw_breath_init(&approze_cfg);和hw_breath_enable();都位于Prvsetuphardware。如果我在periph_init中放置其中任何一个,即使在活动或空闲模式下也没有LED亮起。
你能告诉我吗?
- 呼吸计时器的初始顺序是什么?
- 休眠期间保留呼吸定时器寄存器?
- 呼吸计时器状态和依赖项是由当前固件管理的吗?
What are the steps to debug such case ?
Thank you in advance
Best Regards
关键词:
Device:
Hi,
我可以知道哪个示例代码是基于的代码,以及您的修改是什么?您是否正在实现用于为外部LED进行自动呼吸功能的功能?
For breathing function of LED, below code shows a example:
呼吸_config config = {
.dc_min = dc_min,
.dc_max = dc_max,
.dc_step = dc_step,
.freq_div = freq_div,
.polarity = hw_breath_pwm_pol_pos.
};
/ *
*Setup breath timer configuration, so hardware can drive LED automatically.
*/
hw_breath_init(&config);
/ *
*Setup LED1 output to be driven by timer.
*/
hw_led_set_led1_src(hw_led_src1_breath);
hw_led_enable_led1(true);
/ *
*然后开始呼吸计时器。
*/
hw_breath_enable();
More details could be found in the peripherals_demo of the SDK.
Hello
My code is based on freertos_retarget source code.
我正准确使用你给了我
static void prvSetupHardware(void)
{
//激活中断
....
breath_config breath_cfg = {
/ /光功率.dc_min = 9日- 1
.dc_max = 10,//灯功率设置为10/255
.dc_step = 255,
.freq_div = 255,
.polarity = hw_breath_pwm_pol_pos.
};
/ *Init hardware (OTPC, Cache, ADC, DCDC, USB Pads, RF, adapters, buses, devices, watchdog) */
PM_SYSTEM_INIT(PERIPH_INIT);
// init中断控制器
hw_wkup_init(&wkup_cfg);
// configure LED1, Red
hw_led_set_led1_src(hw_led_src1_breath);
hw_led_enable_led1(false);
// configure LED2, Green
hw_led_set_led2_src(HW_LED_SRC2_BREATH);
hw_led_enable_led2(真实);
//配置LED3,蓝色
hw_led_set_led3_src(HW_LED_SRC3_BREATH);
hw_led_enable_led3(false);
// configure Breath Timer required for RGB Led
hw_breath_init(&breath_cfg);
hw_breath_enable();
}
如果我在Periph_Init中放置了以前的代码,则没有LED亮起。
After wake-up from extended_sleep led stay off.
Thank you in advance
它似乎比LED更深。
Before sleep : 0x50000066=0x3 after WFI and after pm_system_wake_up 0x50000066=0x2.
Datasheet point out secure boot (I am testing production mode with watchdog in use but with no secure boot yet).
其他提示0x500030D0 = 0睡前,0x500030d0 = 1睡眠。唤醒后,似乎此功能不会正确恢复。
下一个提示是睡眠前的0x50000022 = 0x54b7,睡眠后0x54b6。RC16在延长睡眠期间停止,而不是在它之后再次启动。DCDC依靠它在运营期间被杀死。(0x5000002A = 0x20D2睡眠后:1V8和1V8P下)
I tried to put the system in dg_configUSE_DCDC = 0 to stop using DCDC.
结果,睡眠前后0x50000022 = 0xe7d3。睡觉后我没有更多的撞车。
但我仍然没有领导
新提示。LED_CONTROL_REG is being erased by sys_tcs. If y do set my led sources in periph_init, they are then erased by sys_tcs at boot and at wake-up.
我不是使用OTP,为什么这个寄存器将是Sys_tcs在这2次上唯一的一个?
在查看UM-B-044附录H的同时,似乎在生产过程中正在使用LED_CONTROL_REG。
您能否在DA14683上运行的Freertos_Retarget示例代码查看此功能?
到目前为止我不能使用睡眠模式。能量对我的产品至关重要。
Thank you
Hi Bob,
您可以尝试在使用睡眠模式的SDK的任何一个BLE示例中实现它吗?您如何测试设备无法入睡?还有,这是您在Periph_init中的配置?
谢谢,PM_DIALOG.
Hello
我没有时间使用我的原型使用。BSP现在非常大,所以这种集成已经搬走,因为蓝牙不在我们最低可行的产品中。
Periph_Init目前只有GPIOS / OUT配置,GPIO高/低,在执行期间固定,现在呼吸计时器初始化。
我设法延长了睡眠工作:
- 禁用DCDC
- >你能告诉我为什么RC16在睡眠期间停止,而不是重新开始?
- by removing sys_tcs from the power management.
- >您能否向我确认如何使用重置值(0x80)停止从OTP重新加载LED_CONTROL_REG?(在定制板上的DA14683,OTP从未使用过)
- 通过移动呼吸计时器init / config在periph_init中
--> LED are shut-down during sleep. As a result I can only use LED during execution time.
- 在主任务中使用一个简单的循环
If I do load more code than the main loop I do get various crashes / troubles:
- 如果我使用hw_i2c
--> hard fault. (I need to move to ad_i2c to have it reload controler status after wake-up).
- If the UART receives data while the CPU is about to sleep or is sleeping (I think external modem sends clock update)
- >在UART中断处理程序中断,位于hw_uart_int_busy_detected。我可以看到代码中的rbr_thr_dll相关的注释。如果你在这里有任何想法,我会很高兴。
- UART遗漏了与外部调制解调器的一些通信,因此我的应用程序不会正确行事。
- >我确实在这里需要硬件流量,但我的硬件不太好。如果您对UART的硬件流控制有异步通信的参考实现,我会很高兴。我目前在与外部调制解调器通信时,我目前在线程中调用ad_uart_read等待数据,但似乎它似乎错过了一些字节。
Probably more troubles are to come with the sleep feature. Up to now I cannot use it in a reliable way.
Thank you in advance
Hello
我将我的代码从HW_I2C移动到AD_I2C。我在这方面没有更多的问题。
在UART方面,
- 我在睡眠期间为我的外部调制解调器提供了禁用的级别移位器,以便在睡眠期间没有消息。这不会改变任何东西。
- 我使用了JTAG探针来检查该休息的上下文。似乎这个问题与UART控制台有关,因为我的代码不使用异步通信,因此在UART上没有生成IRQ,我用来与我的外部调制解调器通信。我得到的唯一IRQ来自控制台服务。
你能解决以下问题吗?
- RC16 / DCDC shutdown after wake-up
- sys_tcs reloading values from OTP while no OTP is used
- console service interrupt ending in __BRK
Thank you in advance
Hi Bob,
对不起,但我很困惑。我强烈建议您不要修改SDK文件。HW_I2C是低级驱动器(LLD),AD_I2C是I2C的适配器。我强烈建议使用适配器E建议使用适配器来访问硬件外围设备,因为不仅提供对外围设备的访问权限,还要确保当前访问它的其他任务,直到外围设备暂停其操作再次发布。因此,如果另一个任务在同一时间访问相同的外围设备,则不必担心。此外,在睡眠模式下,所有外围块都断电。
谢谢,PM_DIALOG.
Hello
你能看看以下几点吗?
1. console service generating uart interrupt ending in __BRK. This issue happens as soon as I do activate extended sleep.
硬盘分析:
- LR指向UART_INTRUPT_HANDLER(HW_UART1),用于控制台服务。
- 在void uart_interrupt_handler(HW_UART_ID UART)中,PC点到CONFIG_UART_IGNORE_BUSY_DETECT案例
I tried using no dma config for uart. no change.
2. sys_tcs reloading values from OTP while no OTP is used. This issue is to be solved to avoid modifying BSP files.
- 查看我以前的分析。我可以使用LED_CONTROL_REG的JTAG探测器弄清楚LED_CONTROL_REG是由SYS_TCS_APPLED(TCS_SYSTEM)重新加载的唯一寄存器;功能。重新加载值为0x80。它清除了我的LED的保留状态。
3.唤醒后RC16 / DCDC关闭。LDO可以执行作业,直到延长睡眠可以与DCDC一起使用。
在这里,我只看到睡眠前/睡眠前/后RC16位进入零,永远不会返回到1.在DS V3.1规范中,第6章,DCDC依赖于RC16,因此唤醒后它不能还活着。
Thank you in advance
Hello
New hard fault: I get a new one in ad_gpadc_read() after sleep occured. I checked the GPADC registers and they are in reset state.
Can you confirm that
- 睡眠模式后,所有适配器都已测试?
- 我可以在构造函数中有适配器“打开”功能?
- I do not need to call "open" again during normal operations. (this include after wake-up) ?
Thank you in advance
嗨鲍勃,
我真的很困惑你所做的变化。
My recommendation would be to readUM-B-044: DA1468x Software Platform Reference和UM-B-056:DA1468X软件开发人员指南in order to understand the SDK architecture. You can also find “Adapter” example in the “Tutorial” section in DA1468x support portal.
谢谢,PM_DIALOG.
Hello
Can you launch freertos_retaget, light up a led and activate extended_sleep on a DA14683 (with printf/console redirected to a uart, dcdc and dma enabled) ?
- 睡眠前LED_CONTROL_REG的值是多少?之后?
- 睡眠前RC16使能位的值是多少?之后?DCDC还活着吗?
Thank you for your advice of reading the manual but it looks like bugs in the SDK and I would be pleased that you check it on your side. I am getting hard faults from the board support package.
Thank you
Hello
Good news. I finally managed to get the sleep feature working without crash.
由于在保留LDO上,我正在击中3.3V的BOD。
在激活闪光灯1V8关闭功能后,事情可以正常,从而卸载3V3 RET LDO。
Bad news n°1. The system stop sleeping after several minutes. No identified fault yet.
坏消息N°2。如果我能启用外部外围设备,我仍然会击中3v3的bod。
您是否知道3.3V RET LDO的电力预算是什么时候在延长睡眠时(请不要回答10ma有很多附加的东西)?
我在1V8P和300μA上有1.2mA,3V3理论绝对最大值,但是当睡眠启用时,我会击中BOD并最终通过电源复位。
Thank you
Hello
I finally managed to solve last issues
- I had to manually drive the switch to extended_sleep at a moment where I know nothing is happening on the system (and on the console !). I also had to manage a manual switch to idle mode to avoid small sleeps during normal operations (like sleeping while waiting for an adapter event).
- 我不得不在VBAT上升起高达20μF的电容器,以避免3V3上的BOD(唤醒时的电流峰值,使VBAT下降)。
- 一个外围的一个外围设备在1V8P上消耗高达8mA,同时处于完整的关闭模式。10MA预算不好!我不得不在操作后重置它,使其在睡觉时消耗少。
- The system was not waking-up sleeping tasks without pm_set_wakeup_mode(true) activated. Without it I ended stuck after sleep with a system stable but doing nothing.
在该旅程结束时,睡眠模式似乎在工作但是
- 由于sys_tcs_apply(tcs_system),我不再重新加载来自Power Manager的OTP值;PeripH_Init执行后重新加载LED_CONTROL_REG。
I am asking again for help at least on the OTP issue so I can release a version without modifying boad support package files.
Thank you