Reply to topic  [ 6 posts ] 
LIA and how to make i2c2 the default i2c device 
Author Message

Joined: Wed Oct 03, 2012 9:42 am
Posts: 4
Post LIA and how to make i2c2 the default i2c device
Hi.
I am trying to work with LIA and so far so good.
I do have some problems like not being familiar with lisa-lia and being unable to upload the firmware as a user (operation not permitted) but fine as root. All udev rules are set no problems with LPC2148 based boards.
Anyway i know tiny-twogs inside out but i am having a problem configuring the FIXED WING airframe file for LIA to use I2C2.
I don't want to use I2C1 as i need those two servo channels so i must use I2C2 but with an external
IMU from sparkfun which is compatible with ppzuav.
My question is how to make I2C2 the default i2c device for communication with all my i2c peripherals
like the imu, the barometer, airspeed sensor etc, something like equating I2C2 with I2C0 only found in tiny/twog/Yapa.
I can do it from inside the imu's module xml file but this is not right because if i change to a tiny board then i will have to edit it again and i do forget things now that i am older.
Also the module is not loaded traditionaly through the "modules" section thus i can't rename it
in order to have a "ins_ppzuav_i2c0.xml" and a "ins_ppzuav_i2c2.xml"
Thank you all for your time.

Here is a part from my airframe file:
<define name="AGR_CLIMB"/>
<define name="LOITER_TRIM"/>
<define name="WIND_INFO"/>
<define name="WIND_INFO_RET"/>
<define name="STRONG_WIND"/>
<define name="ALT_KALMAN"/>
<define name="USE_SERVOS_7AND8"/>
<define name="USE_I2C2"/>
<subsystem name="telemetry" type="transparent">
<configure name="MODEM_BAUD" value="B9600"/>
<configure name="MODEM_PORT" value="UART2"/>
<!-- <configure name="MODEM_LED" value="none"/> -->
</subsystem>
<subsystem name="gps" type="ublox">
<configure name="GPS_BAUD" value="B38400"/>
<configure name="GPS_PORT" value="UART3"/>
<!-- <configure name="GPS_LED" value="none"/> -->
</subsystem>
<subsystem name="control" />
<subsystem name="radio_control" type="ppm"/>
<subsystem name="navigation" />
<subsystem name="imu" type="ppzuav"/>
<subsystem name="ahrs" type="float_dcm"/>
<configure name="USE_MAGNETOMETER" value="0"/>


Wed Oct 03, 2012 9:53 am
Profile

Joined: Wed Oct 03, 2012 9:42 am
Posts: 4
Post Re: LIA and how to make i2c2 the default i2c device
OK i solved it by adding some definitions to the airframe file and tweaking the module's source code.
Now if i make a mistake and don't configure the I2C interface correctly i get either an automatic correction or an error stating what i missed.
UPDATE: Sorry guys for wasting your time, there is a makefile where the I2C2 equal I2C0 when stm32 is used so actually somebody has thought of this before me.
Of course the definitions inside the module's xml file were misleading.
Now only that problem with uploading the firmware as a user remains
"usb.USBError: could not claim interface 3: Operation not permitted"
Chris


Last edited by hendrix on Wed Oct 03, 2012 1:03 pm, edited 1 time in total.



Wed Oct 03, 2012 12:05 pm
Profile

Joined: Mon Sep 05, 2011 10:26 pm
Posts: 66
Post Re: LIA and how to make i2c2 the default i2c device
Hello
did you try wih sudo before make AIRCRAFT=..... ?
I got similar problem and with sudo works fine.

Regards,

David


Wed Oct 03, 2012 1:02 pm
Profile

Joined: Wed Oct 03, 2012 9:42 am
Posts: 4
Post Re: LIA and how to make i2c2 the default i2c device
Quote:
did you try wih sudo before make AIRCRAFT=..... ?
I got similar problem and with sudo works fine.

HI.
Yes with sudo (as root that is) everything works fine but i don't like this method.
I don't know if this is a Paparazzi problem or an Ubuntu 12.04 LTS one but i suspect that the latter is true.
Chris


Wed Oct 03, 2012 1:06 pm
Profile

Joined: Tue Jun 21, 2011 7:34 pm
Posts: 116
Post Re: LIA and how to make i2c2 the default i2c device
We started seeing the requirement for sudo 11.10 onwards.
Perhaps ask for fixes on the paparazzi IRC channel?


Fri Oct 05, 2012 10:27 pm
Profile

Joined: Wed Oct 03, 2012 9:42 am
Posts: 4
Post Re: LIA and how to make i2c2 the default i2c device
I know now that is a 12.04 problem and i have already asked in the mailing list with no luck yet.
I think i will fallback to 10.04 which i think is way better than 12.04 not only for Paparazzi.
Chris


Fri Oct 05, 2012 10:52 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.