Skip to content

Commit

Permalink
this changes the standard mode of the CH32x035 to machine mode
Browse files Browse the repository at this point in the history
  • Loading branch information
yves5141 committed Dec 25, 2024
1 parent d12ef19 commit ad9e76e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ch32v003fun/ch32v003fun.c
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,13 @@ void handle_reset( void )
or a0, a0, a3\n\
csrw mtvec, a0\n"
: : : "a0", "a3", "memory");
//This changes the standard mode of the CH32x035 to machine mode
#if defined ( CH32X03x )
asm volatile(
" li t0, 0x1888\n\
csrw mstatus, t0\n\
");
#endif

// Careful: Use registers to prevent overwriting of self-data.
// This clears out BSS.
Expand Down

0 comments on commit ad9e76e

Please sign in to comment.