[Klone-users] insmod or launching a script on the foxboard
Stefano Barbato
barbato at koanlogic.com
Thu Sep 25 09:25:01 EDT 2008
Hi,
the way we suggest is the one described in the howto I sent you.
"AXIS_USABLE_LIBS = UCLIBC GLIB" is related to Axis SDK but KLone
framework is not based on that. What you read in fox-vhdl Makefile is
the integration of the old klone framework into Axis/Fox SDK; you
don't need to to that.
bye,
s
On 25/set/08, at 14:02, smlabs wrote:
> Hi Stefano,
>
> starting from scratch the compile process end without errors, in
> particular I used the following make file:
>
> KLONE_VERSION ?= 2.1.0
> KLONE_CONF_ARGS ?= --disable_cxx
> MAKL_PLATFORM = linux-cris-axis
> SUBDIR = $(CURDIR)/libmy
> WEBAPP_DIR = $(CURDIR)/webapp
> WEBAPP_CFLAGS = -I$(CURDIR)/include
> WEBAPP_LDADD = $(CURDIR)/libmy/libmy.a
>
> include klapp.mk
> klapp.mk: ; wget -O $@ -c http://koanlogic.com/klone/klapp-2.0.0.mk
>
> I have also added the line MAKL_PLATFORM = linux-cris-axis in the
> make files in libmy subdirs.
>
> Does is right? Because reading the fox-vhdl project on klone-support
> page I noted that the make file is quite different. In fact
> at the beginning there're twi rows that I would add:
> AXIS_USABLE_LIBS = UCLIBC GLIBC
> include $(AXIS_TOP_DIR)/tools/build/Rules.axis
>
> which is the right way to write down a make file for the foxboard
> and building klone applications?
>
> thank you, your suggestions are very important!
>
> Stefano Barbato ha scritto:
>> did you followed ALL the steps in the tutorial? did you start from
>> scratch (i.e. empty directory)? I just tried myself and it worked
>> flawlessy (klapp-minimal also works).
>> bye,
>> s
>>
>>
>>
>> On 24/set/08, at 23:58, smlabs wrote:
>>
>>> hi Stefano,
>>>
>>> I added the line: MAKL_PLATFORM = linux-cris-axis in the make file.
>>>
>>> When I compile klapp-minimal-... for the foxboard I achieved the
>>> following:
>>>
>>> ....
>>> make[2]: Leaving directory `/home/foxboard/devboard-R2_01/apps/
>>> klapp-minimal-lib-1.1.0/klone-2.1.0'
>>> make[2]: Entering directory `/home/foxboard/devboard-R2_01/apps/
>>> klapp-minimal-lib-1.1.0/klone-2.1.0'
>>> make[3]: Entering directory `/home/foxboard/devboard-R2_01/apps/
>>> klapp-minimal-lib-1.1.0/klone-2.1.0'
>>> make[3]: Nothing to be done for `klone-make-pre'.
>>> ==> building...
>>> grep: /home/foxboard/devboard-R2_01/apps/klapp-minimal-lib-1.1.0/
>>> klone-2.1.0/build/host/klone-core-2.1.0/Makefile.conf: Nessun file
>>> o directory
>>> make[4]: Entering directory `/home/foxboard/devboard-R2_01/apps/
>>> klapp-minimal-lib-1.1.0/klone-2.1.0'
>>> ==> importing klone-app content...
>>> make[5]: Entering directory `/home/foxboard/devboard-R2_01/apps/
>>> klapp-minimal-lib-1.1.0/klone-2.1.0'
>>> make[5]: Nothing to be done for `import-pre'.
>>> make[5]: Leaving directory `/home/foxboard/devboard-R2_01/apps/
>>> klapp-minimal-lib-1.1.0/klone-2.1.0'
>>> /bin/sh: line 1: /home/foxboard/devboard-R2_01/apps/klapp-minimal-
>>> lib-1.1.0/klone-2.1.0/build/host/klone-core-2.1.0/src/tools/klone/
>>> klone: Nessun file o directory
>>> make[4]: *** [import] Error 127
>>> make[4]: Leaving directory `/home/foxboard/devboard-R2_01/apps/
>>> klapp-minimal-lib-1.1.0/klone-2.1.0'
>>> make[3]: *** [klone-make] Error 1
>>> make[3]: Leaving directory `/home/foxboard/devboard-R2_01/apps/
>>> klapp-minimal-lib-1.1.0/klone-2.1.0'
>>> make[2]: *** [.real-klone-make] Error 2
>>> make[2]: Leaving directory `/home/foxboard/devboard-R2_01/apps/
>>> klapp-minimal-lib-1.1.0/klone-2.1.0'
>>> make[1]: *** [target-options-default] Error 1
>>> make[1]: Leaving directory `/home/foxboard/devboard-R2_01/apps/
>>> klapp-minimal-lib-1.1.0/klone-2.1.0'
>>> make: *** [all] Error 2
>>>
>>> where's the mistake?
>>>
>>> thank you
>>>
>>> Stefano Barbato ha scritto:
>>>>
>>>> This is a step-by-step howto:
>>>> http://www.acmesystems.it/?id=25
>>>>
>>>> Follow the "Using Klone with FOX Board Phrozen SDK" section.
>>>>
>>>> bye,
>>>> s
>>>>
>>>>
>>>> On 24/set/08, at 22:56, smlabs wrote:
>>>>
>>>>> Thanks Stefano.
>>>>> You are right I compiled for the wrong CPU.
>>>>>
>>>>> I tried to run "make cris-axis-linux-gnuuclibc" in the directoy
>>>>> of klapp-minimal-lib-1.1.0
>>>>> but I received the following:
>>>>> make: *** No rule to make target `cris-axis-linux-gnuuclib'.
>>>>> Stop.
>>>>>
>>>>> why?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> before nake
>>>>>
>>>>> Stefano Barbato ha scritto:
>>>>>>> [root at axis /mnt/flash]711# ./kloned ./kloned: 1: Syntax error:
>>>>>>> "(" unexpected
>>>>>>
>>>>>> This usually happens on the FoxBoard when running applications
>>>>>> compiled for the wrong CPU (for example if you try to run x86
>>>>>> code on the FOX) or applications compiled for the GNU libc when
>>>>>> uClibc is in use (or vice versa).
>>>>>>
>>>>>> See: http://tech.groups.yahoo.com/group/foxboard/message/1358
>>>>>>
>>>>>> bye,
>>>>>> s
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 24/set/08, at 22:05, smlabs wrote:
>>>>>>
>>>>>>> Hello again,
>>>>>>>
>>>>>>> using the full path end checjking the ruturn status I achieved
>>>>>>> the same error:
>>>>>>>
>>>>>>> [root at axis /mnt/flash]711# ./kloned ./kloned: 1: Syntax error:
>>>>>>> "(" unexpected
>>>>>>>
>>>>>>>
>>>>>>> maybe the "cdBluez-start" script it doesn't right. In the
>>>>>>> following the script:
>>>>>>>
>>>>>>> #! /bin/sh
>>>>>>> /sbin/insmod /lib/modules/2.4.31/kernel/net/bluetooth/
>>>>>>> bluetooth.ko
>>>>>>> /sbin/insmod /lib/modules/2.4.31/kernel/net/bluetooth/l2cap.ko
>>>>>>> /sbin/insmod /lib/modules/2.4.31/kernel/net/bluetooth/rfcomm/
>>>>>>> rfcomm.ko
>>>>>>> /sbin/insmod /lib/modules/2.4.31/kernel/drivers/bluetooth/
>>>>>>> hci_usb.ko
>>>>>>> hciconfig hci0 up name fox
>>>>>>>
>>>>>>> any suggestions?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> smlabs ha scritto:
>>>>>>>> thanks thomas. I'll try.
>>>>>>>> In your opinion to launch a bash script is better system or
>>>>>>>> exec or shell_exec?
>>>>>>>>
>>>>>>>> regards
>>>>>>>>
>>>>>>>> thomas fossati ha scritto:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> On Sep 24, 2008, at 7:45 AM, smlabs wrote:
>>>>>>>>>> In particular I downloaded the project klapp-minimal-
>>>>>>>>>> lib-1.1.0/ (from klone wiki) and I added in my.c the
>>>>>>>>>> following functions:
>>>>>>>>>> /void functionBlue(void)
>>>>>>>>>> {
>>>>>>>>>> system("cd /mnt/flash/");
>>>>>>>>>> system("./cdBluez-start");
>>>>>>>>>> return;
>>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> It'd be better to call system(3) once with the full path of
>>>>>>>>> the script, also check the return status of the syscall:
>>>>>>>>>
>>>>>>>>> int rc;
>>>>>>>>> switch ((rc = system("/mnt/flash/cdBluez-start")))
>>>>>>>>> {
>>>>>>>>> case -1:
>>>>>>>>> warn("waitpid or fork failure: %s", strerror(errno));
>>>>>>>>> break;
>>>>>>>>> case 0: /* this should be ok */
>>>>>>>>> break;
>>>>>>>>> case 127:
>>>>>>>>> warn("shell execution failed");
>>>>>>>>> break;
>>>>>>>>> default:
>>>>>>>>> warn("cdBluez-start returned with status %d", rc);
>>>>>>>>> break;
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> Otherwise, since system(3) spawns a different shell each
>>>>>>>>> time it is invoked, the first "cd /mnt/flash" is lost when
>>>>>>>>> the "./cdBluez-start" is called.
>>>>>>>>>
>>>>>>>>>> The compiling process doesn't give any errors.
>>>>>>>>>> But when I launch kloned from the konsole on my foxboard I
>>>>>>>>>> received:
>>>>>>>>>> /[root at axis /mnt/flash]706# ./kloned
>>>>>>>>>> ./kloned: 1: Syntax error: "(" unexpected
>>>>>>>>>
>>>>>>>>> the unexpected "(" is an error message coming from the
>>>>>>>>> bourne shell, it depends on your script.
>>>>>>>>>
>>>>>>>>> Hope it helps, t.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> Klone-users mailing list
>>>>>>>>> Klone-users at koanlogic.com
>>>>>>>>> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Klone-users mailing list
>>>>>>>> Klone-users at koanlogic.com
>>>>>>>> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Klone-users mailing list
>>>>>>> Klone-users at koanlogic.com
>>>>>>> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Klone-users mailing list
>>>>>> Klone-users at koanlogic.com
>>>>>> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Klone-users mailing list
>>>>> Klone-users at koanlogic.com
>>>>> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Klone-users mailing list
>>>> Klone-users at koanlogic.com
>>>> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>>>>
>>>
>>> _______________________________________________
>>> Klone-users mailing list
>>> Klone-users at koanlogic.com
>>> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>>>
>>
>>
>> _______________________________________________
>> Klone-users mailing list
>> Klone-users at koanlogic.com
>> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>>
>
> _______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>
More information about the Klone-users
mailing list