How delay() or microseconds() delay in platformIO for hifive1 board (Risc-v) can be written?

Hi,
I just started working with hifive1 with platformIO ,here i want to use delay functions, in ms and us .How it can be achieved?

Which framework are you using? What’s the content of your platformio.ini?

env:hifive1
platform = sifive
board = hifive1

Using freedom e sdk

The examples in for the Freedom-e-sdk show that a hardware timer can be used (arm with specific wait value, then run, wait for completion interrupt, then exit function). The setup function seems to be using the RTC clock (32.768 kHz) so the timers might be using this base frequency. Code e.g. shown in

There is also a delay millisecond function written in assembly which uses the hardware timer, this can be used from C code as well. It’s the exact same concept of arming the timer and waiting for the interrupt in a blocking way.

For more questions on the Freedom-E SDK, it’s best to use the forum of their SDK, as PlatformIO is just the build system.

1 Like

Yes i have also seen that, and i was using Arduino ide and sometimes freedomstudio(from Sifive) ide for my projects. Very recently I heard that platformIo has give risc-v support , so I just started to use platformIO. Actually, I just wanted to know that ,any ready made functions are available related to that delay in the form of library, so that I can use it without spending much time😀. Anyways thanks a lot for your immediate response.