Repeating data transfers after sleep and wakeup

5 posts / 0 new
last post
Max44
Offline
last seen:9 months 2 weeks ago
Joined:2016-02-08 15:58
Repeating data transfers after sleep and wakeup

DA14580
Basic Development Kit + external circuits( pushbutton, EEPROM, and analog sensors)
SDK 5.0.3

Hi Dialog,

I'm continuing work on an app based on the ble_app_peripheral example. I'm currently working on wakeup button functions and have a problem repeating a transfer of a block of sensor data recorded in EEPROM. From extended sleep mode I can wakeup via a button and transfer a 1KB block of data using a 20 byte characteristic with a notify property. This works well ..... one time. All the data is received by an Android tablet and saved in a file. After the transfer, the app returns to extended sleep pending another wakeup button. If I wakeup and attempt the data transfer a 2nd time, the program stalls on attempting to send the 1st 20 bytes of data. From UART messages, it appears the 1st data value was placed in the characteristic data base and ke_msg_send(req) executed. From there I'm expecting a CUSTS1_VAL_NTF_CFM to queue up the next 20 bytes, but I never get it.

I've tried things like adding a long delay after the transfer before going to sleep and reducing the supervision timeout. Neither of these seemed to have an effect.

Please let me know if you have some advice on how to set up to repeat the process.

Thanks, Max

Device:
lT_Dialog (not verified)
Hi Max44,

Hi Max44,
I'd suggest disabling the sleep mode and running the program along with JLink debugger attached to see what really goes wrong in the program. When running a program with the debugger attached and the sleep mode is not disabled in the program, the program traps into a while loop and keeps checking if the debugger is up.

Max44
Offline
last seen:9 months 2 weeks ago
Joined:2016-02-08 15:58
lT,

lT,

Thanks .... this sounds like a good thing to try.
I'll keep working on debugging.

Thanks again, Max

Max44
Offline
last seen:9 months 2 weeks ago
Joined:2016-02-08 15:58
lT,

lT,

Having the debugger was a huge help. I wasn't aware I could unconfigure sleep modes and run a program that went to sleep and used wakeup functions with the debugger.

This enabled me to track down my mistakes and I now have the data transfers repeating.

Thanks for the helpful hint. Mark this as answered and done.

Max

lT_Dialog (not verified)
Good to hear that, Max. Good

Good to hear that, Max. Good luck to your project :)