系统卡在唤醒时,没有其他按钮正在工作

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
4个帖子/ 0新
最后一篇
Mahmed106.
离线
最后一次露面:2周4天前
加入:2019-05-03 17:28
系统卡在唤醒时,没有其他按钮正在工作

嗨对话框

我正在根据DA14681在定制栏上工作。我正在使用GPIO上的两个按钮来执行一些任务,它们完美地工作。

然后我使用GPIO,直接连接到USB电源。当USB连接时,此GPIO会很高,我做了一个也是完美工作的规范任务。

问题是我正在使用Hibernation模式,我正在使用这个USB电源GPIO用于唤醒目的。一旦我插入USB的休眠模式时,它会醒来并完美地工作,但其他两个按钮停止运行,然后删除USB,那么这两个按钮再次开始工作。我无法承诺这个问题。

Here is the code in main.c

pm_system_init(periph_init);

hw_wkup_init(NULL);
hw_wkup_configure_pin(dis_button_port,dis_button_pin,true,hw_wkup_pin_state_high);//按钮1
hw_wkup_configure_pin(pwr_button_port,pwr_button_pin,true,hw_wkup_pin_state_high);//按钮2.

hw_wkup_configure_pin(hw_gpio_port_4,hw_gpio_pin_0,true,hw_wkup_pin_state_high);//用USB连接唤醒

hw_wkup_set_debounce_time(10);
hw_wkup_set_counter_threshold(1);
hw_wkup_register_interrupt(wkup_cb,1);

设备:
PM_DIALOG.
离线
最后一次露面:2小时49分钟前
职员
加入:2018-02-08 11:03
嗨mahmed106,

嗨mahmed106,

Could you please indicate if you have the buttons configured in the periph_init(function)? I assume that your device is powered up via a battery, is that correct?

谢谢,PM_DIALOG.

Mahmed106.
离线
最后一次露面:2周4天前
加入:2019-05-03 17:28
是设备通过通行证

是设备通过电池供电,这是我的periph_init函数,我有定义的按钮但没有明确的USB连接GPIO。

静电void periph_init(空白)
{
#if 1 //定义config_retarget
/ *
*Workaround for JLink emulated serial port.
*
* jlink串口不会将其输出UART PIN高(UART IDLE状态)设置为
*从PC到板上有一些东西。
*Pin state is kept by level shifter low after board reset.
*配置PIN作为UART_RX无法打开拉压电阻,因此RX线保持低
*此状态通常被检测为中断状态。
*在UART RX上的状态下,UART的配置不成功:尽快波特率
*设置UART进入忙状态,所有其他设置都被忽略。
*
*解决方法设置引脚,将用作高状态输出的UART Rx。
*这将导致液位换档,直到jlink开始推动此状态
*传输线。
* /

#if old_hardware
hw_gpio_set_pin_function(hw_gpio_port_1,hw_gpio_pin_0,hw_gpio_mode_output,hw_gpio_func_uart_tx);
#else //相同的干燥和液体
REG_SET_BIT(CRG_PER,USBPAD_REG,USBPAD_EN);
hw_gpio_set_pin_function(hw_gpio_port_2,hw_gpio_pin_2,hw_gpio_mode_output,hw_gpio_func_uart_tx);
#万一
// hw_gpio_set_pin_function(hw_gpio_port_2,hw_gpio_pin_2,hw_gpio_mode_output,
// HW_GPIO_FUNC_UART_RX);
#万一


hw_gpio_configure_pin(hw_gpio_port_2,hw_gpio_pin_3,hw_gpio_mode_input_pullup,hw_gpio_func_gpio,1);
// hw_gpio_configure_pin(hw_gpio_port_2,hw_gpio_pin_3,hw_gpio_mode_output,hw_gpio_func_gpio,1);
hw_gpio_set_pin_function(hw_gpio_port_1,hw_gpio_pin_5,hw_gpio_mode_output,hw_gpio_func_uart2_tx);
hw_gpio_set_pin_function(hw_gpio_port_2,hw_gpio_pin_3,hw_gpio_mode_input_pullup,hw_gpio_func_uart2_rx);

hw_gpio_configure_pin(buzz_port,buzz_pin,hw_gpio_mode_output,hw_gpio_func_gpio,0);
hw_gpio_configure_pin(thm_pwr_port,thm_pwr_pin,hw_gpio_mode_output,hw_gpio_func_gpio,0);
/ / hw_gpio_configure_pin (PELT_PORT PELT_PIN HW_GPIO_MODE_OUTPUT, HW_GPIO_FUNC_GPIO, 0);
// hw_gpio_configure_pin(infan_port,infan_pin,hw_gpio_mode_output,hw_gpio_func_gpio,0);
hw_gpio_configure_pin(th1_port,th1_pin,hw_gpio_mode_output,hw_gpio_func_gpio,0);
hw_gpio_configure_pin(th2_port,th2_pin,hw_gpio_mode_output,hw_gpio_func_gpio,0);
hw_gpio_configure_pin(TH3_PORT, TH3_PIN, HW_GPIO_MODE_OUTPUT, HW_GPIO_FUNC_GPIO, 0);

hw_gpio_configure_pin(pwr_button_port,pwr_button_pin,hw_gpio_mode_input_pulldown,hw_gpio_func_gpio,0);
hw_gpio_configure_pin(DIS_BUTTON_PORT,DIS_BUTTON_PIN, HW_GPIO_MODE_INPUT_PULLDOWN,HW_GPIO_FUNC_GPIO, 0);

hw_gpio_configure_pin(hw_gpio_port_3,hw_gpio_pin_7,hw_gpio_mode_output,hw_gpio_func_gpio,1);// 3.3V调节器

}

PM_DIALOG.
离线
最后一次露面:2小时49分钟前
职员
加入:2018-02-08 11:03
嗨mahmed106,

嗨mahmed106,

它有点奇怪,因为一旦设备从休眠唤醒时,它就像一个冷启动,并且将执行与您的配置的Periph_init()。您可以尝试使用逻辑分析仪并跟踪与按钮连接的GPIO,以了解它是否是硬件或软件相关问题?

谢谢,PM_DIALOG.