Designing & Debugging RTOS Based IoT Applications