What is the current status of Risc-V Target? lazarus / 77-Embedded ---------------------------------------------------------------------- MiR · 2019-11-02 14:09 I just received a few cheap Risc-V boards from China: https://www.seeedstudio.com/Sipeed-Longan-Nano-RISC-V- GD32VF103CBT6-Development-Board-p-4205.html https://www.seeedstudio.com/Sipeed-Maixduino-for-RISC-V-AI- IoT-p-4046.html does anybody know what the status of the Risc-V Target is? It looks like on the extra branch for this there was no activity for nearly a year. Is the target already useable? MiR ---------------------------------------------------------------------- marcov · 2019-11-02 14:16 The riscv branch was merged into trunk on sept 28th, 2018. So that branch is now stale. I don't know what the exact status of the risc port is. ---------------------------------------------------------------------- MiR · 2019-11-02 14:19 Good to know, I just followed the documentation in the wiki and that still points to the extra branch(es) ---------------------------------------------------------------------- Laksen · 2019-11-02 14:21 I would consider the RISC-V 64 bit target in trunk basically working. It's not tested nightly due to lack of hardware. RISC-V 32 bit is not tested and cleaned up, but might work. Once hardware, like the Sipeed stuff, starts becoming available it will get worked on ---------------------------------------------------------------------- MiR · 2019-11-02 14:24 Sounds good, I will give the 64bits version a try.... MiR ---------------------------------------------------------------------- _Bernd · 2019-12-28 00:55 I am testing RISC-V 32 embedded with PicoRV32 in a FPGA. Basic stuff seems to work. Nice :-) Regards, Bernd. ---------------------------------------------------------------------- PascalDragon · 2019-12-28 08:19 Quote from: _Bernd on December 28, 2019, 01:55:33 amI am testing RISC-V 32 embedded with PicoRV32 in a FPGA. Basic stuff seems to work. Nice :-) If you discover problems, don't hesitate to report them, cause while I got riscv64-linux working, riscv32-linux aborts with a segmentation fault when initializing the standard input/output, so there is probably still some problem with code generation (if I had to guess I'd say parameter passing with var parameters as it fails in Assign when accesing the file record). ---------------------------------------------------------------------- MiR · 2019-12-28 08:29 I also started work, implemented controller units for the logan nano and the hifive rev b board. i have yet to understand how interrupts work on those chips..... ---------------------------------------------------------------------- _Bernd · 2020-08-09 20:51 I wonder, if someone was successful with the GD32VF103 controller. I had to make two small modifications to the riscv32 rtl startup code, to get programs run on a GD32VF103 controller. The first entry in the interrupt vector table did not contain a jump to the startup code location. Starting a program via the internal boot loader then worked, but running a program at power on reset failed. At power on reset, the controller starts executing at address 0x00000000, but the flash start address is 0x08000000 (both address ranges point to the same physical memory) for which the program is correctly linked. The startup code now checks, if the program counter is below 0x08000000 and switches to 0x08nnnnnn if needed. Regards, Bernd. ---------------------------------------------------------------------- _Bernd · 2020-08-15 22:25 Quote from: PascalDragon on December 28, 2019, 09:19:07 amIf you discover problems, don't hesitate to report them, cause while I got riscv64-linux working, riscv32-linux aborts with a segmentation fault when initializing the standard input/output, so there is probably still some problem with code generation (if I had to guess I'd say parameter passing with var parameters as it fails in Assign when accesing the file record). The following program fails on the GD32VF103 controller. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program test;{$mode objfpc}{$H-}var   s: ShortString; procedure TestShortString(sIn: ShortString);var   b: Byte;begin   b:= Ord(sIn[1]);  // b = 'L' = 76   if b <> 76 then begin      { executes here! }      repeat      until FALSE;   end;   asm      ebreak;   end;end; begin   s:= 'Laberhannes';   TestShortString(s);end.  Something seems to go wrong with the local copy of the shortstring  variable sIn. If sIn is declared as var, then the program runs correct. Regards, Bernd. ---------------------------------------------------------------------- MiR · 2020-11-24 09:15 Espressif will base a new esp32 version on riscv32: https://hackaday.com/2020/11/22/espressif-leaks-esp32-c3-a-wifi-soc- thats-risc-v-and-is-esp8266-pin-compatible/ ---------------------------------------------------------------------- MarkMLl · 2020-11-24 11:45 I was just wondering the other evening how much work would be involved in modifying the Escape DLX simulator that Jonas et al. contributed a few years ago for RISC-V. https://github.com/jmaebe/ESCAPE MarkMLl ---------------------------------------------------------------------- _Bernd · 2021-01-17 19:19 Hello, I am currently porting a project (about 10000 lines of code) from AVR to STM32F103/ARM Cortex M3 and simultaneously to GD32VF103/RISC-V/RV32IMAC and this goes pretty well. In my opinion, the state of the RISC-V compiler is surprisingly good. Hut ab ;-) There is a minor issue concerning interrupts (https://bugs.freepascal.org/view.php?id=38348). When the non vectored interrupt feature of the GD32VF103 interrupt controller is sufficient, then Pascal interrupt procedures are working. In vectored mode, one could write inline assembler interrupt routines with the nostackframe attribute. As far as I can see at the moment, the execution speed of the GD32VF103 is faster than the STM32F103.  I think the main reason for this is, that the STM32F103 needs two wait states, when the program runs from Flash. The code size is roughly twice as large for the RISC-V controller. Regards, Bernd. ---------------------------------------------------------------------- jma_sp · 2024-01-28 10:51 Hello, How can i start learning to use FreePascal for RISC-V? What are the steps to install RISC-V RTL, under what OS, How? Any advise? I have been see that fpcupdeluxe have an option to generate something... ---------------------------------------------------------------------- kupferstecher · 2024-01-29 11:28 @jma_sp, which device do you want to use? Before, I did some tests on the CH32V307, basic functionality worked. Later I ported a project to the CH32V103, basic tests also worked, but the larger project crashed repeatedly shortly after startup when powering some periphery, could be a hardware issue though. I didn't investigate further due to lack of time. The compiler I generate with a short batch file. Works quite well. If you are interested, I can share it. ---------------------------------------------------------------------- jma_sp · 2025-07-24 23:12 Starfive Vision-Five 2. It works actually with an Debian 64 bits adapted versión. Id like to use both FreePascal and Lazarus. Would aso be a great thing if where an Ultibo for those types of SBC. There are also some main boards so is a question of time  that will be Desktop computers running with RISC-V. ---------------------------------------------------------------------- Thaddy · 2025-07-25 05:41 Seems not the easiest of the bunch to start with.