I’m using RAK4631(only) for BLE and RAK5860 with RAK19007 base board.
I have developed RTOS application with 4-5 tasks using Arduino BSP.
while BLE+Cellular it is consuming 25 to 30mA current and BLE alone consuming 5-6mA
Now want to know that any ways to reduce current consumption. I don’t know how to put into sleep mode.
I have no simple examples, one use is in my SX126x-Arduino library where I use interrupts to release a semaphore to wake up a task to handle the interrupt.
And I use it a lot in my WisBlock API framework.
As I said, I have no “simple” examples. This code is actually very complex because it serves for the ESP32 MCU’s nRF52 MCU’s and the RP2040 MCU’s.
All of them have differences in the handling.
The release of the semaphores for each task can be triggered by a timer or by an external event. I don’t know what your code is doing and why you need so many tasks.
With FreeRTOS and tasks, be careful with resources you use in your tasks.
E.g. if two tasks are reading sensors that are connected over I2C, you cannot run both tasks at the same time. You will get problems, because if both tasks try to use I2C at the same time, they will collide.
I have an application where I have to read sensor data, adc, gnss and scan and connect ble device. All these will have different time interval. So I have created task for each. It is working fine but current consumption is more. So just wanted to check for the optimisation.
I can’t answer that. I don’t know how your code and tasks are setup.
If I want to build a new low power device, I usually start from Low-Power-PIO (if based on Arduino BSP’s) or from RUI3-LowPower-Example (if based on RUI3) and just add my timers, interrupts and sensor readings to it.