2

WCH, the company behind the famous 10-cent RISC-V microcontroller, has based its RISC-V toolchain on the xPack builds from Liviu Ionescu: https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/tag/v8.2.0-3.1/

Both output the same version string:

riscv-none-embed-gcc.exe (xPack GNU RISC-V Embedded GCC, 32-bit) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

However, there are some minor differences between the RISC-V toolchain from WCH and the one from xPack. The WCH toolchain supports a few more RISC-V instruction sets, like:

  • rv32ecwx

  • rv32imacxw

  • rv32imafcxw

 
Question 1:
The 'w' and 'x' letters are non-standard RISC-V extensions. What do they stand for?

 
I also notice that the WCH toolchain has the following libraries that don't appear anywhere in the native xPack toolchain:

  • libIQMath_RV32.a

  • libprintf.a

  • libprintfloat.a

 
Question 2:
What are these non-standard libraries for? I was able to build a sample project with both the WCH toolchain and the native xPack toolchain. In both cases, the printf() function worked just fine, sending characters over the TX line. So I wonder what the libprintf.a library is used for, if the setup works without that library?

 
Question 3:
Where can I find the source code of the WCH toolchain, and the build instructions?

Thank you very much.

K.Mulier
  • 8,069
  • 15
  • 79
  • 141
  • There is a "Source code.zip" file in the github repo you linked. Maybe that is what you need. – pmacfarlane May 30 '23 at 22:58
  • Yeah, but that's for the native xPack toolchain. I need the source code (and build instructions) from the WCH toolchain. – K.Mulier May 30 '23 at 23:22
  • Whoever gave you the WCH toolchain has to give you the source code if it is GPL. You may have to ask them, since technically they only need to offer to give the source on request. – pmacfarlane May 30 '23 at 23:39
  • You are advised to post _single_ questions on SO - then you can get complete answers from users who may not know the answer to _all_ your questions. Question 3 is in any case off-topic. – Clifford May 31 '23 at 06:33
  • Hi @pmacfarlane , thank you for this insight. Is it only on request? Where did you read that? – K.Mulier May 31 '23 at 08:30
  • It's in section 3 of the [GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html). They have to give you the source, or offer to give you it. – pmacfarlane May 31 '23 at 08:44

0 Answers0