Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Attached is a process for launching and debugging a bare-metal app. I believe the document came from an Arrow/ARM workshop and I have modified it to make sense to me, and have removed those parts that I did not need. Also attached is a zip file with about 40 examples. The one used in the procedure is called "Altera-Cyclone-V_RAM," which runs a Hello World app from RAM on a dev board. This was intended for the Altera SoCkit board, but I believe you can easily adapt it to other dev boards. You will need ARM's DS-5 Altera Edition software, also known as Eclipse apparently. I don't know if straight DS-5, not Altera Edition, will work.

    The zip file came from an Arrow/Altera FAE. Keep in mind, the process in the .docx shows you how to run the app in debug. I have not figured out how to run the app in Release mode, or how to cause the board to boot and run the code by itself, presumably from the QSPI flash. Please let me know if you know how to do that.

    Ron
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Here are some other bare-metal resources I found:

    getting started with arm ds-5

    http://ds.arm.com/developer-resources/tutorials/getting-started-with-arm-ds-5-development-studio/

    Some good getting started info on DS-5, like licenses, creating a bare metal app from scratch. Goes thru building an output image, but not downloading to the board and running.

    Goes into "Debugging the application on a Fixed Virtual Platform (FVP)".

    launch and debug a bare metal application on the arrow sockit board

    http://rocketboards.org/foswiki/view/projects/launchanddebugabaremetalapplicationonthearrowsockitboard

    I sometimes had some odd problems in DS-5 with this process, like I was getting "Target Message: Count not determine target state."

    building bare-metal applications in ds-5 using gcc compiler

    http://ds.arm.com/debugging-bare-metal-applications-on-fvps-using-ds-5-and-gcc-compiler/

    Uses GCC compiler but recommends ARM Compiler.

    tutorial: altera cyclone5 soc baremetal from scratch, from sam skalicky

    https://samskalicky.wordpress.com/2014/06/06/tutorial-altera-cyclone5-soc-baremetal-from-scratch/

    May be a good procedure but includes no content for a C file. I added my own Hello World C file.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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 ---

    Easier way is to follow some example design walk through from the soc eds guide document. You will able to get more idea from there.

    https://www.altera.com/literature/ug/ug_soc_eds.pdf
  • Assistance Needed: Trouble Running Bare-Metal Code on Cyclone 5 HPS
    I am working on intel cyclone 5 hps I have two cores in a processor Core 0 core 1, I want two code to run on two different cores core 0 and core 1 in bare metal .


    When I run in jtag mode it works, for jtag i first debug using core 0 where i take core 1 out of reset it, than debug core 1 usign jtag it work


    BUT, When i want to run both core usign qspi it only run core 0 not core 1


    Here is the step i followed

    Firsly, loading preloader
    quartus_hps -c 1 -o P preloader-mkpimage.bin

    I make an image from bin file of core 0 and place it to qspi

    mkimage -A arm -O u-boot -T standalone -C none -a 0x00060000 -e 0 -n "baremetal image" -d core0.bin core0.img

    quartus_hps -c 1 -o P -a 0x00060000 core0.img

    I make an image from bin file of core 1 and place it to qspi
    mkimage -A arm -O u-boot -T standalone -C none -a 0x00100000 -e 0 -n "baremetal image" -d core1.bin core1.img
    quartus_hps -c 1 -o P -a 0x00100000 core1.bin


    When i restart board only that code work which is in core 0, core 1 code not executing

    I am setting cpu1startaddress 100000 apart from that in the code of core 0 also i am using alt_qspi function to to place bin file data in ddr,

    I want to run in smp mode so I also set required aux_control_register smp and fw bit as stated in tech ref manual


    alt_qspi_read((uint32_t *)BL_START/*ddr3 address*/, 0x100000/*qspi address*/, 0x40000);


    In linker/scat file core 0 entry point is 0x60000 and

    linker/scat file core 1 entry point is 0x100000