Omnimaga

Calculator Community => TI Calculators => Calculator C => Topic started by: Maizesmagikarp on March 09, 2010, 06:27:06 pm

Title: Compiling C for Nspire
Post by: Maizesmagikarp on March 09, 2010, 06:27:06 pm
Hi!

I was wondering how one would compile C source code for the TI-Nspire (Ndless).
As in compile the C into a .TNS.
Any help would be greatly appreciated!

Maize
Title: Re: Compiling C for Nspire
Post by: bwang on March 09, 2010, 06:30:17 pm
Read the Ndless readme!
On Linux, all I had to do was install arm-elf-gcc, binutils (for ARM), and newlib.
On Windows, I think you want to install Yagarto, which is an ARM toolchain for Windows.
Title: Re: Compiling C for Nspire
Post by: DJ Omnimaga on March 09, 2010, 07:42:23 pm
Let's not scare away new members, bwang, but I agree that the readme might have some useful information on what you need. If not, or if it confuses you, feel free to ask more questions (altough I myself may not be able to help, since I don't do C).

Also, what computer OS are you running?
Title: Re: Compiling C for Nspire
Post by: bwang on March 09, 2010, 07:50:50 pm
Sorry if I sounded rude; I really meant "there's useful stuff in the readme but I'm too lazy to type it here". Also, I just realized the document I got the development information from was Ndless-v1.0/src/doc/Dev.txt, which has step-by-step instructions on how to install YAGARTO, as well as various Eclipse plugins if you're into IDEs and such. That should be all you need to get started on Windows.
If you are running Linux, there are a couple posts on UTI that will help you (see, for example, this (http://www.unitedti.org/forum/index.php?showtopic=9289)).
Title: Re: Compiling C for Nspire
Post by: Maizesmagikarp on March 09, 2010, 07:51:54 pm
FYI, I run Windows.
Thanks!
I'll look into it.
Title: Re: Compiling C for Nspire
Post by: DJ Omnimaga on March 09, 2010, 07:56:01 pm
Will this work on most Windows versions, btw? I mean x64 Seven/Vista, 2000, etc
Title: Re: Compiling C for Nspire
Post by: bwang on March 09, 2010, 08:09:05 pm
I don't actually know since I'm running Linux, but there's no reason it shouldn't since it doesn't involve drivers or strange hardware.
Title: Re: Compiling C for Nspire
Post by: BrownyTCat on March 10, 2010, 08:58:46 pm
 ??? Yeah I want to compile, but I need to have a compiler, I suck at makefiles.
Title: Re: Compiling C for Nspire
Post by: bwang on March 10, 2010, 09:15:34 pm
Right now, I just use the Makefile that came with Ndless and modify it as necessary.
Title: Re: Compiling C for Nspire
Post by: BrownyTCat on March 11, 2010, 05:26:18 pm
Right now, I just use the Makefile that came with Ndless and modify it as necessary.
But how? How do you... Run a makefile and set it up?
I have two files: main.c and utils.h, How do I make them a .tns and/or debug them?
Title: Re: Compiling C for Nspire
Post by: bwang on March 11, 2010, 06:54:50 pm
According to the DEV.txt, just open a MSYS shell in the folder your code is in.
If you edit the original Ndless demo, you can just edit main.c and then run "make" in the src folder. I use Linux, though, so I don't know how MSYS works. Presumably its just a command shell like the Windows DOS prompt.
If MSYS is just a bash shell like the site said it was, these commands will build the demo:
Code: [Select]
cd <NSPIRE_DIRECTORY>/src/arm/demo
make
Title: Re: Compiling C for Nspire
Post by: Tribal on March 12, 2010, 11:02:20 am
Is there considerable difference between Yogarto and the devkitARM toolchain? It would be nice to know if one has any advantages over another.
Title: Re: Compiling C for Nspire
Post by: bwang on March 12, 2010, 11:12:11 am
I'm not sure. It seems both of them are gcc's, though.
Title: Re: Compiling C for Nspire
Post by: BrownyTCat on March 12, 2010, 07:52:26 pm
Yeah I edit using Programmer's Notepad 2, the YAGARTO toolchain, and makefiles.