Hi
I modify SDK 5.0.4\DA1458x_SDK\5.0.4\projects\target_apps\ble_examples\prox_reporter project.
I set const static sleep_state_t app_default_sleep_mode = ARCH_SLEEP_OFF;.user_default_hnd_conf.adv_scenario = DEF_ADV_FOREVER,
我在我们的新制作板中使用,我们使用set_device_to_sleep()函数设置设备扩展睡眠模式,
we use acc sensor to wakeup device, the app_acc_wakeup_cb() and app_accInt_snifftocwake_cb() was callback,it is seem normal.
But sometimes in app_accInt_snifftocwake_cb() function the app_timer_set(APP_ALG_PERIOD_TASK_TIMER, TASK_APP, 100); is abnormal, the APP_ALG_PERIOD_TASK_TIMER do not work, after a long time(about five minutes),the APP_ALG_PERIOD_TASK_TIMER start to work.
please give me some suggest!
static const struct 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){ disconnect_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 } }
Keywords:
Device:
Hi
建议不要app_timer_set()?我用app_timer_set替换app_easy_timer函数。
我将代码刻录到flash(m24m01-rmn6tp),在prox_reporter项目的bais上,不包括Ota,我也不使用spi,
But seems the flash consumes a lot of current. I need to configure spi pin? What should I do with it?
我使用spi_flash_enable(spi_en_gpio_port,spi_en_gpio_pin);和spi_flash_power_down();在user_app_on_init()函数中,
current consumption seems to be bigger .
谢谢!
Hi lewuyouc,
Could you please let me know what you would like to accomplish with the timer inside the app_accInt_snifftocwake_cb? With the app_timer_set() function you se a kernel timer. We recommend the usage of the app_easy_timer() API which creates a new timer and activates the BLE if it required. But please describe which is the usage of the timer inside this function. When you replaced the app_timer_set with app_easy_timer, are you still facing the same problem? Since the device enters the extended sleep mode, how is the current consumption when the SPI Flash is powered on and off? You are correct, the SPI flash increases the current consumption, so you have to power it down. Could you please remove all the sensors from your custom board and measure the current consumption in extended sleep mode with the SPI flash powered down? I suppose that you measure the extended sleep current with an accurate amperemeter and not with the usage of SmartSnippets toolbox.
谢谢,PM_DIALOG.
嗨PM_DIALOG.
我使用app_accint_snifftocwake_cb重新启动计时器,定期获得传感器数据。app_easy_timer函数工作正常。
在User_App_On_Init I Set SPI Flash上电源关闭,我们检查大约4UA的延长睡眠模式下的功耗。我觉得
power consumption is normal.
Question: I use SmartSnippets burn my code to spi flash. I set spi flash is powered off in user_app_on_init, so the spi flash is always
断电。但是从SPI Flash获得了启动代码,我知道我设置了SPI电源关闭,我的电路板从扩展睡眠模式唤醒,
the boot code can work normal?
问题:设置睡眠模式后,有时启动不起作用。它与没有该计划的新董事会相同。
Hi lewuyouc,
在DA1458X系列设备中,代码始终从内部系统-AM执行。这意味着,由于您已将SPI闪存与固件烧毁,因此当设备靴子时,固件将从系统RAM复制和执行。因此,当您在User_App_On_Init中关闭Flash时,固件已被复制到系统RAM中,这就是您可以成功启动的原因。
谢谢,PM_DIALOG.