Raspberry PI and Beaglebone Black.

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: I got my brand new toys. (ARM Linux new target for fbc)

Post by D.J.Peters »

FreeBASIC on Raspberry PI with ARM6.

1920 × 1080
Image

FreeBASIC on Beaglebone Black with ARM7.

1280 × 720
Image
Last edited by D.J.Peters on Sep 25, 2017 20:35, edited 3 times in total.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: I got my brand new toys. (ARM Linux new target for fbc)

Post by BasicCoder2 »

Ok.

For someone who couldn't follow the technical stuff in this thread can I conclude that if I buy the Raspberry and install a version of Linux I will be able to run my FreeBasic programs?
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: I got my brand new toys. (ARM Linux new target for fbc)

Post by D.J.Peters »

Hello BasicCoder2
the official version of FreeBASIC is for X86 CPU's (DOS,WIN,Linux,FreeBSD,XBOX...)

I'm working currently on an emitter for ARM CPU's currently ARM6 and ARM7.

You can see on the pictures the result of -gen gcc
it works on Raspberry PI (raspbian debian linux)
and BeagleBone Black (wheezy debian linux)

A version for Angstrom it's under construction but it has bug's atm.

I will inform you all if it stable and we can publish it.

Of course if you buy a PI or BBB i can give you a betha version of fbc and the runtime libs for testing purpose.
(In general if you will use FreeBASIC on Linux you have to install some more libs also.)

Joshy
Last edited by D.J.Peters on Jul 16, 2013 8:32, edited 1 time in total.
ike
Posts: 387
Joined: Jan 17, 2011 18:59

Re: I got my brand new toys. (ARM Linux new target for fbc)

Post by ike »

Joshi that is great!

Just a question:

Is it possible to use Raspberry Pi's (or Beagle) GPIO pins to allow interface with and control of LEDs, switches, analog signals, sensors and other devices???

Ike
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: I got my brand new toys. (ARM Linux new target for fbc)

Post by TJF »

ike wrote:Is it possible to use Raspberry Pi's (or Beagle) GPIO pins to allow interface with and control of LEDs, switches, analog signals, sensors and other devices???
Speaking about BBB (but should be similar to RaspPi, since both are running under LINUX): You can control GPIO pins by a simple bash script (command line skript). And yes, you also can send the bash commands and receive the returns from a FB programm.

Theoretically (I didn't try it jet) you can write a driver in FB and control the GPIO memory directly, if you need high-speed control.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: I got my brand new toys. (ARM Linux new target for fbc)

Post by D.J.Peters »

hello ike some infos for you.

1.) All kinds of general purpose I/O's are defined as device tree under Linux.
2.) All devices under Linux are implemented as simple files. (This are one of the primary differencies between Windos and UNIX/Linux)
3.) All programing langues that can write/read files can be used to control the GPIO's.

Of course you can use all free GPIO's with FreeBASIC too.

Joshy

BBB: http://www.armhf.com/index.php/using-be ... ack-gpios/
PI: http://learn.adafruit.com/adafruits-ras ... p/overview
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: I got my brand new toys. (ARM Linux new target for fbc)

Post by D.J.Peters »

I got the fbgfx opengl driver compiled today.

I compiled and run many fb examples sucessfull.

all fbGfx examples
OpenGL, GLU, GLFW, NeHe lessons, ...
SDL (gfx, events, audio, net, ...)
Allegro
FreeType
Gtk (only "gdk/gtkgl.bi" has wrong include paths and missing #endif !!)
Threads
...

With debian for ARM CPU's you can install over 100,000 packages
looks like this are the most supported linux distro for ARM devices.

Joshy
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: I got my brand new toys. (ARM Linux new target for fbc)

Post by D.J.Peters »

Createing dynamic *.so libs for ARM works too now. (fbc -dll ...)

Joshy
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: I got my brand new toys. (ARM Linux new target for fbc)

Post by D.J.Peters »

Here are FreeBASIC for the PI ARM6 and BBB ARM7
http://www.freebasic.net/forum/viewtopi ... =5&t=21433

Joshy
Last edited by D.J.Peters on Jan 30, 2014 16:30, edited 2 times in total.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC ARM6/7 for the Raspberry PI and Beaglebone Bla

Post by D.J.Peters »

Beaglebone Black ubuntu precise 12.04
1280 × 720
Image

Joshy
Last edited by D.J.Peters on Sep 25, 2017 20:36, edited 4 times in total.
v1ctor
Site Admin
Posts: 3804
Joined: May 27, 2005 8:08
Location: SP / Bra[s]il
Contact:

Re: FreeBASIC ARM6/7 for the Raspberry PI and Beaglebone Bla

Post by v1ctor »

That´s great to see FB running on ARM. With even gfxlib working fine!

Congratulations Joshy, TJF and everybody else involved!

I guess we could now add the ARM port to FB's source tree, but that depends on dkl or counting_pine that are maintaining the project.
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: FreeBASIC ARM6/7 for the Raspberry PI and Beaglebone Bla

Post by TJF »

v1ctor wrote:Congratulations Joshy, TJF and everybody else involved!
Yes, thanks!

But congratulations also to dkl, who made the C emitter working well now. That was the basis for our success.
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: FreeBASIC ARM6/7 for the Raspberry PI and Beaglebone Bla

Post by dkl »

Hey D.J.Peters, could you please post your source code modifications too? I'm very interested in the changes to the makefile, -arch options, ARM linking process and pre-#defines.

For cross-compiling from x86 Linux to ARM Linux, I think we can use "fbc -target arm-linux-gnueabi[hf]" and a /usr/local/lib/freebasic/arm-linux-gnueabi[hf]/libfb.a directory, matching the arm-linux-gnueabi[hf]-gcc cross-compiler toolchains.

But what about cross-compiling from Win32 to ARM Linux, is it enough to use -arch arm and lib/arm-linux/libfb.a, or does it need to be more specific, like -arch arm6 and lib/arm6-linux/libfb.a.

What about soft-float/hard-float anyways, should we have more -arch options to distinguish that, or use a separate command line option like -x hardfloat?
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC ARM6/7 for the Raspberry PI and Beaglebone Bla

Post by D.J.Peters »

v1ctor wrote:I guess we could now add the ARM port to FB's source tree ..
dkl wrote:Hey D.J.Peters, could you please post your source code modifications too?...
Currently it's only a binary download for testing purpose.
I found and changed most part's but not all where -gen gcc emitts x86 assembler code.
I change the missing parts by hand before I build fbc on the ARM target.

The makefile file is a modify version too.
I added -D DISABLE_PORTIO -D DISABLE_FBDEV ...
and added some #ifdef DISABLE_XXX in the C source codes too.

It is still too early for an official ARM FreeBASIC version.

Joshy
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC ARM6/7 for the Raspberry PI and Beaglebone Bla

Post by D.J.Peters »

For those who can not wait.

download: removed

get it from here http://www.freebasic.net/forum/viewtopi ... =5&t=21433 instead.

Joshy
Last edited by D.J.Peters on Jan 30, 2014 16:32, edited 3 times in total.
Post Reply