Hi
i think i made a mistake with the BLE .bin i did boot, so with Periph_init still does not work
i tried:
if (GPIO_GetPinStatus(GPIO_PORT_0, GPIO_CTRL) == false){
// falling edge
AdvLen=0;
SetBits16(CLK_CTRL_REG, SYS_CLK_SEL, 0); // select XTAL 16MHz
SetBits16(CLK_16M_REG, RC16M_ENABLE, 0); // save power from RC 16MHz
SetBits16(CLK_RADIO_REG, BLE_ENABLE, 1); // BLE clock enable
SetBits16(PMU_CTRL_REG, RADIO_SLEEP, 0); // Power up! Note: System must run at 16MHz when powering up RADIO_PD.
set_pad_functions();
uart_sps_init(UART_SPS_BAUDRATE, 3);
}
but it does not work, i only can make it working after the BLE carries out an advertising, from this moment ( as you said SLP_handled) uart receives data
i've tried to invoke some of the code of this handlers in the GPIO callback , but can't make it to work
what functions would you call in my case?
Regards
this sequence also does not work, event if afterwards an advertising is issued:
if (GPIO_GetPinStatus(GPIO_PORT_0, GPIO_CTRL) == false){
// falling edge
AdvLen=0;
SetBits16(CLK_CTRL_REG, SYS_CLK_SEL, 0); // select XTAL 16MHz
SetBits16(CLK_16M_REG, RC16M_ENABLE, 0); // save power from RC 16MHz
/ / 1。启动peripherals' power domain
periph_init();
if (app_default_sleep_mode == ARCH_EXT_SLEEP_ON)
arch_disable_sleep(); // arch_force_active_mode();
// set interrupt to detect rising edge of GPIO_CTRL
GPIO_EnableIRQ(GPIO_PORT_0, GPIO_CTRL, GPIO0_IRQn, 0, 1, 0);
}
Hi joanquark,
Try to Invoke the arch_ble_force_wake_up() in order for the LP and the SLP handlers to be invoked wake up the BLE and to calibrate your crystal, dont do any crystal operations in the ISR, let the BLE handlers take care of that. After the SLP is carried out you can work with 580's peripherals.
Thanks MT_dialog
ive put:
if (GPIO_GetPinStatus(GPIO_PORT_0, GPIO_CTRL) == false){
// falling edge
AdvLen=0;
arch_ble_force_wakeup();
if (app_default_sleep_mode == ARCH_EXT_SLEEP_ON)
arch_disable_sleep(); // arch_force_active_mode();
// set interrupt to detect rising edge of GPIO_CTRL
GPIO_EnableIRQ(GPIO_PORT_0, GPIO_CTRL, GPIO0_IRQn, 0, 1, 0);
}
and still does not work, till next advertising event occurs
just to add, that i've tried many delays, and still does not work, the power profiler does not show significative change, so i assume there is no ble power up at all.
check attached
Hi joanquark,
You wont see any massive change when you power up the BLE core, the reason you should invoke the BLE power up is to trim your XTAL16 in order to get valid uart data (you dont advertise at the moment or do any radio activities in order to see much bigger power), although from your image i can see where the interrupt hits but i can't see any disable sleep at that time, seems that the sleep disabling occurs right after the next advertising event, you can place an arch_set_pxact_gpio() in the interrupt routine and check if the condition is executed if (GPIO_GetPinStatus(GPIO_PORT_0, GPIO_CTRL) == false). Also the DSPS implements flow control, while advertising it toggles its RTS, to signal the external MCU to send or not send data, the window that the DSPS allows the data sending is while it is advertising, perhaps the reason you dont see any data arriving is this.In the DSPS the 580 will get data while advertising when its awake because the external MCU will see the its CTS low and will send it at that particular time which is when the device wakes up in order to advertise.
Thanks MT_dialog