FreeBASIC and the Raspberry Pi ?

For other topics related to the FreeBASIC project or its community.
BasicCoder2
Posts: 3598
Joined: Jan 01, 2009 7:03
Location: Australia

FreeBASIC and the Raspberry Pi ?

Postby BasicCoder2 » Mar 13, 2018 17:53

Just acquired a Raspberry Pi. Has anyone been able to install FreeBASIC on it?
At the moment it is still in the box until I have time to set it up.
I will be new to Linux so I am not sure how long it will take to learn.
Accessing the i/o pins is required for my intended project.
dasyar
Posts: 368
Joined: Dec 04, 2008 15:31

Re: FreeBASIC and the Raspberry Pi ?

Postby dasyar » Mar 13, 2018 22:05

I used to be able to go too page 5 in the Linux forum, where TJF had a thread - Debian Package fbc-1.01-Debian7_amf. That thread has now been cleaned out, so I am not sure what the latest procedure is for installing fbc on a Raspberry Pi is.

I did do an Internet search, and found a thread called "Running FreeBasic on Raspberry Pi - we saw a chicken". This might be a way to proceed, not sure though, you might have to read the whole blog.

It is to bad that TJF cleared out, he had a very useful way of installing fbc on the Raspberry Pi. I guess he is another former forum member that bailed out.
srvaldez
Posts: 2550
Joined: Sep 25, 2005 21:54

Re: FreeBASIC and the Raspberry Pi ?

Postby srvaldez » Mar 13, 2018 22:46

@BasicCoder2
you can download FB for the pi from http://users.freebasic-portal.de/stw/builds/ either the armv6-rpi or armv7a-hf-debian will work.
have not played with accessing the i/o pins, you will probably need to use the Wiring Pi lib http://wiringpi.com, if you search this forum for wiring pi you will get some hits.
if you are new to linux then you may not know that you will need to install a number of libraries to successfully compile programs with FB
if you are using Raspbian then I suggest the following
first update from the terminal

Code: Select all

sudo apt-get update
sudo apt-get upgrade

then add the following libs

Code: Select all

sudo apt-get install libX11-dev
sudo apt-get install libXext-dev
sudo apt-get install libXpm-dev
sudo apt-get install libXrandr-dev
sudo apt-get install libncurses5-dev

you may also need other libraries depending on your program, but this will get you started.
almost forgot, I suggest the geany IDE https://www.geany.org it works with FB out of the box, though you may want to add compiler flags to your liking.
geany may already be installed, if not you can install geany using apt-get
BasicCoder2
Posts: 3598
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Postby BasicCoder2 » Mar 13, 2018 22:57

@srvaldez,
Thanks for the input.
Found some forum posts,
viewtopic.php?f=17&t=24181&hilit=wiring+pi
This is the kit I purchased.
https://www.jaycar.com.au/raspberry-pi- ... t/p/XC9010
Haven't unpacked my toy yet. Also have to get cable to connect it to a display.
D.J.Peters
Posts: 8190
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC and the Raspberry Pi ?

Postby D.J.Peters » Mar 14, 2018 2:04

Running FreeBASIC on virtual or real Raspberry Pi.

NOTE: replace the old download:
>wget http://users.freebasic-portal.de/stw/builds/linux-armv6-rpi/fbc_linux_armv6_rpi_0204_2016-03-27.zip

with:
>wget http://users.freebasic-portal.de/stw/builds/linux-armv6-rpi/fbc_linux_armv6_rpi_0267_2018-03-08.zip
(in case of RB PI 1A,1B and 2)
or
>wget http://users.freebasic-portal.de/stw/builds/linux-armv7a-hf-debian/fbc_linux_armv7a_hf_debian_0267_2018-03-08.zip
(in case of RB PI 3)

Joshy
Pitto
Posts: 119
Joined: Nov 19, 2012 19:58

Re: FreeBASIC and the Raspberry Pi ?

Postby Pitto » Mar 14, 2018 16:15

Hi all and thank you,
the above instructions also worked on my raspberry.
I compiled without problems the last project I'm working on.
And also it runs pretty fast :)
Image
sancho3
Posts: 358
Joined: Sep 30, 2017 3:22

Re: FreeBASIC and the Raspberry Pi ?

Postby sancho3 » Mar 15, 2018 6:53

dasyar wrote:It is to bad that TJF cleared out, he had a very useful way of installing fbc on the Raspberry Pi. I guess he is another former forum member that bailed out.

I wouldn't be so quick to say that. His last post is Feb 13, 2018.
BasicCoder2
Posts: 3598
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Postby BasicCoder2 » Mar 16, 2018 20:40

Thank you all for your responses which I can refer to when I start trying to get it all going.
Still have to buy a monitor and HDMI cable.
.
jevans4949
Posts: 1156
Joined: May 08, 2006 21:58
Location: Crewe, England

Re: FreeBASIC and the Raspberry Pi ?

Postby jevans4949 » Mar 17, 2018 1:43

BasicCoder2 wrote:Thank you all for your responses which I can refer to when I start trying to get it all going.
Still have to buy a monitor and HDMI cable.
.

You may find it easier / cheaper to buy a second-hand TV with an HDMI socket. You also get a spare TV set. If in the UK, rush to your local Maplin store for the cable - they are having a closing-down sale
BasicCoder2
Posts: 3598
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Postby BasicCoder2 » Mar 20, 2018 3:21

jevans4949 wrote:You may find it easier / cheaper to buy a second-hand TV with an HDMI socket. [

Have just hooked the Raspberry Pi to our second tv set and it appears to be working fine.
Now I am officially a Linux user :)
D.J.Peters
Posts: 8190
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC and the Raspberry Pi ?

Postby D.J.Peters » Mar 20, 2018 8:56

For our new ARM Linux user :-)

Tip: using GNU ARM assembler with FreeBASIC

Special ARM GNU as directives

file: "function.s"

Code: Select all

.arm                       @ 32 bit mode
.global fb_add             @ make 'fb_add' visible for FreeBASIC
.type   fb_add, %function  @ it's a function

.text                      @ begin of the code segment
.align 2                   @ word boundary

fb_add:                    @ function fb_add(r0, r1) as integer
  add   r0, r0, r1         @ r0 = r0 + r1
  bx    lr                 @ return from function with result in r0

.end                       @ end of assembler listing

file: "test.bas"

Code: Select all

declare function fb_add cdecl alias "fb_add" (byval r0 as integer,byval r1 as integer) as integer

print " 3 + 7 = " & fb_add(3,7)

sleep
#> fbc test.bas -Wa function.s

Joshy
BasicCoder2
Posts: 3598
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Postby BasicCoder2 » Mar 21, 2018 0:44

@Joshy,
Thanks for the information.

The Raspbery Pi 3B seems to have a 64 bit processor?

I am not sure why QEMU, which a google says is an emulator, is required to run FreeBASIC on the Raspberry PI which I understand runs the Linux OS?
Last edited by BasicCoder2 on Mar 21, 2018 10:56, edited 1 time in total.
D.J.Peters
Posts: 8190
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC and the Raspberry Pi ?

Postby D.J.Peters » Mar 21, 2018 7:26

You have a ARCH64 ARM device but Raspbian is an 32-bit Linux same the armv7 version of FreeBASIC is 32-bit also

Do you have installed FreeBASIC on your running Raspbian OS know ?

Joshy
BasicCoder2
Posts: 3598
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBASIC and the Raspberry Pi ?

Postby BasicCoder2 » Mar 21, 2018 9:43

It seems I may have been following the wrong post.
No I haven't installed FreeBASIC yet as I was confused with the other post.
Will tackle it again tomorrow.
Last edited by BasicCoder2 on Mar 22, 2018 12:15, edited 1 time in total.

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests