BASICtools handles the steps necessary to compile a BASIC program into a hex file and then download that hex file to a target ARM processor
those steps are
- determine what CPU is being used and generate a #define LPC1756 or equivalent
- run the pre-processor
- prepend the vectors for the CPU being used.
- add "QUITDUMP" to the above output
- compile all that with ARMbasic.exe
- send the resulting hex file to the CPU
For the BLINKY.bas example
Blinky.bas uses the pre-processor.
bpp is not setup to use pipe input (source is at http://www.coridiumcorp.com/forum/viewt ... =bpp#p1178)
so you would have to create a 1 line (let us call it defLPC1756.bas) and it contains 1 line -
#define LPC1756 ' BASICtools now inserts this or the equivalent into all programs now
then do-
copy defLPC175x.bas+blinky.bas temp.bas
then
bpp temp.bas > temp.bpp
next another 1 line file (quitdump.bas) that is the 1 line
QUITDUMP
You also need a set of vectors from the SuperPRO or LPC4078 (they WILL be different and WILL change with different firmware versions). You can get those by typing a ? into the enter line of BASICtools and cutting and pasting the output into a file vectors.bas (when you use BASICtools this is in %temp%\coridium\__temp.bas)
Here is a command line program that gets the vectors (file attached here )
getBASICvectors > vectors.bas
copy vectors.bas+temp.bpp+quitdump.bas temp.ab
Compile that file and pipe the output to a downloader program (file attached here below)
ARMbasic.exe < temp.ab | loadBASIC com8
The compile and download is complete.
I'll post the source for these utilities next
Compiling from command line
Re: Compiling from command line
Sources for getBASICvectors and loadBASIC
These were compiled with minGW on a PC.
They handle resetting an attached ARM CPU, stopping any running BASIC program, and either getting some vectors or downloading a compiled hex file.
Both use simple timeouts to wait for the ARM to respond.
These were compiled with minGW on a PC.
They handle resetting an attached ARM CPU, stopping any running BASIC program, and either getting some vectors or downloading a compiled hex file.
Both use simple timeouts to wait for the ARM to respond.
Re: Compiling from command line
Any linux or Unix people out there?
With these 2 tools and a version of the compiler and bpp all this would run in either a linux environment or on a Mac
I will attach versions of the compiler for linux and the Mac here.
With these 2 tools and a version of the compiler and bpp all this would run in either a linux environment or on a Mac
I will attach versions of the compiler for linux and the Mac here.
-
AMDlloydsp
- Posts: 99
- Joined: Mon Apr 15, 2013 3:51 pm
- Location: NE Central FL
Re: Compiling from command line
Thanks, Bruce!
You just solved TWO problems for me in one post!
Now I also have the means to download new softs to several different SuperPros I have distributed around a machine, without having to connect each one to a USB port!
It'll take some coding, because I'm going to have one of the SuperPros SuperVise the process!
(methinks it'll require study, too... but that's fun!)
Lloyd
You just solved TWO problems for me in one post!
Now I also have the means to download new softs to several different SuperPros I have distributed around a machine, without having to connect each one to a USB port!
It'll take some coding, because I'm going to have one of the SuperPros SuperVise the process!
(methinks it'll require study, too... but that's fun!)
Lloyd