Problems Using NXTGCC

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
edisn
Posts: 20
Joined: 11 Feb 2011, 10:06

Re: Problems Using NXTGCC

Post by edisn »

The improved firmware and the NXTGCC projekt are similar in manny of the files.
(so no further help or komments there)

The "Bare Metal on the NXT" sems to be the most interesting link.
If i understand it correctly, his Sources (its called nxt-natives, in his files), are a much simpler version of a Firmware.
In the example it sems that a bit sensor (touch-sensor is on or off) and a analog sensor (light sensor) os used.
Wat i still have to figure oit is how to use inteligent sensors (Ultrasonic distance),
but it schould have some similaritys to the usage of the motor angle sensor.
schodet
Posts: 139
Joined: 29 Sep 2010, 11:21
Contact:

Re: Problems Using NXTGCC

Post by schodet »

edisn wrote:The "Bare Metal on the NXT" sems to be the most interesting link.
If i understand it correctly, his Sources (its called nxt-natives, in his files), are a much simpler version of a Firmware.
It uses driver taken from NxOS, you may be able to take the i2c driver from here too if it is not included.
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
edisn
Posts: 20
Joined: 11 Feb 2011, 10:06

Re: Problems Using NXTGCC

Post by edisn »

I had a glance at the NxOS files (at tha moment i am reading a bock on AI basics),
The I2C files sem to be the same as in other prijects, but the "radar" code uses the Ultrasonic sensor,
so i should be able to use it.

It sems there is also a USB interface to the nxt includet in the Project (Used in Pyton?).
This could come in handy if i try to debug the AI.
(Rumming AI on NXT and Simulate a simple world ,e.g. Wumpusworld, on the PC.)
edisn
Posts: 20
Joined: 11 Feb 2011, 10:06

Re: Problems Using NXTGCC

Post by edisn »

1)I have tryet to comile the NxOS,
but it loks like i am doing something wrong with the pyton scripts, in the process.

The pyton window opens and closes right away if i start the script using a doubliklick,
and the given Comandline (Readme) says thet the comand is unknown.

Maybe i schould try to change the Makefile of the NXCGCC and compile it fron there.

2)I still havent figured out how to start a I2C sensor. <EDIT: THIS PART IS ABOUT NXCGCC>
If i poll the sensor using BricX (Set it with "Direct Control", and poll using the "Watching the Brick" window),
i am also able to read the Values from the imput buffer of the Sensor.
(NRX=pMapLowSpeed->InBuf[0].InPtr;
value=pMapLowSpeed->InBuf[0].Buf[NRX];)
But i dont know how to get the sensor to sending me this values.
tcwan
Posts: 186
Joined: 30 Sep 2010, 07:39

Re: Problems Using NXTGCC

Post by tcwan »

edisn wrote:1)I have tryet to comile the NxOS,
but it loks like i am doing something wrong with the pyton scripts, in the process.

The pyton window opens and closes right away if i start the script using a doubliklick,
and the given Comandline (Readme) says thet the comand is unknown.

Maybe i schould try to change the Makefile of the NXCGCC and compile it fron there.
What platform OS are you running? I've got it running under MacOSX, otherwise Linux should be pretty straightforward after installing the necessary tools. I don't recommend trying to compile it straight under Windows since mingw is really slow for executing the build tools, you should run it in a Linux VM if you can.

You should really build the NxOS source from command line, otherwise you'll miss the error messages.
I don't know if double-clicking on the SConstruct file will do anything useful, since it is not a complete build script (although it is python code, it has to be invoked by scons).

Basically NxOS uses scons instead of make for building. You'll need to make sure that you have scons installed. You can also install doxygen if you wish to generate API docs but that is not mandatory. (doxygen will generate a lot of warnings due to incomplete docs in NxOS sources).

You need to provide arguments to scons when building NxOS for the first time. if you check the README in $(NXOSDIR)/nxos/, you need to specify the output kernel type, the first time you invoke scons. The example given in the README uses:

'scons appkernels=tests'

Finally, I'd recommend starting from Alexander Holler's version of the NxOS source. This version integrates execute from RAM (as documented in the Bare Metal Programming on NXT), using John Hansen's Enhanced Firmware. This way you don't have to keep flashing the brick each time.
It is available from https://github.com/aholler/nxos. Alternative you can start from my version where I'm adding an ARM instruction level debugger, but it is still a WIP and is currently not recommended for normal development https://github.com/tcwan/nxos-armdebug
edisn
Posts: 20
Joined: 11 Feb 2011, 10:06

Re: Problems Using NXTGCC

Post by edisn »

I have vergotoen to install scons, and use the wrong OS (win 7).

I wil coppy my Working directory to my Laptop were I vava a Win7 and a Ubuntu 10 OS installed.
(Altough i am new to using Linux and somethimes ned long to find what i am searching for.)

Is ther something in Linux which works like .bat ans PAUSE in Windows?
(So i dont have to use the Comandline every time.)
tcwan
Posts: 186
Joined: 30 Sep 2010, 07:39

Re: Problems Using NXTGCC

Post by tcwan »

edisn wrote: Is ther something in Linux which works like .bat ans PAUSE in Windows?
(So i dont have to use the Comandline every time.)
It is possible to write shell scripts to do what you would like to accomplish, but I think it is probably easiest to just run scons from the command line. You would probably need to edit SConstruct to match the gcc cross-compile toolchain you're using. The recommended cross-tool is arm-none-eabi-* whereas NxOS defaults to using arm-elf-*, an older standard. Search for 'arm-elf' the SConstruct and replace it with the prefix for the version of the cross-compile toolchain you're using. (e.g., Codesourcery provides arm-none-eabi- toolchain, so does latest Yagarto)

Typically, the only time you need to specify options to scons is if you change the 'appkernels=XXX' target output. After you have changed it you can just invoke scons by itself (The last used setting is stored in scons.options).
edisn
Posts: 20
Joined: 11 Feb 2011, 10:06

Re: Problems Using NXTGCC

Post by edisn »

Another Question to the Use OF NXTGCC,
and Eclipse make Files...

NXTGCC has a posibility to include .cpp sourcefiles,
i have tryed to include one, but if i call a function i have definet in it,
th compiler says doething like umknown element, and there is no objectfile for the cpp data.

Do someone know what i am doing wrong?
(like something in am Makefile to define the order for compiling the data, or soething like that?
Unknown object sounds like a linking error, ...)
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 0 guests