I have got my hands on a Yi home camera that is basically a hi3518 based camera. I have root terminal access to it via telnet and it is already running an FTP server among other stuff, so I can easily copy files over to it.
The first lines of dmesg are like this:
Linux version 3.0.8 (rock07@Server) (gcc version 4.4.1 (Hisilicon_v100(gcc4.4-290+uclibc_0.9.32.1+eabi+linuxpthread)) ) #1 Wed Apr 30 16:56:49 CST 2014
CPU: ARM926EJ-S  revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
So, I want to cross compile a simple "Hello World" C program for it. I downloaded the hi3518 SDK (v. 22.214.171.124) and I can successfully run the compiler.
$ arm-hisiv100nptl-linux-gcc --version
arm-hisiv100nptl-linux-gcc (Hisilicon_v100(gcc4.4-290+uclibc_0.9.32.1+eabi+linuxpthread)) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Then I wrote the simplest Hello World program I could think:
printf("\n-----------\nHello, I am the Yi camera!\n-----------\n\n\r");
I am trying to compile it with the following command:
$ arm-hisiv100nptl-linux-gcc hello.c -o hello
I also tried to specify the architecture, with the same results:
arm-hisiv100nptl-linux-gcc -march=armv5 hello.c -o hello
And an executable called "hello" is created as expected.
As soon I transfer it over the camera and making it executable (just to be sure), I get an "Illegal instruction" thrown at me when I am trying to run it.
Any ideas on why this happens? It should be pretty much straight forward to run this. What am I doing wrong?