唤醒app_timer_set()后有时工作异常

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
5 posts / 0 new
最后一篇
Lewuyouc.
离线
Last seen:1年7个月前
加入:2016-07-18 01:38
唤醒app_timer_set()后有时工作异常

你好

我修改SDK 5.0.4 \ da1458x_sdk \ 5.0.4 \ projects \ target_apps \ ble_examples \ prox_reporter项目。

我设置const static sleep_state_t app_default_sleep_mode = arch_sleep_off; .user_default_hnd_conf.uc.adcenario = def_adv_forever,

I use in our new made board, we use set_device_to_sleep() function set device to extended sleep mode,

我们使用ACC传感器到唤醒设备,app_acc_wakeup_cb()和app_accint_snifftocwake_cb()是回调,看起来正常。

但有时在app_accint_snifftocwake_cb()中函数app_timer_set(app_alg_period_task_timer,task_app,100);是异常的,app_alg_period_task_timer不起作用,经过很长一段时间(大约五分钟),app_alg_period_task_task_timer开始工作。

请给我一些建议!

静态常量结构ke_msg_handler app_custs1_process_handlers [] = {{APP_ALG_PERIOD_TASK_TIMER,(ke_msg_func_t)app_alg_period_task_timer_handler},{CUSTS1_CREATE_DB_CFM,(ke_msg_func_t)app_custs1_create_db_cfm_handler},{CUSTS1_DISABLE_IND,(ke_msg_func_t)app_custs1_disable_ind_handler},};static int app_alg_period_task_timer_handler(ke_msg_id_t const msgid,void const * param,ke_task_id_t const dest_id,ke_task_id_t const src_id){static int i = 0;app_timer_set(app_alg_period_task_timer,dest_id,100);I ++;ARCH_PRINTF(“i =%d \ r \ n”,i);test_ble_send_data_function();return(ke_msg_consumed);void set_device_to_sleep(void){arch_printf(“set_device_to_sleep \ r \ n”);if(ke_timer_active(app_alg_period_task_timer,task_App)){ke_timer_clear(app_alg_period_task_timer,task_app);} if(ke_state_get(task_app)== app_connected){disconnonnte_no_adv_flag = 1; app_easy_gap_disconnect(save_connection_idx); } app_easy_gap_advertise_stop(); hsppad042a_standby(); hsactd_set_to_sniff(); arch_ble_ext_wakeup_on(); app_accInt_wakeup_enable(); arch_set_extended_sleep(); } static void app_acc_wakeup_cb(void) { disconnect_no_adv_flag = 0; default_advertise_operation(); arch_printf("app_acc_wakeup_cb"); } static void app_accInt_snifftocwake_cb(void) { if (GetBits16(SYS_STAT_REG, PER_IS_DOWN)) { periph_init(); } if (arch_ble_ext_wakeup_get()) { arch_disable_sleep(); arch_ble_force_wakeup(); arch_ble_ext_wakeup_off(); app_easy_wakeup(); } hsactd003a_readsteate_clear_pending(); arch_printf("app_accInt_snifftocwake_cb\r\n"); app_timer_set(APP_ALG_PERIOD_TASK_TIMER, TASK_APP, 100); app_accInt_wakeup_enable(); } void app_accInt_wakeup_enable(void) { app_easy_wakeup_set(app_acc_wakeup_cb); wkupct_register_callback(app_accInt_snifftocwake_cb); // if (!GPIO_GetPinStatus(GPIO_ACCINT_PORT, GPIO_ACCINT_PIN)) { wkupct_enable_irq(WKUPCT_PIN_SELECT(GPIO_ACCINT_PORT, GPIO_ACCINT_PIN), // select pin WKUPCT_PIN_POLARITY(GPIO_ACCINT_PORT, GPIO_ACCINT_PIN, WKUPCT_PIN_POLARITY_HIGH), 1, // 1 event 3); // debouncing time = 0 } }

关键词:
设备:
Lewuyouc.
离线
Last seen:1年7个月前
加入:2016-07-18 01:38
你好

你好

app_timer_set() is not recommended? I replaced app_easy_timer function with app_timer_set .

I burn code to flash(M24M01-RMN6TP), on the bais of prox_reporter project, not include OTA, I also not use spi,

但似乎闪光消耗了很多电流。我需要配置SPI引脚?我该怎么办?

I use spi_flash_enable(SPI_EN_GPIO_PORT, SPI_EN_GPIO_PIN); and spi_flash_power_down(); in user_app_on_init() function,

目前的消费似乎更大。

Thanks!

GPIO_ConfigurePin (SPI_EN_GPIO_PORT SPI_EN_GPIO_PIN, OUTPUT, PID_SPI_EN, true); GPIO_ConfigurePin(SPI_CLK_GPIO_PORT, SPI_CLK_GPIO_PIN, OUTPUT, PID_SPI_CLK, false); GPIO_ConfigurePin(SPI_DO_GPIO_PORT, SPI_DO_GPIO_PIN, OUTPUT, PID_SPI_DO, false); GPIO_ConfigurePin(SPI_DI_GPIO_PORT, SPI_DI_GPIO_PIN, INPUT, PID_SPI_DI, false); void user_app_on_init(void) { static int8_t id=0; hsactd003a_init(); hsppad042a_Init(); id = spi_flash_enable(SPI_EN_GPIO_PORT, SPI_EN_GPIO_PIN); spi_flash_power_down(); arch_printf("id=%d\r\n",id); default_app_on_init(); }

PM_Dialog
离线
Last seen:2 days 6 hours ago
职员
加入:2018-02-08 11:03
嗨Lewuyouc,

嗨Lewuyouc,

你能不能让我知道你想在app_accint_snifftoctocwake_cb内的计时器完成什么?使用app_timer_set()函数您是一个内核计时器。我们建议使用App_easy_timer()API,该API创建一个新的计时器,如果需要,并激活BLE。但请描述该功能内部的使用情况。当您使用app_easy_timer替换app_timer_set时,您还在面临同样的问题吗?由于设备进入扩展睡眠模式,因此SPI闪光灯通电时的电流消耗如何?您是正确的,SPI闪光灯会增加电流消耗,因此您必须向下为其供电。您能否请将所有传感器从您的定制板上取下并测量扩展睡眠模式下的电流消耗,并使用SPI闪光通电?我想你用精确的amperemeter测量扩展的睡眠电流,而不是使用SmartSnippets工具箱的使用。

Thanks, PM_Dialog

Lewuyouc.
离线
Last seen:1年7个月前
加入:2016-07-18 01:38
你好PM_Dialog

你好PM_Dialog

I use app_accInt_snifftocwake_cb to restart timer, periodically get sensors data. the app_easy_timer function work normal.

In user_app_on_init I set spi flash is powered off,we check the power consumption in extended sleep mode about 4uA. I think the

功耗正常。

问题:我使用smartsnippets将我的代码刻录到spi flash。我设置spi flash在user_app_on_init中关闭了电源,因此SPI闪存始终是

powered off. but boot code is obtained from spi flash, I do know I set spi powered off, my board wakeup from extended sleep mode,

启动代码可以正常工作?

Problem: after I set sleep mode,sometimes the boot is not work. It's same as the new board without the program .

PM_Dialog
离线
Last seen:2 days 6 hours ago
职员
加入:2018-02-08 11:03
嗨Lewuyouc,

嗨Lewuyouc,

In DA1458x family devices, the code always executes from internal System-RAM. This mean that, since you have burnt the SPI Flash with your firmware, when the device boots, the firmware will be copied and executed from the System-RAM. So, when you powered down the flash in the user_app_on_init, the firmware had already been copied into the System-RAM and that’s why you can boot successfully.

Thanks, PM_Dialog