Lazarus

Programming => Embedded => Operating Systems => Embedded - ARM => Topic started by: Paul Breneman on May 27, 2015, 02:28:38 pm

Title: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on May 27, 2015, 02:28:38 pm
The Teensy https://www.sparkfun.com/products/12646 (https://www.sparkfun.com/products/12646) looks like a nice development board to use with Free Pascal Embedded ARM http://wiki.freepascal.org/TARGET_Embedded (http://wiki.freepascal.org/TARGET_Embedded).

http://forum.lazarus.freepascal.org/index.php/topic,26315.0.html (http://forum.lazarus.freepascal.org/index.php/topic,26315.0.html) and http://forum.lazarus.freepascal.org/index.php/topic,24665.0.html (http://forum.lazarus.freepascal.org/index.php/topic,24665.0.html) are related topics, but it is probably best to update the wiki page and this new topic going forward.

I hope we can bring a lot of new folks to Free Pascal!  :)
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Gizmo on May 27, 2015, 02:46:43 pm
I got all the usual "whats FPC" and "nobody uses FPC" when I asked about using FPC on the Teensy forums..

https://forum.pjrc.com/threads/28518-Teensy-with-Freepascal

Maybe you know ways to use FPC with Teensy?
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on May 27, 2015, 05:06:43 pm
The controller on that board isn't directly supported by FPC yet, but adding support shouldn't be too hard. I can probably do that tonight (with the help of Michael Ring).

I got all the usual "whats FPC" and "nobody uses FPC" when I asked about using FPC on the Teensy forums..

https://forum.pjrc.com/threads/28518-Teensy-with-Freepascal

Maybe you know ways to use FPC with Teensy?
Lots of bad replies. Ignore everything said there :)
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Leledumbo on May 27, 2015, 06:13:20 pm
Lots of bad replies. Ignore everything said there :)
Not really, only 1-2 that discriminates Pascal. Some even know Mikroe Pascal ;)

It's nice to see FPC on embedded platforms. We always trail behind GCC but that's not a big deal, even incredible since no other might be close, even commercial ones.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on May 27, 2015, 06:19:46 pm
Gizmo: Thanks for the link you shared.  I just updated the following page with stuff I like to share with such people: http://turbocontrol.com/embeddedfreepascal.htm (http://turbocontrol.com/embeddedfreepascal.htm)

Laksen: Please update us with your progress.  Thanks for your help!
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Gizmo on May 28, 2015, 10:44:04 am
Laksen\Paul

I have a new v3.1 Teensy so happy to help you test...
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on May 28, 2015, 01:55:58 pm
Alright, it's committed to SVN trunk now.

To build the compiler:
make buildbase OS_TARGET=embedded CPU_TARGET=arm SUBARCH=armv7em CROSSINSTALL=1

To install it:
make installbase OS_TARGET=embedded CPU_TARGET=arm SUBARCH=armv7em CROSSINSTALL=1 PREFIX=C:/wherever you want to install

To build a program:
fpc -Parm -Tembedded -Cparmv7em -Wpmk20dx256xxx7 program.pas
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: marcov on May 28, 2015, 04:16:38 pm
Don't forget to post an update on the pjrc forum :)
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Gizmo on May 28, 2015, 04:48:49 pm
I would be happy to, but maybe Laksen should as he has done the work.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on May 28, 2015, 05:13:29 pm
Thanks Laksen for your help!

Projects Using Teensy
  http://pjrc.com/teensy/projects.html (http://pjrc.com/teensy/projects.html)
There should be something there to interest everyone!

My favorite (so far) seems to be the Modbus project which links here:
http://forum.pjrc.com/threads/23543-RS485-half-duplex-using-Teensy-3-0-hardware-pins (http://forum.pjrc.com/threads/23543-RS485-half-duplex-using-Teensy-3-0-hardware-pins)
I'd like to associate that with the Modbus example here: http://ctrlterm.com/custom.htm (http://ctrlterm.com/custom.htm)
Then maybe post a new page (with C and Python code) here: http://controlpascal.com/ (http://controlpascal.com/)

If anyone wants to contribute a page for http://controlpascal.com/ (http://controlpascal.com/) please contact me.  The Free Pascal wiki page should also be updated.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on May 28, 2015, 05:28:35 pm
Michael Ring did most of this work since he wrote the converter  :P

But go ahead and try it. Do report any code related problem you run into as fast as possible
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: FPK on May 28, 2015, 08:15:49 pm
Don't forget to post an update on the pjrc forum :)

Definitively :)
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Gizmo on May 29, 2015, 10:01:24 am
Done :

https://forum.pjrc.com/threads/28518-Teensy-with-Freepascal
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on June 02, 2015, 03:07:57 pm
Hopefully my Teensy (with pins), breadboard, and tutorial parts kit (all mentioned here http://www.pjrc.com/store/tutorial_kit.html (http://www.pjrc.com/store/tutorial_kit.html)) will arrive in several days.  I then hope to port the tutorials to Free Pascal!
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on June 03, 2015, 01:14:27 am
I had access to a Teensy 3.1 so I just tested it today. There were some strange low-level details in the chip that needed fixing in the compiler and RTL. Those fixes are in SVN trunk now.

The following example will blink the led with approx 1 Hz (if compiled with -O3 or higher :) ):
Code: [Select]
program test;

procedure Delay;
  var
    i: longint;
  begin
    // 3 cycles per loop approx. at 16 MHz at -O3 optimization
    // (16 MHz / 3) * 0.5 = 2666666 ~= 0.5 sec
    for i := 1 to 2666666 do;
  end;

begin
  // Enable clock for PORTC
  SIM_bitbanded.SCGC5.PORTC := 1;

  // Set PTC5 to output
  PTC_bitbanded.PDDR.PDD[5] := 1;
 
  // Set PTC5 to ALT1(GPIO) mode and use high drive strength
  PORTC.PCR5 := ($1 shl 8) or (1 shl 6) or (1 shl 2);
 
  // Set PTC5 high
  PTC.PSOR := (1 shl 5);
 
  while true do
    begin
      Delay;
      PTC.PTOR := (1 shl 5);
    end;
end.

Binary here: http://j-software.dk/test.hex
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Graeme on June 24, 2015, 03:58:33 pm
Oh, I like this. The Teensy is also used in the open source ultimate hacking keyboard project ErgoDox [http://ergodox.org/ (http://ergodox.org/)]. They are programming all kinds of things for that keyboard. Being able to use FPC would be kinda cool too. ;-)
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on July 11, 2015, 03:16:14 pm
Thanks for that ErgoDox info Graeme!  I've been away for a month but getting back into things now.  I just got the updated fpcup (https://github.com/LongDirtyAnimAlf/Reiniero-fpcup (https://github.com/LongDirtyAnimAlf/Reiniero-fpcup)) working in my XP VM. Can anyone help me figure out how to use fpcup to generate the FPC compiler for the Teensy?
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on July 21, 2015, 12:37:45 am
I've been working on this related wifi page for the past several days:
http://wiki.freepascal.org/Small_Virtual_Machines (http://wiki.freepascal.org/Small_Virtual_Machines)

Help is needed!
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on July 29, 2015, 01:03:03 pm
From the wiki page: http://wiki.freepascal.org/Small_Virtual_Machines (http://wiki.freepascal.org/Small_Virtual_Machines)

This downloads a file (875240 bytes) but can't execute it (help needed):
wget https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/blob/master/bin/i386-linux/fpcup_linux_x86?raw=true --no-check-certificate
mv fpcup_linux_x86?raw=true fpcup
chmod u+rx fpcup
sudo ./fpcup (Get No such file or directory error)

I've also added an issue on this page: https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/issues (https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/issues)

I'd sure like to get fpcup working on the small Debian linux virtual machine.  There must be something simple I'm doing wrong.  If so, please let me know what you think.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: lagprogramming on September 06, 2015, 09:32:15 pm
   Have you ever heard of a situation where building fpc for a subarchitecture would require different tools than other subarchitectures for the same CPU-OS platform?
   With other words, just to exemplify, something like: embedded-arm-armv4t requires a BINUTILSPREFIX value and embedded-arm-armv7em requires a different BINUTILSPREFIX value, or a different directory.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on September 06, 2015, 10:40:01 pm
Not unless there's a bug in a given binutils version, which isn't unthinkable but doesn't happen very often for >2.19. Just use the newest version for all ARM versions.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on September 20, 2015, 01:25:44 am
I've been working on this related wifi page for the past several days:
http://wiki.freepascal.org/Small_Virtual_Machines (http://wiki.freepascal.org/Small_Virtual_Machines)

I've now got fpcup working on a Debian LXDE VM as shown on that wiki page.  Can anyone suggest how I get FPC compiled to use for generating programs for Teensy?
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on September 20, 2015, 11:42:41 am
The make instructions on the previous page should still work. Don't hesitate to ask if there's anything missing or you get errors
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on September 21, 2015, 12:49:41 am
Thanks Laksen, but  I should have asked how I can use fpcup to get FPC compiled  to generate programs for Teensy.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: DonAlfredo on September 21, 2015, 08:14:12 am
I have made some mods to fpcup, especially for the VM setup.
Not yet on GitHub ... still testing.
Now I am working on embedded, for the Teensy.
Hope to finish it today (will be away for the next week or so).
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: DonAlfredo on September 21, 2015, 10:33:52 am
Added arm embedded for fpcup !

For Teensy:

Get the arm embedded binutils from:
http://svn2.freepascal.org/svn/fpcbuild/binaries/i386-win32/

(arm-embedded-ar.exe
arm-embedded-as.exe
arm-embedded-ld.exe
arm-embedded-objcopy.exe
arm-embedded-objdump.exe
arm-embedded-strip.exe)

Copy those file into the directory where fpcup can find them (default):
c:\development\cross\bin\arm-embedded

Run fpcup (after having run fpcup for a standard install) to crosscompile:

fpcup.exe --ostarget="embedded" --cputarget="arm" --subarch="armv7em" --only="FPCCleanOnly,FPCBuildOnly"

And hopefully, you are ready to go (on Windows).
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: DonAlfredo on September 21, 2015, 11:27:26 am
Linux enabled with latest commit !

Remember to get the arm-embedded binutils first !
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on September 21, 2015, 11:44:41 am
arm-none-eabi- will do as well if that's the only one you can find. Just make some symbolic links from arm-embedded-as to arm-none-eabi-as for example. Do that for all the programs DonAlfredo listed above
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: DonAlfredo on September 21, 2015, 01:20:25 pm
@ Laksen
Thanks for this additional info.

However, fpcup will already search for 'arm-none-eabi !

A test should be welcome in any case, because I cannot test this on my system yet.
So, feedback welcome !
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on September 21, 2015, 02:06:09 pm
Oh okay, then just forget what I said.. :)
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on September 21, 2015, 07:36:15 pm
To build a program:
fpc -Parm -Tembedded -Cparmv7em -Wpmk20dx256xxx7 program.pas

I've got a ppcrossarm generated by fpcup in a WinXp VM in VMware.  If I run ppcrossarm -iu I get a long listing of controller types but the -Wp listed above is not there.  What should I use for the Teensy 3.1?
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: DonAlfredo on September 21, 2015, 08:34:56 pm
-Wpmk20dx256VLH7
Remember: you need fpc trunk !
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on September 21, 2015, 09:09:46 pm
fpcup.exe --ostarget="embedded" --cputarget="arm" --subarch="armv7em" --only="FPCCleanOnly,FPCBuildOnly"

Do I need something else here for trunk?
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: DonAlfredo on September 21, 2015, 09:24:14 pm
YES !!

You are on Windows. So, first you need to install normal fpc trunk (with Lazarus trunk if you want, but Lazarus default is also ok).

Code: [Select]
fpcup.exe --fpcURL="trunk" --lazURL="trunk"
When finished, you need to build the cross-compiler.

Code: [Select]
fpcup.exe --ostarget="embedded" --cputarget="arm" --subarch="armv7em" --only="FPCCleanOnly,FPCBuildOnly"
It is important to remember that the cross-compiler is build with the help of the normal install. In this case you need trunk, because only trunk has Teensy support !
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on September 21, 2015, 09:48:32 pm
Thanks DonAlfredo!  I figured that was the part I missed.  Thanks for helping me get this figured out and working!
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on September 21, 2015, 10:32:49 pm
Btw:
Use -Oonostackframe when compiling. There's a bug in fpc trunk for armv7(e)m with this optimization at the moment. Will hopefully get fixed soon :)
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on September 21, 2015, 11:03:23 pm
Thanks Laksen, will do.  I am now able to program my Teensy with the program you supplied months ago.  Thanks for everyones help!
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: lagprogramming on September 25, 2015, 08:37:57 pm
I'd like to know if programmers of embedded devices use fpc's internal IDE. I'm talking about the text mode IDE.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on September 25, 2015, 10:40:43 pm
I'd like to know if programmers of embedded devices use fpc's internal IDE. I'm talking about the text mode IDE.

I'm semi-retired so I can't say what real embedded engineers use, but I'd like to share several related thoughts.

For a few years starting in 2010 I worked on expensive embedded equipment using Turbo Pascal where I used the product that the text mode IDE is based on.  See the bottom of this page for more info: http://www.turbocontrol.com/APro.htm (http://www.turbocontrol.com/APro.htm)

A year and a half ago I spent a bit of time to get the text mode IDE to compile and run on Android, see here: http://turbocontrol.com/gnuroot.htm (http://turbocontrol.com/gnuroot.htm) and http://forum.lazarus.freepascal.org/index.php/topic,23927.0.html (http://forum.lazarus.freepascal.org/index.php/topic,23927.0.html)

So, I'd like to do more with the text mode IDE!
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on September 26, 2015, 12:08:49 am
I use Lazarus for all my embedded development. Works fantasticly. There should be code completion for all supported microcontrollers. If not, let me know.

Never bothered with debugging from the IDE though. Shotgun debugging is good enough for me :)
I know someone have some patches laying around that adds support to connect to OpenOCD though
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on September 26, 2015, 02:26:03 am
A year and a half ago I spent a bit of time to get the text mode IDE to compile and run on Android, see here: http://turbocontrol.com/gnuroot.htm (http://turbocontrol.com/gnuroot.htm) and http://forum.lazarus.freepascal.org/index.php/topic,23927.0.html (http://forum.lazarus.freepascal.org/index.php/topic,23927.0.html)

So, I'd like to do more with the text mode IDE!

I should make things more clear!  For Android I was just using the text mode IDE as something to test Free Vision.  So I really wasn't using the IDE at all.  So ignore me and listen to real engineers like Laksen!   :)
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: lagprogramming on September 28, 2015, 06:19:48 pm
   A linux user with a working fpc installed has to follow these steps:
   1. Download and extract the teensy.7z from http://s000.tinyupload.com/?file_id=00033913163452451867 (http://s000.tinyupload.com/?file_id=00033913163452451867) (md5:429001ba1aaa5c2ba566e77ff185eca0). You'll end up with a new directory "TEENSYDIRECTORY".
   2. Download the latest fpc trunk sources into a directory: {FPC.SOURCE.DIRECTORY}.
   3. If you want a light gui you can download and extract MSEide from https://gitlab.com/mseide-msegui/mseide-msegui (https://gitlab.com/mseide-msegui/mseide-msegui) into a directory: {MSE.DIRECTORY}
   Example: https://gitlab.com/mseide-msegui/mseide-msegui/repository/archive.zip (https://gitlab.com/mseide-msegui/mseide-msegui/repository/archive.zip)
   4. You want to crosscompile for embedded arm, reason why you have to download and extract the linux archive found at https://launchpad.net/gcc-arm-embedded/+download (https://launchpad.net/gcc-arm-embedded/+download) into a directory: {CROSSBINUTILS.DIRECTORY}
   Example: https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 (https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2)
   5. Within the file TEENSYDIRECTORY/teensyparameters.txt update the following macros: {FPC.SOURCE.DIRECTORY}, {MSE.DIRECTORY} and {CROSSBINUTILS.DIRECTORY}. In order to avoid complications make sure you don't use relative paths(in linux the paths should start with "/home/...").
   6. cd TEENSYDIRECTORY
   7. ./fcsconsole_* teensyparameters.txt, where * is your platform.
   The process will take a while because by default, it will try to build fpc for about six crosscompiling processes, which also include windows. You can comment the unwanted ones within "teensyparameters.txt" file.

   FCS is a console application, reason why you should be able to use these steps in a tinylinux virtual machine, but you'll end up with text only environment.
   If you want a GUI, try something like www.damnsmalllinux.org (http://www.damnsmalllinux.org), I've read it's only about 50MB in size. This should be the lightest way to have a virtual machine for embedded programming with a GUI. The reason behind it is that MSEide doesn't need libraries like gtk or qt. By the way, you'll end up with MSEide already partially configured.

   THE DEVELOPMENT IS IN ALPHA STAGE!!! CREATE BACK-UPS, RUN IN SANDBOX...OR DON'T USE IT AL ALL!!!
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on September 28, 2015, 06:45:42 pm
   A linux user with a working fpc installed has to follow these steps:

Thanks lagprogramming for more Teensy options!  I already have instructions on how to use WinXp with fpcup on the wiki page http://wiki.freepascal.org/Small_Virtual_Machines (http://wiki.freepascal.org/Small_Virtual_Machines) so it is nice to see you add a linux option here.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on October 03, 2015, 07:20:44 pm
You are on Windows. So, first you need to install normal fpc trunk (with Lazarus trunk if you want, but Lazarus default is also ok).

Code: [Select]
fpcup.exe --fpcURL="trunk" --lazURL="trunk"
When finished, you need to build the cross-compiler.

Thanks again DonAlfredo!  I just updated the wiki page (http://wiki.freepascal.org/Small_Virtual_Machines (http://wiki.freepascal.org/Small_Virtual_Machines)) with a little more information.  I'd like to start helping you with fpcup (http://wiki.freepascal.org/fpcup (http://wiki.freepascal.org/fpcup)) but I don't know how long that will take me.  My first goal is to remove Lazarus from your first step above.  Any suggestions on issues and where to look?  My second goal is to port the Teensy tutorials 1-4 (http://www.pjrc.com/store/tutorial_kit.html (http://www.pjrc.com/store/tutorial_kit.html)) to Free Pascal.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: DonAlfredo on October 03, 2015, 11:46:33 pm
Could you explain why you want to remove Lazarus ? It makes life a lot easier !
But true, for embedded, it is not realy needed. You could use a simple text-editor.
And all help is welcome.
The tutorials look easy to port.
I will perhaps try to buy a Teensy, but for now, I am addicted to RPi2.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on October 10, 2015, 07:04:06 pm
I just posted my initial page: http://turbocontrol.com/simpleteensy.htm (http://turbocontrol.com/simpleteensy.htm)

Lots more work to do but its a start!
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on October 11, 2015, 03:04:26 am
If any of the real experts (not me) want to answer some questions please look here: https://forum.pjrc.com/threads/28518-Teensy-with-Freepascal (https://forum.pjrc.com/threads/28518-Teensy-with-Freepascal)
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on October 11, 2015, 03:58:16 pm
If any of the real experts (not me) want to answer some questions please look here: https://forum.pjrc.com/threads/28518-Teensy-with-Freepascal (https://forum.pjrc.com/threads/28518-Teensy-with-Freepascal)

Here are the questions:
How easy is it to do all the common hardware things from Freepascal? How much low-level setup is required use digital and analog I/O? Can you use the serial ports? Timers? Capacitive touch sensing? Can you even access the registers without porting a massive header file? Is it possible to link with existing C or C++ libraries?

Any quick summary anyone would like for me to post as a response? Please write back here if you don't want to register on that forum.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: ykot on October 11, 2015, 05:44:35 pm
Sounds rather an interesting topic, will get Teensy myself and experiment. But is it just me or that turbocontrol.com web site never works? (tried its links few days ago and now - still down)
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on October 19, 2015, 07:18:35 pm
Could you explain why you want to remove Lazarus ? It makes life a lot easier !
But true, for embedded, it is not realy needed. You could use a simple text-editor.

I'm trying to find (then show) the most simple way to start using Free Pascal with Teensy.  Once someone tries that then they could next install Lazarus, but I don't think we should start there.  These are my current steps: http://www.controlpascal.com/tutorial.htm (http://www.controlpascal.com/tutorial.htm)

I've been looking at the source code of fpcup and figured out a way to leave out Lazarus.  I've updated the wiki:
http://wiki.freepascal.org/Small_Virtual_Machines#WinXp_virtual_machine (http://wiki.freepascal.org/Small_Virtual_Machines#WinXp_virtual_machine)
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on October 24, 2015, 01:27:24 am
I've been looking at the source code of fpcup and figured out a way to leave out Lazarus.  I've updated the wiki:
http://wiki.freepascal.org/Small_Virtual_Machines#WinXp_virtual_machine (http://wiki.freepascal.org/Small_Virtual_Machines#WinXp_virtual_machine)

Since I can now use fpcup for only FPC I have been able to get the console Debian (http://wiki.freepascal.org/Small_Virtual_Machines#Debian_console_virtual_machine (http://wiki.freepascal.org/Small_Virtual_Machines#Debian_console_virtual_machine)) to work for trunk FPC.  But when I try to compile the rtl for Teensy I get the error noted on the wiki.  Any suggestions on a fix?
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on October 24, 2015, 02:34:47 am
Check what version of arm binutils you are using. Sounds like a bug in that.. armv7e-m has been working for years
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on October 24, 2015, 02:52:32 am
Check what version of arm binutils you are using. Sounds like a bug in that.. armv7e-m has been working for years

Glad that you know the 'armv7e-m' (with the extra dash) is OK.  My arm-none-eabi-as is GNU assembler version 2.25 using BFD version (2.25-5+5+b1) 2.25
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on October 24, 2015, 04:58:59 pm
It's probably just not using the arm binutils then. In the normal build process you would just specify BINUTILS_PREFIX=arm-none-eabi-
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Thaddy on October 24, 2015, 06:19:48 pm
It's probably just not using the arm binutils then. In the normal build process you would just specify BINUTILS_PREFIX=arm-none-eabi-

That would be BINUTILSPREFIX not BINUTILS_PREFIX?
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Laksen on October 24, 2015, 06:24:33 pm
Yes, correct
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on October 24, 2015, 07:24:55 pm
It's probably just not using the arm binutils then. In the normal build process you would just specify BINUTILS_PREFIX=arm-none-eabi-

In fpcup in the m_any_to_embeddedarm.pas file it is not searching /usr/bin for 'arm-none-eabi-' so I think that is the problem.  Thanks for all of the comments and suggestions!
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: DonAlfredo on October 26, 2015, 11:28:23 am
Added /usr/bin to search path for fpcup !

Also added (for some time now) is a new switch that prevents the download of the repos themselves by default. This to keep the install small and the download time limited.

It can be enabled again by adding "--getfullrepo" to the command line of fpcup.
Title: Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
Post by: Paul Breneman on October 26, 2015, 01:20:43 pm
Thanks DonAlfredo! It works and I updated the wiki: http://wiki.freepascal.org/Small_Virtual_Machines#Debian_console_virtual_machine (http://wiki.freepascal.org/Small_Virtual_Machines#Debian_console_virtual_machine)
Title: Teensy
Post by: mai on October 30, 2015, 02:20:03 pm
the best thing about teensy is the fact that it can control a DIY electronic chessboard (with magnets and reed relays) as a dedicated chess machine.
TinyPortal © 2005-2018