element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Raspberry Pi 2 Model B Bare Metal Reference Design
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 10 replies
  • Answers 5 answers
  • Subscribers 663 subscribers
  • Views 1917 views
  • Users 0 members are here
  • raspberry_pi
Related

Raspberry Pi 2 Model B Bare Metal Reference Design

brettacook
brettacook over 6 years ago

I've been searching the web for the past day and I must just not know where to look.  I can find bare metal examples for the Raspberry Pi (1) and the Raspberry Pi 3, but I have been unable to find any blogs, posts, forums, etc that have references for bare metal examples for the Raspberry Pi 2.

I went so far as to try building the Raspberry Pi reference design I found, but regardless of what I did after building it, I couldn't get my Raspberry Pi 2b to actually boot it.

 

Just in case there's confusion, I'm not looking to boot Linux, but rather to create a simple few lines of code to just flash the LED. If I can do this, I can expand to whatever I want since i'll know how to get the bootloader (in the GPU) to work for me.

 

I'm a NOOB with the Raspberry Pi, but I've been doing embedded systems for a long time.  If there's anyone out there that can point me to the right place, I know I can figure it out.

 

Thanks in advance for any and all suggestions.

  • Sign in to reply
  • Cancel
  • Gough Lui
    0 Gough Lui over 6 years ago

    Not sure if this is what you are after, but perhaps give this one a go:

    https://github.com/dwelch67/raspberrypi/tree/master/blinker02

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • shabaz
    0 shabaz over 6 years ago

    Hi Brett,

     

    There is a wikibook for it here: https://en.wikibooks.org/wiki/Bare-metal_Raspberry_Pi_Programming

    I can understand it for academic purposes, but otherwise bare metal on the Pi is likely to end up vastly under-using the Pi, and doesn't easily allow the use of libraries of code (that rely on Linux being the OS). The chip on the Pi is designed to run an OS (as opposed to a microcontroller which of course can still run an OS, but has hardware facilities/resources designed for smaller OSs or bare-metal.

    If you wish to flash an LED in assembler or in C code, that is possible under Linux too. If you're looking for real-time behavior, that is just as easy or just as difficult bare-metal, as it is under Linux.

    Anyway, it is certainly feasible to go bare-metal on the Pi if you wish. There is also a combined bare-metal and assember forum, there seem to be posts regarding tutorials on bare-metal: https://www.raspberrypi.org/forums/viewforum.php?f=72&sid=12f91dca053fc05f8a82644c6ed66099

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • brettacook
    0 brettacook over 6 years ago in reply to shabaz

    shabaz, thanks for the information.  And yes, I understand that I can blink an LED under Linux.  However, the one thing I can't do under Linux is understand how the bootloader works (which is the root purpose behind my question).

    As for the forum reference, that's what I was referring to when I said I've been searching for the past couple days - it's easy to find RPi3 references, but RPi2 seems more difficult to locate.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • brettacook
    0 brettacook over 6 years ago in reply to Gough Lui

    Gough,

    Thanks for the reference - I'll take a look at all of the projects in that tree and see if I can find one that will help.  The README on the one that you suggested indicates that there's a RPi2 version, but indicates that it's in a directory that is not present at that link.

    I will post again when I've looked through all of the projects on there - hopefully there's one that contains the RPi2 stuff :-)

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Gough Lui
    0 Gough Lui over 6 years ago in reply to brettacook

    Whoops - sorry, copy and pasted the wrong link:

    https://github.com/dwelch67/raspberrypi/tree/master/boards/pi2

     

    That's probably the one you need image

     

    - Gough

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • brettacook
    0 brettacook over 6 years ago in reply to Gough Lui

    Hi Gough!

     

    That looks exactly like what I was looking for.  I'll try it out this weekend (wish I had time to do it now) and let you know how it goes.

     

    Any tips on how you found it?  I'm sure at some point I'll have a RPi 3 (or later when they make one) and will probably be back to the same thing.

     

    Again, thanks so much - I was starting to think the information wasn't out there or was just hidden so well I'd never find it :-)

     

    Brett

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Gough Lui
    0 Gough Lui over 6 years ago in reply to brettacook

    Dear Brett,

     

    No specific hints, but I saw that the latest commits by dwelch67 referenced the pi2:

    thanks to ultimo and others I think I have the pi2 switching back to …

     

    …svc and secure mode now.

     

    and other cleanup

    I checked the file changes and stumbled upon the /boards/pi2 area which gave away the location which was where the previous example's README should have pointed to, along with the /SVC subdirectory where pi2-specific versions of the examples reside. The diff shows the changes, I presume, from the previous pi2 code which probably had the pi2's CPU running in a different mode.

     

    - Gough

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • rew
    0 rew over 6 years ago

    Hi Brett,

    The "rpidmx512" project is bare-metal and works on raspberry pi 2. So google for the term download the sources and look around. There are also prebuilt images, so that you can test the code to eliminate "compiler issues".

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • ggabe
    0 ggabe over 2 years ago

    So much changed since then - now we have Circle, a really mature RPi BM framework. Posted about it a /technologies/code_exchange/b/blog/posts/going-bare-metal-on-raspberry-pi-431574917

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • colporteur
    0 colporteur over 2 years ago in reply to ggabe

    I'm not sure if you are aware but the post you made is to content that is five years old. I see by your membership points you are a new member. The anomaly of an old post suddenly looking like there new is a gremlin that continues to haunt the site. I myself have posted to aged out content because it suddenly appeared and it was a topic of interest. Unless you were reviewing old material and thought to post on something, my comments may be unnecessary.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube