RTC memory synchronization (RISCV-ULP vs. CPU)

DrMickeyLauer
Posts: 160
Joined: Sun May 22, 2022 2:42 pm

RTC memory synchronization (RISCV-ULP vs. CPU)

Postby DrMickeyLauer » Wed Jan 10, 2024 10:47 am

In my application the RISCV-ULP is responsible for blinking LEDs on behalf of the CPU. To indicate which LEDs have to blink we use a shared state variable that gets written by the CPU and read/reset by the RISCV-ULP.

Since the lock synchronization may introduce unwanted latencies, I wonder about the worst case if we don't do it. What can happen if read/write or two writes collide? Will either one win, will the resulting value be completely random or will the system crash?

liaifat85
Posts: 200
Joined: Wed Dec 06, 2023 2:46 pm

Re: RTC memory synchronization (RISCV-ULP vs. CPU)

Postby liaifat85 » Wed Jan 10, 2024 4:09 pm

I think you are experiencing race condition: viewtopic.php?t=6771

MicroController
Posts: 1389
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: RTC memory synchronization (RISCV-ULP vs. CPU)

Postby MicroController » Thu Jan 11, 2024 12:33 am

DrMickeyLauer wrote:
Wed Jan 10, 2024 10:47 am
will the resulting value be completely random or will the system crash?
I would be shocked if the hardware would fail to synchronize any memory accesses in this manner.

Who is online

Users browsing this forum: Addi2438, Google [Bot] and 127 guests