wkupct_enable_irq doesn't work for me, please help

4 posts / 0 new
Last post
achao1104
Offline
Last seen:5 years 2 months ago
Master
加入:2015-12-24 10:56
wkupct_enable_irq doesn't work for me, please help

irq is setuped for p2_7.

the problem is:
1)if executing in ide step by step debug mode, it goes sleep and just observed advertise sent out once by sniffer. but if pressing the p2_7 key, it doesn't fire a call to resume or any other method I set breakpoint.
2)if exiting ide step by step debug mode, I observed the advertise is sent out continuously, but why it is fired even I don't press the button to trigger p2_7, I guess it might be due to debouncing. after changing the number , it is still like that.
3)if I comment out "user_app_adv_start();" from resume method, I didn't observe advertise sending out continuously.

the question is:
1) how to just fire one interrupt only when I press the button.
2)is there any way to set a breakpoint in ide debug mode in "resume from sleep" method?

codes in setup
wkupct_register_callback(wake_up_cb);
wkupct_enable_irq(0x800000, 0x800000, 15, 20);
wake up method
void wake_up_cb(void)
{

if(GetBits16(SYS_STAT_REG, PER_IS_DOWN))
periph_init();

arch_ble_force_wakeup();
arch_ble_ext_wakeup_off();

}

resume from sleep
void user_resume_sleep(void)
{
user_app_adv_start();
}

timer callback to set device to deep sleep
static void adv_data_update_timer_cb()
{

app_adv_data_update_timer_used = 0xFFFF;

app_easy_gap_advertise_stop();
arch_set_deep_sleep();
arch_ble_ext_wakeup_on();
}

Device:
achao1104
Offline
Last seen:5 years 2 months ago
Master
加入:2015-12-24 10:56
hi dialog,

hi dialog,
谁能帮忙吗?
Peter

achao1104
Offline
Last seen:5 years 2 months ago
Master
加入:2015-12-24 10:56
hi dialog,

hi dialog,
谁能帮忙吗?
Peter

mohit3112
Offline
Last seen:8米onths 3 weeks ago
Expert
加入:2014-08-04 13:45
i don't know which sdk

i don't know which sdk version you are using but anyway here are some points to keep in mind

1. you cannot debug the deep sleep mode mode cause it wipes the sram memory and there should be code in otp memory to boot
2. you cannot debug the extended sleep mode case it interfere with jtag.
but there one little thing in arch_system.c file
if ( (app_get_sleep_mode() == 2) || (app_get_sleep_mode() == 1) )
{
SetWord16(SET_FREEZE_REG, FRZ_WDOG); // Stop WDOG until debugger is removed
while ((GetWord16(SYS_STAT_REG) & DBG_IS_UP) == DBG_IS_UP) {};
SetBits16(SYS_CTRL_REG, DEBUGGER_ENABLE, 0); // close debugger
}
this code is there to stop you from debugging in sleep modes so if you comment this code i think you can see break-point in extended sleep mode

3. i don't think you have a denouncing problem , i think after waking up from sleep system is not going to sleep mode again hence continuously advertising. you should start the timer again in user_resume_sleep