-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RISC-V from scratch 1: Introduction, toolchain setup, and hello world! #7
Comments
in the code snipped change:
to
thanks for this awesome guide! I especially love part deux =) |
@DyslexicAtheist, thanks for the kind words! Glad you enjoyed it. Fixed with 2f9ed76. |
Ran into the following error when running the helloword executable:
Any suggestion? |
One little issue, according to their README.md
by default compiles only the hello program, not all the example programs |
@limslarmo, turns out the issue you encountered is due to a bug introduced into QEMU. Someone has created a patch to fix the problem, but it hasn't yet been merged. See this comment for more information. Getting this example running is unnecessary to progress in future posts, so don't worry too much about it. In the meantime, I've updated the post to note that the freedom-e-sdk "hello world" program won't work for now: dae59ca Thanks for the correction on |
Thanks!! |
Hey, I am having issue while using for sifive-hifive1 , the error comes like error finding bsp for sifive-hifive1 I havee also tried using the bsp directory, and simply make or make software. |
Hey @yashomer1994 - sorry you're having troubles. Could you post the exact error you're getting? What OS are you running? The freedom-e-sdk appears to change very quickly, making it hard to keep the instructions up to date. It might be worth opening an issue in their repository, as the instructions provided in my guide appear to mirror those they suggest. Also, running this example is unnecessary to continue on in the series, so don't let it hold you back unless you're really keen on getting it working :) |
Hey, Ya I solved the problem redoing everything on fresh terminal, now its working perfectly emulated easily on Qemu. Thanks |
Hi, I have installed Qemu (on Linux Mint) and I have a bunch of system installed, but no risc-v ones. Is that normal ? Where should I get the qemu-system-riscv32 machine ? |
Hey @oliverbm67. What happens when you run
The RISC-V port of QEMU was upstreamed to QEMU proper, so installing QEMU via the means specified on their website should give you this command. If this isn't the case, or if my instructions are generally unclear, let me know so I can fix them up 🙂 |
Hey @twilco ! I installed qemu with EDIT : I uninstalled qemu and reinstalled by compiling the latest version from source and solved the problem. The issue is on the qemu website, not in your tutorial. The version in the repo is outdated. |
Yep, according to this blog post, QEMU 2.12.0 is the first official release to contain RISC-V. Glad you got it figured out! |
I tried using file IO and I am unable to succeed. printf("Hello, World!\n"); if(fp==NULL)
|
Hey @balaji-ch! When printf("Hello, World!\n");
FILE *fp;
fp = fopen("test_rv.txt", "w+");
if (fp == NULL) {
printf("Unable to open the file \n");
}
printf("Testing ---- After ! \n");
printf("%d\n", errno); |
I got Function not implemented error. Code: ' FILE *fp; if(fp==NULL) printf("Testing ---- After ! \n"); Output: Hello, World! |
Ah, so what you're making use of in that example is the freedom-e-sdk, and it sounds like they haven't yet implemented |
Could there be any other emulator where I can use FILE I/O s ? |
I'm not sure, sorry @balaji-ch. I do think your best bet is opening an issue in the freedom-e-sdk repository. I think they could tell you more about your issue with |
RISC-V from scratch 1: Introduction, toolchain setup, and hello world!
A post that discusses what RISC-V is and why it's important, teaches readers how to install the GNU RISC-V toolchain, and walks through building and running a simple C program on emulated RISC-V hardware.
https://twilco.github.io/riscv-from-scratch/2019/03/10/riscv-from-scratch-1.html
The text was updated successfully, but these errors were encountered: