Forum Discussion
Getting started with bare-metal application development with the Cyclone V
First post!
Hello fellow FPGA enthusiasts. This is my first foray into the wide world of SoC development. A bit of background. I'm pretty much fresh out from University and work for a consumer product development firm. I'm a fairly good C coder. I did mess around with Verilog in school on a Spartan-3E FPGA but it never got very complex and thats been a few years. Anyway, I've been instructed to build familiarity with the Cyclone V. I was given the helio cyclone v soc evaluation board. My question is this, How do I get started? The quick start guide that comes with the device pretty much only tells me how to get started with Linux. I'm looking to start some tutorials that will help me blink some LED's or write 'Hello World' out a serial port. I've searched around and haven't found anything that useful. I've got Quartus installed but haven't been able to use it yet. Where can I get sample code to run? This looks pretty overwhelming from where I sit. Thank you so much for helping out a newb. I did try and search the site for questions of this nature and didn't have much luck.14 Replies
- Altera_Forum
Honored Contributor
First off, I would be spending lots of time on rocketboards.org if I were you (there's a getting started link for your board there).
Baremetal: I would recommend using u-boot as a basis for any "stand alone" baremetal coding. It is straightforward to modify and has a large user base. You might also be able to make use of the DS-5 examples here. For production, I don't recommend using anything other than Linux on the ARM SoC. Yes, it is possible, but it is non-trivial. - Altera_Forum
Honored Contributor
--- Quote Start --- First off, I would be spending lots of time on rocketboards.org if I were you (there's a getting started link for your board there). Baremetal: I would recommend using u-boot as a basis for any "stand alone" baremetal coding. It is straightforward to modify and has a large user base. You might also be able to make use of the DS-5 examples here. For production, I don't recommend using anything other than Linux on the ARM SoC. Yes, it is possible, but it is non-trivial. --- Quote End --- Thank you for your quick reply Mr. Slacker, I started with rocketboards.com and the quick start guide pretty much tells me how to get Linux up and running on the Cyclone V. In our application we will not be using Linux at all. We pretty much can't, which is unfortunate. I have messed around with U-Boot with the i.MX6 and I don't see how that is going to help me learn the Cyclone V system. UBoot can be used to boot bare metal code but doesn't help learning how to write bare metal code. - Altera_Forum
Honored Contributor
u-boot is, itself, "baremetal" code. You can build on the example apps that are shipped with u-boot and/or extend the console UI to test what you'd like to test by adding your own "cmd_" files or adding to what's already there (hint: look at the "common" subdir for examples there).
You can also make use of the HWLibs examples that are shipped with Altera's SoCEDS (@ $SOCEDS_DEST_ROOT/examples/software/Altera-SoCFPGA-HardwareLib-16550-CV-GNU.tar.gz, for example) as a starting point. HWLibs are intended to provide a common abstraction for accessing all of the peripherals (browse the source to see what's supported at this point in time or post here with what you/you'll need.) There's a description of how to import these examples into the DS-5 IDE in the SoCEDS User's Guide. You can make use of either HWLibs or u-boot as a starting point. u-boot supports more peripherals at this point in time, but may use too many of the "Linux or Linux-like" abstractions for your liking. HWLibs is designed to provide a portable, simple API to common peripherals on an SoC device. I would try both and see which you prefer. Mind you that "baremetal" usage for these cores (or any Cortex-A series) is not recommended. Do you want to (for instance) split up the two cores and run separate baremetal (while 1()) applications on each? If so, then you are "by design" throwing away a fair amount of the advantages that come with a Cortex-A class processor. I hope that helps a bit...and Good luck! slacker - Altera_Forum
Honored Contributor
Thanks again for replying so fast slacker man.
You're right U-Boot is bare metal code. I guess I'm just a bit overwhelmed with everything. I'm trying to look for something that will let me start playing with examples. Lets say you were just starting out with the Cyclone V, what would you do? Are there basic bare-metal tutorials in existence? They have to be really really basic as I've never coded in VHDL OR coded with an Arm Processor. We have to certify all the code that goes on the ARM and Linux can never be certified so that's whey we can't use it. I'm really a hardware guy but I'm looking to get int SoC's. What I don't know :- How the ARM interfaces with the FPGA
- How to assign pins to VHDL code
- Running anything on my Eval Board
- Altera_Forum
Honored Contributor
People discount bare metal development, but anything that needs higher levels of certification won't be using Linux so far as I've been able to tell. Lot of cars and planes out there to casually dismiss the bare metal market... Not to mention medical devices, factory/robot automation controls, etc.
I'm somewhat in your position. I'm a software guy that needs to look into the FPGA end. I haven't seen anything special about ARM that would make it harder to do bare metal development than any other modern chip. Not simple but certainly doable. The software documented in C:\altera\13.1\embedded\altera\hps\altera_hps\doc would be a good place to start. Also look in the Altera EDS documentation. The ARM interfaces to the FPGA over AXI 3. Altera provides IP which will can convert it to the Avalon bus used in Nios. I've decided to use Avalon because it looks simpler than AXI. See the Avalon bus specification for details. I'm planning to create a component in QSYS with a slave Avalon interface. I'm currently trying to write some Verilog code to talk to the ARM. You assign pins to your FPGA with a sdc file. There are plenty of examples for that. Don't restrict yourself to looking at the Helios board only. I've been writing my code and FPGA images to an SD card. The preloader programs the FPGA at power on, then runs my ARM code. Lots of examples on how to do this too. - Altera_Forum
Honored Contributor
Well, I can now at the very least blink an LED on my Helio board when I push a button. This tells me I have it hooked up correctly and have an extremely basic yet correct understanding of Quartus II! This is only using the FPGA but at the very least it is a start. :)
- Altera_Forum
Honored Contributor
--- Quote Start --- Thanks again for replying so fast slacker man. You're right U-Boot is bare metal code. I guess I'm just a bit overwhelmed with everything. I'm trying to look for something that will let me start playing with examples. Lets say you were just starting out with the Cyclone V, what would you do? Are there basic bare-metal tutorials in existence? They have to be really really basic as I've never coded in VHDL OR coded with an Arm Processor. --- Quote End --- Yes, the bare-metal tutorials are in the examples directory that I mentioned in my last post. They are documented. There is one hardware reference design called the GHRD or GSRD. --- Quote Start --- We have to certify all the code that goes on the ARM and Linux can never be certified so that's whey we can't use it. I'm really a hardware guy but I'm looking to get int SoC's. What I don't know :- How the ARM interfaces with the FPGA --- Quote End ---
- How to assign pins to VHDL code --- Quote End ---
- Running anything on my Eval Board --- Quote End ---
- Altera_Forum
Honored Contributor
Thanks so much!
I'll probably need a bit to digest all of this and run through those tutorials. But I just wanted to pop on and say thank you! - Altera_Forum
Honored Contributor
--- Quote Start --- Thanks so much! I'll probably need a bit to digest all of this and run through those tutorials. But I just wanted to pop on and say thank you! --- Quote End --- Hi ttustudent, Have you made any progress yet? Could you please share your experience with us? I'm in a similar situation like you when you started this post. Thanks - Altera_Forum
Honored Contributor
Hi there,
I am looking for the same. Any updates/news here? Thanks, Marcelo.