UART醒来后不起作用

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
8 posts / 0 new
最后一篇
Diogenes.
离线
最后一次露面:2 years 6 months ago
加入:2018-10-04 05:09
UART醒来后不起作用

嗨对话框,

现在我遇到了一个问题,唤醒后不起作用。
Referring to ble_app_sleepmode sample project, I added UART receive interrupt handler.
作为示例项目,我写下唤醒回调如下。

static void enable_Wakeup_cb(void)
{
if(GetBits16(SYS_STAT_REG, PER_IS_DOWN))
{
GPIO_init();
periph_init();
}
setbits32(gp_control_reg,ble_wakeup_req,1);
if(arch_ble_ext_wakeup_get())
{
ARCH_SET_SLEEP_MODE(app_default_sleep_mode);
arch_ble_force_wakeup();
ARCH_BLE_EXT_WAKEUP_OFF();
app_easy_wakeup();
}
}

但是,有时不会出现UART接收中断。
唤醒中断和GPIO INT正常工作,但UART接收INT。
我觉得UART初始化需要比GPIO更多的时间,所以我插入了几秒钟定时器等待和Periph_init()再次等待。
但结果是一样的。
你能告诉我唤醒后挪威启动UART的条件吗?

Thanks,
Diogenes.

Device:
PM_DIALOG.
离线
最后一次露面:10 hours 34 min ago
职员
加入:2018-02-08 11:03
Hi diogenes,

Hi diogenes,

在BLE_APP_SLEEP模式示例中,APP_ADV_DATA_UPDATE_TO的到期后,设备进入深度休眠模式(默认值为10秒),因此所有外设都会关闭电源。这意味着您无法在设备唤醒时具有UART活动。如果芯片被唤醒,您能否确保您正在尝试使用UART?此外,如果您试图解释一下您想要完成的东西,那将是非常有帮助的。当您在UART中发送数据时,您想唤醒您的设备,还是您想在芯片被唤醒以后有UART活动?如果您希望实现第一个选项,请注意,为了唤醒,您应该激活WKUP控制器,否则芯片将继续入住睡眠模式。另外,你能澄清你在努力的uart吗?在BLE_APP_SLEEPMODE示例中,仅实现UART2,可以通过将放入DA1458X_CONFIG_BASIC.H的CFG_PRINTF宏来激活您可以激活

谢谢,PM_DIALOG.

Diogenes.
离线
最后一次露面:2 years 6 months ago
加入:2018-10-04 05:09
嗨对话框,

嗨对话框,

感谢您的评论。
至于APP_ADV_DATA_UPDATE_TO,我改为1毫秒and my program is to UART receive interrupt after wake-up.
我通过示波器测量了定时,并且我检查了UART接收的定时在唤醒后至少超过10msec发生。
但是没有检测到UART接收中断,我想象UART接收中断本身将工作,因为它在几秒钟后被检测到。
So I'd know how many seconds is neede to enable UART receive interrupt.
当然,UART接收中断并在我的程序中发送正常工作。
So how should I do to enable UART receive interrupt after wake-up?

Thanks,
Diogenes.

Diogenes.
离线
最后一次露面:2 years 6 months ago
加入:2018-10-04 05:09
嗨对话框,

嗨对话框,

Could I add some information about the current problem.
Firstly as for UART receive interrupt doesn't normally after weke-up and my program sometimes jumps to L.369 in rwble.c (ASSERT_WARNING(0);).

if((development_debug)&&(use_power_optimizations))
{
slp_period_retated = slp_period;
//如果此断言命中,则LP ISR持续时间长于时间
//已通过LP_ISR_TIME_XTAL32_CYCLES和LP_ISR_TIME_USEC保留。
if(sleep_lp_cycles &&(sleep_lp_cycles assert_warning(0);// l.369
}

But Receive interrupt itself wasn't caught and I must judge it's not handler's problem.
Then I doubted wake-up delay time at L.400 in arch_system.c ().

else // USE_POWER_OPTIMIZATIONS
{
delay = minime_sleep_duration;

// if XTAL_TRIMMING_TIME_USEC changes (i.e. gets larger) then this
// will make sure that the user gets notified to increase "delay" by 1 or more
// slots so there's enough time for XTAL to settle
#if((3125 +(minimue_sleep_duration + 625))<(lp_isr_time_usec + 1100))//1.1ms max上电时间// l.395
#错误“最小睡眠持续时间太小,对于使用的16MHz水晶......”
# 万一
}
rwip_wakeup_delay_set(delay); // L.400

但考虑到L.395的约束,我理解将最终_sleep_duration更改为1slot。
然后我认为这是睡眠模式和我重写arch_set_deep_sleep()的问题;to arch_set_extendend_sleep();在void user_app_adv_start(void)中,但结果是相同的。

Anyway now I'm at loss.
请告诉我有用的信息来解决它。

Thanks,
Diogenes.

Diogenes.
离线
最后一次露面:2 years 6 months ago
加入:2018-10-04 05:09
嗨对话框,

嗨对话框,

我必须更多地添加有关当前情况的更多信息。
I noticed on debugging that mu program doesn't enter into if(arch_ble_ext_wakeup_get()) clause though I set EXT_SLEEP in user_config.h, user_app_adv_start() and user_app_connection() like folllowings.

// const static sleep_state_t app_default_sleep_mode = arch_deep_sleep_on;
const static sleep_state_t app_default_sleep_mode = arch_ext_sleep_on;

// ARCH_SET_DEEP_SLEEP();
ARCH_SET_EXTEDDE_SLEEP();

所以我评论了(Arch_ble_ext_wakeup_get()),但没有发生UART接收中断。

// if(arch_ble_ext_wakeup_get())
{
ARCH_SET_SLEEP_MODE(app_default_sleep_mode);
arch_ble_force_wakeup();
ARCH_BLE_EXT_WAKEUP_OFF();
app_easy_wakeup();
}

And next I inserted forcibly arch_force_active_mode() just after arch_ble_force_wakeup().
然后UART接收中断发生,但我怀疑如果程序真的进入睡眠模式。
At least on debug, the program enters into arch_goto_sleep(sleep_mode).
Could I think Extended Sleep is really entered even I inserted arch_force_active_mode() just after arch_ble_force_wakeup()?
Please tell me more information.

Thanks,
Diogenes.

PM_DIALOG.
离线
最后一次露面:10 hours 34 min ago
职员
加入:2018-02-08 11:03
嗨Diogenes,

嗨Diogenes,

If you configure the APP_ADV_DATA_UPDATE_TO as 1msec, this means that the device will advertise only from 1msec, which is too short advertising time. After the expiration of 1msec, the device will go to permanent sleep mode and the only way to wake it up is from the wake up controller, as the implementation of the push button in ble_app_sleep_mode example that you are working on. After this time, all the peripherals modules will be powered of (including the UART peripheral module), so you will not able to receive any UART interrupt. Still, I am not able to understand what you are trying to accomplish with UART. Would you like to wake the DA14580 up by receiving data from UART? Can you please change the APP_ADV_DATA_UPDATE_TO to a longer duration of time and try to run your project without enabling the sleep mode?

Regarding you second post, this assertion probably means that the LP_Hanlder takes too much time to execute and the warning that you get means that it took more time for the BLE core to wake up that the calculated value. Please check a previous thread:

https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/some-porblem-sleep-mode

我想通知您,如果您发现上述任何答案有用,请将其中一个标记为已接受。

谢谢,PM_DIALOG.

Diogenes.
离线
最后一次露面:2 years 6 months ago
加入:2018-10-04 05:09
嗨对话框,

嗨对话框,

Thank you for your reply.

>您想通过从UART接收数据来唤醒DA14580吗?

正如我已经解释了两倍的“否”,我只需要在Wakeup Int唤醒后接收中断。

> If you configure the APP_ADV_DATA_UPDATE_TO as 1msec

I think it's impossible to configure the APP_ADV_DATA_UPDATE_TO as 1msec, since the minimum quantum of APP_ADV_DATA_UPDATE_TO is 10msec.
我使用app_adv_data_update_to运行1(10msec间隔)和1000(10sec),但结果是相同的。
With both value UART receive interrupt after wake-up works normally.
我可以询问您是否有关它,将App_add_data_update_to配置为1(10磁形间隔)太短?

And I ask again about the question I wrote in previous post.
I repeat that I commented out if(arch_ble_ext_wakeup_get()) and inserted arch_force_active_mode() just after arch_ble_force_wakeup().
Could I think Extended Sleep is really entered even I inserted arch_force_active_mode() just after arch_ble_force_wakeup()?

// if(arch_ble_ext_wakeup_get())
{
ARCH_SET_SLEEP_MODE(app_default_sleep_mode);
arch_ble_force_wakeup();
ARCH_BLE_EXT_WAKEUP_OFF();
app_easy_wakeup();
}

这只是我想在上一篇文章中提出的问题。

Thanks,
Diogenes.

PM_DIALOG.
离线
最后一次露面:10 hours 34 min ago
职员
加入:2018-02-08 11:03
嗨Diogenes,

嗨Diogenes,

所以你的意思是“我只是需要UART receive interrupt after wake-up by WAKEUP INT”? You will get an interrupt if you have data either to send or receive. Sorry, but I am not able to understand what you are trying to accomplish with the UART. If you configure the APP_ADV_DATA_UPDATE_TO as 1 (10msec), the UART will be powered on only for 10msec. The arch_ble_ext_wakeup_get() function checks whether the BLE core is in permanent sleep mode or not. Let me try to explain a bit better how the ble_app_sleep mode example works. The device will enter the sleep mode between the advertising or connection intervals. But, in this example there is a implementation of entering the permanent sleep and the device is able to be woken up only from the wake up controller. The sleep mode is really entered even I inserted arch_force_active_mode() just after arch_ble_force_wakeup(). Please check the user_app_adv_start() function and you will see the after the expiration (APP_ADV_DATA_UPDATE_TO) of the timer the adv_data_update_timer_cb() will be triggered. This function calls the app_easy_gap_advertise_stop() which send a GAPM_CANCEL_CMD message by executing the app_gapm_cancel_msg_create(). The response of the GAPM_CANCEL_CMD, is a GAPM_CMP_EVT, so the gapm_cmp_evt_handler() will be triggered from the app_task.c. If you check this function, in case of undirected connectable advertising that the example uses, app_on_adv_undirect_complete callback function will be triggered. Please check the .app_on_adv_undirect_complete callback from the user_callback_config.h header file and you will see that the user_app_adv_undirect_complete() is registered. This means that after the expiration of the timer the user_app_adv_undirect_complete() will be executed and it calls the arch_ble_ext_wakeup_on() which puts the BLE core to permanent sleep. Only an external event can wake it up.

谢谢,PM_DIALOG.