Gnuk Mirae and Reproducible Procurement
NIIBE Yutaka
gniibe at fsij.org
Mon Aug 19 08:32:40 CEST 2024
Hello,
NIIBE Yutaka <gniibe at fsij.org> wrote:
> I started Gnuk Mirae development with CH32V203 MCU.
With the development board, USB serial experiment works for me.
(commit 183a9e13de341249e8d5cdca6a0a6dca0f2128c0 of chopstx,
wch branch)
I learned that when its core sleeps, USB peripheral cannot access SRAM
correctly, and results data of all 00 in transactions. This results USB
enumeration failure randomly. In some cases, it partially works,
depending on timing of host.
I observed the all 00 data in the signal, by Saleae Logic 16 clone using
Sigrok. Well, I had to use the analyzer because I was not able to
imagine the cause.
So, in my experiment, I let it keep running, no sleep.
diff --git a/chopstx-riscv32.c b/chopstx-riscv32.c
index 4d6b225..284e57c 100644
--- a/chopstx-riscv32.c
+++ b/chopstx-riscv32.c
@@ -672,7 +672,7 @@ chx_init_arch (struct chx_thread *tp)
/* NOTE: I wonder if there is a race condition here. */ \
/* Interrupted before the wfi instruction, and */ \
/* entering wfi to wait an interrupt. */ \
- "wfi\n\t" \
+ "nop\n\t" \
/* INTERRUPT RETURNS here (even interrupted _before_ wfi). */ \
/* And interrupt is masked and a0 is set. */ \
"beqz a0,0b\n\t" /* Just in case if not, loop. */
With this change, now, it works.
--
More information about the Gnuk-users
mailing list