Skip to main content

Repeating data transfers after sleep and wakeup

4 years ago

Repeating data transfers after sleep and wakeup

Posted byMax440 points 4 replies
0 upvotes

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.

谢谢你,马克斯

4 years ago

woshobruuefrip… 0 points

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.

4 years ago

Max44 0 points

LT,

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

Thanks again, Max

4 years ago

Max44 0 points

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

4 years ago

woshobruuefrip… 0 points

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