Hi,
We have a custom PCB with DA14580 in Buck Mode Configuration with only XTAL16. Here BLE app is loaded via SPI when main microcontroller reset happens
and some sensor data to be transmitted via BLE is send over UART from main microcontroller. As I understand only extended sleep is possible in this with
#define CFG_LP_CLK LP_CLK_RCX20 and variable app_default_sleep_mode=ARCH_EXT_SLEEP_ON. From BLE android app, during scan, device is visible.
But on initiating connection, further connection is lost and device name is no longer listed.
Can you please provide some suggestions on this behavior?
Thanks,
Aparna
Device:
Hi aparna.anand,
If you are able to see the device when it starts up, and upon connection it fails to connect and then its not visible any more i can assume that when connecting somewhere the code stalls, you should check via debugging where the code ends up after the connection happens and it causes the device to be unresponsive. In a normal case if a connection fails the device should start advertising again by invoking the start advertising procedure in the .app_on_connection callback (in the else condition if the connection failed) or at the app_on_disconnect callback, if this is not invoked then the device is not going to start the advertising once the connection attempt fails. But since there is no case of a successful connection, most probably something stalls the device upon the connection procedure.
Thanks MT_dialog
Hi,
Thanks for your suggestion. I will try debugging at what point the app is stuck.
Meanwhile can you please confirm that CFG_LP_CLK as LP_CLK_RCX20 for extended sleep mode entry on the run time is possible? This is because we don't have XTAL32 on our custom board.
I see that application runs fine when I disable extended sleep mode and is stuck only when I enable extended sleep.
Thanks,
Aparna
Hi aparna.anand,
Since your custom board is configured in buck mode then you can run on the RCX, i dont get the runtime term though, the selection of the LP clock should be done in the da1458x_config_advanced.h file and the CFG_LP_CLK should be set to LP_CLK_RCX20, if you dont have an external XTAL32 this is the configuration that your sw should have during compilation. Since your device is visible when booting up that means that it can sleep and advertise as it should be, there must be something wrong when the connection happens in the fw that you are running, perhaps the reading of the sensor that creates the malfunction. You can check with a simple SDK example and connect to it in order to verify that the problem lies in your fw and not on your custom board.
Thanks MT_dialog
Hi,
By runtime what I meant is enabling sleep mode in between the connection or the advertising intervals. As debug lines for DA14580 have not been brought out in the custom board, I am still figuring out how to debug this issue further.
The other thing I am trying out is enabling sleep mode(permanent) on DA upon a GPIO event by the main microcontroller(an input to DA driven high). A power reset would bring out both DA and main microcontroller out of reset. Can you please tell me if this would be possible?
I have seen examples of using wkupct_register_callback() and wkupct_enable_irq() APIs. But in my case I don't need to enable wakeup timers. I just need to service GPIO ISR and enable extended sleep.
Some suggestion on examples to look upon would be helpful.
Thanks,
Aparna
Hi aparna.anand,
Enabling and disabling the sleep during execution of the code can be done via the arch_disable_sleep(), arch__set_extended_sleep() api. Also something that you ve might misunderstood, you dont have to enable and disable sleep during the connection intervals, if the device is by default in extended sleep mode (by using the ARCH_EXT_SLEEP_ON in the app_default_sleep_mode structure) the SDK will arrange the sleeping and awakening of the device during the advertising intervals and connection intervals without any need from the application to take any action, the disable sleep function in normally used when the application requires from the device to stay awake even if the there is no need for BLE activity (no upcomming connection event or advertising event).
关于从外部支持睡眠模式micro controller, you can configure the 580 to wake up via an external interrupt, you can have a look at the ble_app_sleepmode where the device after advertising for a small amount of time it falls to permanent sleep (no BLE event) and wakes up via an external button interrupt. Also you can configure the device to reset on the next wake up by configuring the RESET_ON_WAKEUP in the PMU_CTRL_REG if that is what you are asking.
Regarding the waking up, if you are in permanent sleep mode (meaning no BLE events programmed, no connection established or advertising arranged) the device can wake up either via a kernel timer (which also is considered a BLE event) or from the wake up timer (the name is a bit misleading but in fact this is the module that wakes up the device after power down after a preprogrammed number of GPIO events occur) so those examples that are using the wkupct_timer are the examples that you should use.
Thanks MT_dialog
Thanks a bunch for clearing the misunderstanding and pointing to examples!
Thanks & Regards,
Aparna