cancel
Showing results for 
Search instead for 
Did you mean: 

Stop mode on Threadx with BLE on WBA

AlexES
Associate III

Hello. I'm working on a BLE  application that uses an STM WBA55 board and ThreadX. It was based on the St Threadx p2pServer example, The Sequencer is disabled. I'm using stmCubeIDE 1.19 and st_fw1.7 and i cannot migrate to new versions due to compatibility reasons.

The main idea for the application is that the board initializes, advertizes 10-20 seconds for a connection, connects to a device like a phone pc, gets data from a sensor and transfers the data to the connected device. If no connection occurs or if the device is disconnected it should go into sleep/stop/standby mode until an EXTI interrupt from the user button is triggered. 


As of now the application is structured as follows:


-- A main thread is in charge of initializing the rest of the threads (one thread for each type of sensor eg temp adc etc) and handle events like ble connection/disconnection and sleep/wake up requests.
--Upon a sleep request a flag is set into an appropriate value. The rest of the threads include an fsm where if the flag is true, they will just sleep. In addition the board peripherals like UART, I2C, etc are de-initialied and interrupts other than the desirable EXTI line are disabled. 
--On the EXTI event, the peripherals are re-initialized and the device advertizes for a new connection once more. 

I tried the low power examples from ST. The bare metal Stop1 examples worked perfectly. The power consumption dropped to a couple of μΑ once the device went into stop mode. The ThreadX example didn't seem to work as expected though. I trie the example as is and only managed to drop the consumption to a couple of mAs which is very high. I switched the macros to the appropriate ones for stop mode instead of low power but got the same results. 

So, long story short my question is how can i integrate stop mode on my application right now ? The examples either use sleep on threadx or BLE but not on an application that uses both. 


-- What setting do i need to configure (.ioc and header files)?

-- What functions do i need to use (is HAL_PWR_EnterSTOPMode(PWR_LOWPOWERMODE_STOP1, PWR_STOPENTRY_WFI); enough once all interrupt sources are disabled? )?

-- What is the overall power consumption that i should expect on stop mode? A couple of hundreds of μΑs ?

 

 

0 REPLIES 0