3023 views|8 replies

2865

Posts

4

Resources
The OP
 

Upgrade the embedded RISC-V compiler [Copy link]

 

The ch32v103c8t6 board was developed using the MounRiver Studio tool. The integration of this tool is good, but the project templates are a bit too "simple". It seems that it is a bit confusing to study the working principle of the chip in detail. So I spent some time to study it and found that the tool integrates the gnu risc-v tool and OpenOCD produced by xpack. I spent a long time downloading the latest version of the tool xpack-riscv-none-embed-gcc-10.1.0-1.1-win32-x64.zip. After a lot of hard configuration, the result was tragic. MounRiver's IDE could not download the program, so I had to uninstall and reinstall it. After several attempts, the result was to understand where the makefile file of MounRiver's tool was.

See, this is it.

Hurry up and re-decompress the downloaded file xpack-riscv-none-embed-gcc-10.1.0-1.1-win32-x64.zip. I named the main directory of the file F:\RVGCC. All subsequent operations are in this directory.

The directory of openocd is also in this directory, and the make tool is also in this directory

Ok, now it can be compiled.

First, set the directory path

set PATH=%PATH%;F:\RVGCC\bin;F:\RVGCC\BTools\bin;F:\RVGCC\OpenOCD\bin

2. Find the project directory path

cd  F:\MounRiver\MounRiver_Studio\workspace\CH32V103C8T6

3. Compilation

make clean
make -j8 all

First clear the files generated by the original tool. Then compile

There is a warning, ignore it. It appears because it does not meet the c standard

Find CH32V103C8T6.hex and burn it to the development board for testing

Thank you! Everything is normal, and I have seen the flashing LED and printf information. Maybe this experiment is successful. Of course, the warnings that appear need to be tested to see if they have any impact on the program. I will give you a serious conclusion. These days, accessing foreign websites is really slow. It is very painful. So the following experiments still require great courage.

This post is from Domestic Chip Exchange

Latest reply

Like, save it first, and learn slowly in the future, come on rookie!!!   Details Published on 2024-9-6 11:47
 
 

2865

Posts

4

Resources
2
 

I really hate the Eclipse-based toolchain. There are two problems that I really can't stand!

1. It starts slowly and consumes memory.

2. It is annoying to see the project files piled up on the screen.

Of course, the syntax prompts of the ide itself are also relatively weak, but they can be used.

I plan to switch to vscode! I will give it a try after the test goes well.

This post is from Domestic Chip Exchange
 
 
 

36

Posts

0

Resources
3
 

I used Ide when testing. I am used to vscode, but I am not used to this ide yet.

This post is from Domestic Chip Exchange
 
 
 

2865

Posts

4

Resources
4
 

The latest tested version cannot be used! After testing, it is abnormal when using interrupts. After the program enters the interrupt, it is only executed once and cannot be interrupted next time. I don’t know what caused it.

This post is from Domestic Chip Exchange
 
 
 

2865

Posts

4

Resources
5
 
The latest tested version cannot be used! After testing, it is abnormal when using interrupts. After the program enters the interrupt, it is only executed once and cannot be interrupted next time. I don’t know what caused it.
This post is from Domestic Chip Exchange
 
 
 

2865

Posts

4

Resources
6
 

After disassembly comparison, the reason why it cannot be compiled is found!

The interrupt program return assembly instruction compiled by the machine's own compiler is 26: 30200073 mret

The new version of the compiler cannot recognize the attribute assembly instruction in void EXTI0_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));

32: 8082 ret

Therefore, the interruption cannot be returned!

This post is from Domestic Chip Exchange
 
 
 

2865

Posts

4

Resources
7
 
void NMI_Handler(void) __attribute__((interrupt("machine")));
void HardFault_Handler(void) __attribute__((interrupt("machine")));
void EXTI0_IRQHandler(void) __attribute__((interrupt("machine")));


//void NMI_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
//void HardFault_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
//void EXTI0_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));

Now the test is OK after modifying the program. No problems have occurred.

This post is from Domestic Chip Exchange
 
 
 

7422

Posts

2

Resources
8
 

RISC-V has a bright future

This post is from Domestic Chip Exchange
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

409

Posts

0

Resources
9
 

Like, save it first, and learn slowly in the future, come on rookie!!!

This post is from Domestic Chip Exchange
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list