For discussions about development of TAPs, patches and other software for the Toppy

Moderator: Technical

Post Reply
Bob_Swede
Frequent contributor
Posts: 1066
Joined: Mon Oct 22, 2007 10:19 pm
Location: Sweden

Post by Bob_Swede »

simonc wrote:Step 8 can be ignored: the instructions don't make it clear to us Windows heads that it's just a command shell. You can use the Windows command prompt instead, just make sure that the cygwin directories have been added to the path. Mine are:
PATH=c:\cygwin\bin;c:\cygwin\usr\local\topfield-gcc\bin
Thanks, but don't you need some CygWin executable running to actually emulate the Unix system on Windows???
Just starting a cmd window in Windows surely will not get me that, or will it???

Or is it enough to have the path set in the cmd window and then start the TAP build bat file inside this? In such a case one could make a master bat file to start the command window as follows:

Code: Select all

@echo off
SET PATH=%PATH%;c:\cygwin\bin;c:\cygwin\usr\local\topfield-gcc\bin
SET C_INCLUDE_PATH=C:\WORK\TAP;C:\CYGWIN\INCLUDE; C:\CYGWIN\USR\INCLUDE 
SET CPLUS_INCLUDE_PATH=C:\WORK\TAP;C:\CYGWIN\INCLUDE; C:\CYGWIN\USR\INCLUDE
START CMD
(the two extra env vars I have snatched from the PDF file included in the Topfield tap compiler file gcc_for_tap.zip)

This will start up a Windows command window where the env vars have been set to include the stuff above so any further command issued in this window will have access to these variables.

But how does CygWin itself come into this?

Getting close. :)
Bo B (Sweden)
5700HDMIPVRt, TS On, F/W: patches (3.17 aka 5.14.77)
TAPs: TF5000 Display v1.53; ChannelChangeButtonHack 1.1; MyStuff 6.4; TAP Cmder 1.34; MyInfo B5.4;
(EPG: XMLTV2Mei for Win + MyStuff)
(Toppy access: ASUS WL-500g-P FTP installed using chunkywizard's guide)
Sig partly gen. by MyInfo on 12/4/2013
R2-D2
Frequent contributor
Posts: 12148
Joined: Mon Dec 18, 2006 11:15 am
Contact:

Post by R2-D2 »

Bob_Swede wrote:Just starting a cmd window in Windows surely will not get me that, or will it?
I feel you were very close to actually trying that out, weren't you? :) Write "ls" in a CMD window and see what you get... Then marvel at Cygwin1.dll (et al).
Bob_Swede
Frequent contributor
Posts: 1066
Joined: Mon Oct 22, 2007 10:19 pm
Location: Sweden

Post by Bob_Swede »

R2-D2 wrote:
Bob_Swede wrote:Just starting a cmd window in Windows surely will not get me that, or will it?
I feel you were very close to actually trying that out, weren't you? :) Write "ls" in a CMD window and see what you get... Then marvel at Cygwin1.dll (et al).
In a "normal" Windows command window I get this:

Code: Select all

c:\>ls
'ls' is not recognized as an internal or external command,
operable program or batch file.
This is probably normal given that ls is not available in Windows and my env vars are not set for cygwin without the batch file.
But in the window that appears when I start from the batch file above (I actually removed the %PATH% part to make sure I only have the specific path info), I get this:

Code: Select all

C:\work\TAP>ls
ADDPATH.BAT            How to Access Array of Pointer  UsbTest
Background Slide Show  KEY.H                           Utilities
EPG                    LINE.C                          VFD Sample
HDD.H                  Type.h 
:)
Going further with this I now tried the BUILD file in the EPG example but got missing files errors that forced me to modify the bat file as follows:

Code: Select all

@echo off
SET C_INCLUDE_PATH=C:\WORK\TAP;C:\cygwin\usr\gcc_for_tap\local\include;C:\cygwin\usr\gcc_for_tap\local\lib\gcc-lib\mips\2.95.3\include;
SET PATH=c:\cygwin\bin;C:\cygwin\usr\gcc_for_tap\local\bin;C:\cygwin\usr\gcc_for_tap\local\lib\gcc-lib\mips\2.95.3;%C_INCLUDE_PATH%
SET CPLUS_INCLUDE_PATH=C:\WORK\TAP;C:\CYGWIN\USR\INCLUDE;C:\cygwin\usr\gcc_for_tap\local\include;C:\cygwin\usr\gcc_for_tap\local\mips\include;C:\cygwin\usr\gcc_for_tap\local\lib\gcc-lib\mips\2.95.3\include
start cmd
But still I get a file-not-found error from build:

Code: Select all

C:\work\TAP\EPG>mips-gcc.exe -O2 -c -mtap -mlong-calls -msoft-float -I..\ -I ..\include -I c:\cygwin\usr\include -I c:\cygwin\usr\local\include quickepg.c
In file included from quickepg.c:2:
../tap.h:4:20: stddef.h: No such file or directory
Looks like the compiler could not find its standard includes, so I looked at the GCC.BAT file and modified one -I parameter that pointed to a non-existing directory.
Old command line:

Code: Select all

mips-gcc.exe -O2 -c -mtap -mlong-calls -msoft-float -I..\ -I ..\include -I c:\cygwin\usr\include -I c:\cygwin\usr\local\include %1 %2 %3 %4 %5 %6 %7 %8 %9
Modified line (extra space after first -I and gcc_for_tap added):

Code: Select all

mips-gcc.exe -O2 -c -mtap -mlong-calls -msoft-float -I ..\ -I ..\include -I c:\cygwin\usr\include -I c:\cygwin\usr\gcc_for_tap\local\include %1 %2 %3 %4 %5 %6 %7 %8 %9
Unfortunately, now the missing file error is gone but I get a compiler option error instead:

Code: Select all

C:\work\TAP\EPG>mips-gcc.exe -O2 -c -mtap -mlong-calls -msoft-float -I..\ -I ..\include -I c:\cygwin\usr\include -I c:\cygwin\usr\gcc_for_tap\local\include quickepg.c
as: unrecognized option `-O2'
What is the proper approach now?
This is a problem not so easy to solve by just examining file locations...
What use is the -O2 option to the mips-gcc call and what can I do to fix the error? :?:
Bo B (Sweden)
5700HDMIPVRt, TS On, F/W: patches (3.17 aka 5.14.77)
TAPs: TF5000 Display v1.53; ChannelChangeButtonHack 1.1; MyStuff 6.4; TAP Cmder 1.34; MyInfo B5.4;
(EPG: XMLTV2Mei for Win + MyStuff)
(Toppy access: ASUS WL-500g-P FTP installed using chunkywizard's guide)
Sig partly gen. by MyInfo on 12/4/2013
Bob_Swede
Frequent contributor
Posts: 1066
Joined: Mon Oct 22, 2007 10:19 pm
Location: Sweden

Post by Bob_Swede »

Found the proper approach:

Follow the BerliOS instruction pages to the letter except for step 8 on the CygWin setup instructions about the shortcut to the "TAP shell" command window!
Instead use the c:\cygwin.bat file to create the shell window.

After this all steps in the BerliOS page work. :)
So one does not even need the TOPFIELD gcc_for_tap compiler and examples.

Lots of confusion just because of a non-existing cygwin function that was not really needed...
I was now able to go right through and compile a new sample tap.

Now for actual coding. :wink:
Bo B (Sweden)
5700HDMIPVRt, TS On, F/W: patches (3.17 aka 5.14.77)
TAPs: TF5000 Display v1.53; ChannelChangeButtonHack 1.1; MyStuff 6.4; TAP Cmder 1.34; MyInfo B5.4;
(EPG: XMLTV2Mei for Win + MyStuff)
(Toppy access: ASUS WL-500g-P FTP installed using chunkywizard's guide)
Sig partly gen. by MyInfo on 12/4/2013
R2-D2
Frequent contributor
Posts: 12148
Joined: Mon Dec 18, 2006 11:15 am
Contact:

Post by R2-D2 »

Bob_Swede wrote:Lots of confusion just because of a non-existing cygwin function that was not really needed...
rxvt is recommended for a number of reasons (none of which I can remember at the moment! :)), but if it isn't part of the selection of packages that are installed by default or that the Berlios guide instructs you to install then you can simply add it in... You can do that right now, for instance.
simonc
Frequent contributor
Posts: 5648
Joined: Tue Apr 12, 2005 1:31 pm
Location: Cheltenham
Contact:

Post by simonc »

It's probably only recommended because it makes the setup similar across all platforms. I took one look at the prompt and decided I'd been misdirected and would be better off using a modern development environment. I use Visual Studio and tell it to build using Cygwin's make utility, which makes build errors easily navigable. You could probably also use the free Visual C++ Express, or a more lightweight alternative like Notepad++.
Bob_Swede
Frequent contributor
Posts: 1066
Joined: Mon Oct 22, 2007 10:19 pm
Location: Sweden

Post by Bob_Swede »

simonc wrote:IYou could probably also use the free Visual C++ Express, or a more lightweight alternative like Notepad++.
I have Notepad++ already, but I only ever use it to edit text files.
Is it capable of being a "lightweight" dev IDE as well?
Any hints at how?
Bo B (Sweden)
5700HDMIPVRt, TS On, F/W: patches (3.17 aka 5.14.77)
TAPs: TF5000 Display v1.53; ChannelChangeButtonHack 1.1; MyStuff 6.4; TAP Cmder 1.34; MyInfo B5.4;
(EPG: XMLTV2Mei for Win + MyStuff)
(Toppy access: ASUS WL-500g-P FTP installed using chunkywizard's guide)
Sig partly gen. by MyInfo on 12/4/2013
Bob_Swede
Frequent contributor
Posts: 1066
Joined: Mon Oct 22, 2007 10:19 pm
Location: Sweden

Post by Bob_Swede »

R2-D2 wrote:
Bob_Swede wrote:Lots of confusion just because of a non-existing cygwin function that was not really needed...
rxvt is recommended for a number of reasons (none of which I can remember at the moment! :)), but if it isn't part of the selection of packages that are installed by default or that the Berlios guide instructs you to install then you can simply add it in... You can do that right now, for instance.
Must have missed to check rxvt when I did the initial cygwin install, but I reran it and only checked rxvt this time an it installed fine.
So now I am 100% BerliOS compatible. :)
Bo B (Sweden)
5700HDMIPVRt, TS On, F/W: patches (3.17 aka 5.14.77)
TAPs: TF5000 Display v1.53; ChannelChangeButtonHack 1.1; MyStuff 6.4; TAP Cmder 1.34; MyInfo B5.4;
(EPG: XMLTV2Mei for Win + MyStuff)
(Toppy access: ASUS WL-500g-P FTP installed using chunkywizard's guide)
Sig partly gen. by MyInfo on 12/4/2013
R2-D2
Frequent contributor
Posts: 12148
Joined: Mon Dec 18, 2006 11:15 am
Contact:

Post by R2-D2 »

simonc wrote:It's probably only recommended because it makes the setup similar across all platforms.
If I push my memory to its limits I can remember stuff about CMD not handling certain escape/control sequences properly, being blooming awful in cut and paste, and something about sizing or scrolling. A proper terminal does help, but isn't by any means essential.
R2-D2
Frequent contributor
Posts: 12148
Joined: Mon Dec 18, 2006 11:15 am
Contact:

Post by R2-D2 »

Bob_Swede wrote:Is it capable of being a "lightweight" dev IDE as well?
If it can run a command and output the results in a window then it'll probably do. I use TextPad and have it set up to run build.bat or make in the directory of the source file I'm currently editing. (Actually, I think I've got it set to pass the source filename to a modified build.bat normally...)
Bob_Swede
Frequent contributor
Posts: 1066
Joined: Mon Oct 22, 2007 10:19 pm
Location: Sweden

Post by Bob_Swede »

BerliOS download server off line???
I managed to get the BerliOS download working yesterday into my CygWin "bubble" on my WinXP PC.
But then I decided to try to get the TAP development environment working also on my Ubuntu 9.04 PC.
Problem is: It seems impossible now to download the toolchain from BerliOS. :(

Their SVN server is still working so I could get the TAP files from there, and the dev pages also work. But when I try the linux toolchain download there is a connection error.
It is not even possible to ping the server, no response.
The linux download I tried is:
http://prdownload.berlios.de/tap/tap_to ... x86.tar.gz

Any ideas on how to get hold of this file elsewhere?
I am assuming that the tar file for cygwin does not work on Linux...

------- Edited -----------
UPDATE:
SITE IS NOW WORKING AGAIN! :)
No need to discuss this....
Last edited by Bob_Swede on Thu Jul 09, 2009 9:17 am, edited 1 time in total.
Bo B (Sweden)
5700HDMIPVRt, TS On, F/W: patches (3.17 aka 5.14.77)
TAPs: TF5000 Display v1.53; ChannelChangeButtonHack 1.1; MyStuff 6.4; TAP Cmder 1.34; MyInfo B5.4;
(EPG: XMLTV2Mei for Win + MyStuff)
(Toppy access: ASUS WL-500g-P FTP installed using chunkywizard's guide)
Sig partly gen. by MyInfo on 12/4/2013
Bob_Swede
Frequent contributor
Posts: 1066
Joined: Mon Oct 22, 2007 10:19 pm
Location: Sweden

Post by Bob_Swede »

And of course:
5 minutes after I posted the above it was again possible to reach the BerliOS download area!

Disregard the post above!
Bo B (Sweden)
5700HDMIPVRt, TS On, F/W: patches (3.17 aka 5.14.77)
TAPs: TF5000 Display v1.53; ChannelChangeButtonHack 1.1; MyStuff 6.4; TAP Cmder 1.34; MyInfo B5.4;
(EPG: XMLTV2Mei for Win + MyStuff)
(Toppy access: ASUS WL-500g-P FTP installed using chunkywizard's guide)
Sig partly gen. by MyInfo on 12/4/2013
MckTop
Posts: 5
Joined: Thu Nov 05, 2009 10:21 am

Post by MckTop »

I'm having real trouble compiling the MPDisplay tap. Since it is supplied with a "build" batch file I installed
the original Topfield compiler and attempted to build it at a DOS command line but it failed because type
modifier "__cdecl" (used in /usr/local/include/ctype.h) is undefined. Strangely however no header files are
being reported missing. This modifier is a built in macro in the cygwin command line environment but can
batch files be run in this environment (cygwin.bat) or am I missing a header.

My next attempt was to compile under the Berlios environment and to do this I modified an existing makefile
(DescriptionExtender) which was also dependant upon libutils libfirmware, libFireBird and TSRCommander.
This is the result.

$ make
make -s -C ../../libs/libutils
make -s -C ../../libs/Firmware
/usr/local/topfield-gcc/bin/mips-ld --script /usr/local/topfield-gcc/mips/lib/tap.ld MpDisplay.o ../../libs/libutils/libutils.a ../../libs/Firmware/libfirmware.a -L/usr/local/topfield-gcc/topfield-sdk/lib -ltap -lc -lm -L../../libs/FireBird -l FireBird -l c -o MpDisplay.elf
MpDisplay.o(.text+0x293c): In function `UpdateSmallDisplay':
MpDisplay.c: undefined reference to `litodp'
MpDisplay.o(.text+0x2960):MpDisplay.c: undefined reference to `dpdiv'
MpDisplay.o(.text+0x297c):MpDisplay.c: undefined reference to `dptoul'
make: *** [MpDisplay.elf] Error 1

I can't find where strings "litodp", "dpdiv" and "dptoul" are coming from, they don't appear in the original sources
or headers.

Then I tried to rebuild the lib files, starting with FireBird, it wont compile either, I'm close to giving up.

Any help would be appreciated.
R2-D2
Frequent contributor
Posts: 12148
Joined: Mon Dec 18, 2006 11:15 am
Contact:

Post by R2-D2 »

MckTop wrote:

Code: Select all

MpDisplay.o(.text+0x293c): In function `UpdateSmallDisplay':
MpDisplay.c: undefined reference to `litodp'
MpDisplay.o(.text+0x2960):MpDisplay.c: undefined reference to `dpdiv'
MpDisplay.o(.text+0x297c):MpDisplay.c: undefined reference to `dptoul'
This means that the code contains floating constants and arithmetic. I don't know how the Berlios compiler copes with that, but the original gcc_for_TAP one seems to be happy with it. I shan't make the link in the previous sentence any more explicit than that, but it's easily possible to have both compilers installed at the same time, and then you can use the included build.bat or Makefile as appropriate.
MckTop
Posts: 5
Joined: Thu Nov 05, 2009 10:21 am

Post by MckTop »

Thanks for the response, already done :wink: and I am able to compile the examples. MpDisplay will not compile though because __cdecl is not defined. Apparently it should be a macro which defines the calling convention.

Can libraries (e.g FireBird) which have been compiled using gcc_for_TAP be linked with code compiled with topfield-gcc?
Post Reply