skypi
Posts: 107
Joined: Sat Aug 09, 2014 11:48 pm

Raspberry Bare Metal in The Arduino environment?

Mon Mar 14, 2016 10:02 pm

Raspberry Bare Metal in The Arduino environment?

I was impressed with the work done to bring the esp8266 into the arduino ide.

Is it not possible to do the same with the raspberry... (and extra libraries on top for driving the gpu and hdmi display and audio etc.)

that would be super awesome for the Pi Zero! (Made in UK for only double the price of a Chinese arduino nano clone, are the zero's made in UK?)

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Raspberry Bare Metal in The Arduino environment?

Mon Mar 14, 2016 10:29 pm

Something similar (but the reverse) was proposed here. It was a good idea, but never really developed (the paywall for further information put me off). The end goal (I think) was to enable Arduino sketches to run on the Pi (which probably would have only supported the most basic of Arduino functions).
Integrating the PI's capabilities into the Arduino IDE framework would be nice (wiringpi implements a great deal of the methods/functions already).

HankB
Posts: 123
Joined: Fri Jan 01, 2016 2:45 pm

Re: Raspberry Bare Metal in The Arduino environment?

Tue Mar 15, 2016 2:29 am

They're really different environments. The Arduino is a chip with essentially no OS and a bunch of GPIO and Analog inputs. You can buy a chip for a couple bucks, program it in an Arduino Uno and put it in a relatively bare board, solder on a few bits and have a device. There's a pretty nifty IDE for the Arduino that works well as long as you can program in C/C++.

The Raspberry Pi is a full blown PC with I/O to support keyboard, monitor/display, networking, mass storage, camera and probably lots of other USB devices. It can self host development in a wide variety of interpreted and compiled languages. It has some GPIO capabilities but no analog inputs. It is not feasible to program the processor and install it in another board to make a device. The Zero and Compute modules come the closest to filling that need.

It would be interesting to port some of the Arduino libraries to the Pi. It would support development of Arduino sketches on the Pi where debugging is better supported. However it would never be an Arduino and for some things like real time response or analog inputs the Arduino will run circles around the Pi. Migrating Pi stuff to the Arduino is simply not possible. (I hate to be absolute. Before someone says "Oh yeah..." I'll just say "ridiculously difficult.")

It would be possible to operate the Pi like an Arduino - without an OS and provide real time capability. I haven't heard of any such project. It would also seem to be cost foolish as much of the peripheral H/W would remain unused. And the chip would require a *lot* more library than the Arduino as the on-chip peripherals are a lot more involved to configure.

One thing both have in common is a great community around them. There are other devices that don't have that and are consequently more difficulty to work with.

They're both great devices for what they are suited for and I enjoy working with both and with no desire to make one into the other.


skypi
Posts: 107
Joined: Sat Aug 09, 2014 11:48 pm

Re: Raspberry Bare Metal in The Arduino environment?

Tue Mar 15, 2016 7:54 pm

Sorry about the duplicate post, spotted the Bare metal forum after posting here so posted there as well.

The whole point about porting the arduino libraries to compile to ARMN via GCC would be that you had the full power of the GPU and the CPU and no operating system so totally real time and just burn the compiled .img to an sd and you are running. All available memory and all CPU/GPU power.

(I guess the low level usb protocol to external a/d converters is reasonably straightforward, and can be done via dma?)

However you would be missing all those awesome linux utility libraries that depend on linux os calls.

Would its benefits as a teaching aid justify the work required?

Heater
Posts: 12955
Joined: Tue Jul 17, 2012 3:02 pm

Re: Raspberry Bare Metal in The Arduino environment?

Tue Mar 15, 2016 7:56 pm

Nah, just hang a real Arduino off of a Pi and run the Arduino IDE on the Pi.

skypi
Posts: 107
Joined: Sat Aug 09, 2014 11:48 pm

Re: Raspberry Bare Metal in The Arduino environment?

Tue Mar 15, 2016 9:05 pm

Heater wrote:Nah, just hang a real Arduino off of a Pi and run the Arduino IDE on the Pi.
Well my angle is the whole signal processing thing with offloading to a gpu (fast-fft in hq, or dft even) as well, how does that hang together in a single threaded environment? dma?

and HQ external AD converters would make for an ultimate "stomp-box" with graphics/visuals/sound-to-light development platform using arduino ide compiled to bcm whatever bootable .img....

I already see several awesome "stomp-boxes" (as long as you want added "fuzz" effect) just using atmega a/d converters....

[EDIT] and on an arduino theme... interesting to compare sparkfun and adafruit arduino libraries (both undoubtedly the great drivers of the awesomeness of arduino along with the Chinese...) I reckon adafruit overdo it a bit (but very cool) for the capabilities of the device, and sparkfun are raw utilitarian.... so I like both, but rate sparkfun over adafruit (for the sphere they occupy... like outer-space scale LOL)!
Last edited by skypi on Tue Mar 15, 2016 9:38 pm, edited 1 time in total.

ghans
Posts: 7867
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Raspberry Bare Metal in The Arduino environment?

Tue Mar 15, 2016 9:26 pm

Perhaps have a look at "Ultibo" :

www.ultibo.org

It's written in FreePascal , though.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

HankB
Posts: 123
Joined: Fri Jan 01, 2016 2:45 pm

Re: Raspberry Bare Metal in The Arduino environment?

Tue Mar 15, 2016 11:33 pm

ghans wrote: It's written in FreePascal , though.
And looks like it only runs on Windows.

Otherwise looks interesting and suitable for running the Pi as an embedded system vs. a PC

ghans
Posts: 7867
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Raspberry Bare Metal in The Arduino environment?

Wed Mar 16, 2016 6:23 am

They're completely open-source , including their
fork of the Lazarus IDE , so you could always compile it
for Linux.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

EikeTrumann
Posts: 1
Joined: Wed Feb 08, 2017 12:21 am

Re: Raspberry Bare Metal in The Arduino environment?

Wed Feb 08, 2017 12:26 am

If anybody is still interested in this topic it seems some unexpected player made the software to do this: Microsoft. On the 2B and 3B Raspberry Pi you can run Windows IoT Core supporting the use of Arduino code. However other than including existing Arduino code I don't see why anyone should want the overhead of running Windows on the Raspberry Pi to get this functionality.

ghans
Posts: 7867
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Raspberry Bare Metal in The Arduino environment?

Wed Feb 08, 2017 11:45 am

I wonder if this solution can circumvent the timing issues the "RasPiArduino" project has , seeing that Windows 10 IoT is not an RTOS either.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Return to “General discussion”