k_msleep(SLEEP_TIME_MS) stop LOGS / UART peripheral?

I hear a lot about nRF SoCs and how good and efficient they are in terms of low power consumption.

At first I started using SoC nRF52840 with Arduino Core. But a few months ago I decided to dig in and try the nRF Connect SDK but it's been so confusing and overwhelming comparing to other SoC vendors I used during college and the lack of tutorials is a big problem to start with. The level of abstraction is so high and generally this kind of high level abstraction should allow us to understand and develop firmware quickly, but it has been quite the opposite.

I'm acquiring a lot of data from the I2C sensor and then sending it using UART using printf(). I'm acquiring data at 100Hz, so I use k_msleep(SLEEP_TIME_MS) after sending the data to UART but I think the SoC goes to sleep and the data is not sent at 100Hz some times. I know the best approach must be to use timers interrupts, but also the SDK abstraction is quite confusing. Many data structures, macros, etc.

Anyone know how I should solve this?

Related