raspberry pi 2 bare metal


3 posts
by sami055 » Wed May 31, 2017 8:35 pm
i purchased a raspberry pi 2 B model
i know that it support operating system but i do not need that for my application
i only want to use the usb ports of the board
how i can program the board in bare metal e.g hardware level
where should i begin
i programmed pic microcontrollers before using C language but i know it is not the same
i need some guidance :?
Posts: 3
Joined: Wed May 31, 2017 7:59 am
by Ultibo » Thu Jun 01, 2017 12:28 pm
sami055 wrote:where should i begin ... i need some guidance :?

The best place to start is to have a look at the Bare Metal resources post in this forum which lists lots of projects, examples and information that you can begin with.

Throughout this forum you will find many projects and examples in Assembler, C, C++, Pascal and possibly even other languages which you can either use as a base for your own project or as a reference to learn from.

Many of the projects include very functional implementations of hardware drivers like USB etc so you should spend some time exploring what others have already done.

Hope you find what you are looking for.

PS. In case you are wondering, Ultibo is the Pascal bare metal platform ;)
Ultibo.org | Make the future
https://ultibo.org
User avatar
Posts: 84
Joined: Wed Sep 30, 2015 10:29 am
Location: Australia
by Gavinmc42 » Fri Jun 02, 2017 2:11 am
Personally I prefer Ultibo, most baremetal is too bare for me as I am using it instead of an OS.
So if development speed is an issue, Ultibo comes with a lot out of the box.
Very easy to get up and running.
And you can use the normal Lazarus/FPC to code in Raspbian, or Linux or Windows.

But of the C baremetal stuff this is the only one with USB, I think?
https://github.com/rsta2/circle
It is C++ but the object stuff makes it more modular.

I have always found C++ a big step up from C.
Free Pascal seems to fits between C and C++ in complexity.
Give me a few more years of Pascal coding, I might be ready for C++ :oops:

USB port programming is tricky too, anything not a standard MSD, HID or UART may cause problems for you.
Writing USB drivers are not easy even in Windows and Linux.
If you have Linux C source it would/should be easy to port to Circle.
Start here? https://github.com/rsta2/uspi
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
User avatar
Posts: 1287
Joined: Wed Aug 28, 2013 3:31 am