Question

I am trying to build a cross compiler to target the processor running on my NAS box using crosstool-NG.

The NAS box is a ZyXEL NSA210, there is an example dmesg output, the /proc/cpuinfo is:

Processor       : ARM926EJ-S rev 5 (v5l)
BogoMIPS        : 183.09
Features        : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant     : 0x0
CPU part        : 0x926
CPU revision    : 5
...
Hardware        : Oxsemi NAS
Revision        : 0000
Serial          : 00000d51caab2d00

The options on the target options page, the flag and my current settings in ():

  • Target Architecture (arm)
  • Use the MMU (yes)
  • Endianness (Little endian)
  • Bitness (32-bit)
  • Default instruction set mode (arm)
  • Use EABI (yes)
  • Architecture level --with-arch= ()
  • Emit assembly for CPU --with-cpu= ()
  • Tune for CPU ()
  • Use specific FPU ()
  • Floating point (software)
  • Target CFLAGS ()
  • Target LDFLAGS ()

I've been trying various combinations in the 'Architecture level' and 'Emit assembly for CPU', such as arm926ej-s, armv5l, armv5tej, but I don't know which option goes where.

I've set the Target OS to bare-metal as crosstool-NG doesn't have the version of Linux used on the box.

Also, once the toolchain is built do I need to pass the same options again to the compilers.

So far by attempts have just produced the Illegal instruction message.

Edit

If anyone could point me towards an article on setting up an ARM GCC toolchain with explicit reference of how to find out the correct parameters, that would answer my question.

Was it helpful?

Solution

Try one of these

--with-arch=armv5te
--with-tune=arm926ej-s

or

--with-cpu=arm926ej-s

(there's no point in having both).

Otherwise your options look fine.

If it still doesn't work then you need to look at the libraries and headers. If you want to use dynamically linked libraries then you'll need to have ones that match those on the target, version wise and name wise. If you want to use static linking, or copy your own shared libraries onto the target (in a non-standard place, perhaps, which would need extra config), you should be fine.

Either way, you'll need your kernel headers to match. You can probably just download some contemporary kernel headers from kernel.org.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top