Recent

Author Topic: Teensy (no OS) programmed with Free Pascal Embedded ARM  (Read 41907 times)

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #30 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?
Regards,
Paul Breneman
www.ControlPascal.com

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #31 on: September 21, 2015, 08:34:56 pm »
-Wpmk20dx256VLH7
Remember: you need fpc trunk !

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #32 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?
Regards,
Paul Breneman
www.ControlPascal.com

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #33 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 !

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #34 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!
Regards,
Paul Breneman
www.ControlPascal.com

Laksen

  • Hero Member
  • *****
  • Posts: 724
    • J-Software
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #35 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 :)

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #36 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!
Regards,
Paul Breneman
www.ControlPascal.com

lagprogramming

  • Sr. Member
  • ****
  • Posts: 405
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #37 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.

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #38 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

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 and http://forum.lazarus.freepascal.org/index.php/topic,23927.0.html

So, I'd like to do more with the text mode IDE!
Regards,
Paul Breneman
www.ControlPascal.com

Laksen

  • Hero Member
  • *****
  • Posts: 724
    • J-Software
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #39 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

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #40 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 and 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!   :)
Regards,
Paul Breneman
www.ControlPascal.com

lagprogramming

  • Sr. Member
  • ****
  • Posts: 405
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #41 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 (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 into a directory: {MSE.DIRECTORY}
   Example: 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 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
   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, 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!!!

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #42 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 so it is nice to see you add a linux option here.
Regards,
Paul Breneman
www.ControlPascal.com

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #43 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) with a little more information.  I'd like to start helping you with 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) to Free Pascal.
Regards,
Paul Breneman
www.ControlPascal.com

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Teensy (no OS) programmed with Free Pascal Embedded ARM
« Reply #44 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.

 

TinyPortal © 2005-2018