errors during cc3d revo compile #2

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

errors during cc3d revo compile #2

Chris
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

flixr
Administrator
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

Chris
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

Chris
In reply to this post by Chris
The airframe file follows:

<!DOCTYPE airframe SYSTEM "../airframe.dtd">

<!--
     XENO DELTA WING
     Telemetry and rc control using a single OpenLrsng receiver in transparent mode.
-->

<airframe name="xeno_cc3d_revo_mini.xml">

<firmware name="fixedwing">

<target name="ap"             board="openpilot_revo_mini_1.0"/>
<target name="sim"             board="pc"/>


<!--#######################################################################################-->
<!--##############################   GLOBAL DEFINITIONS   #################################-->
<!--#######################################################################################-->
<!-- "define" goes to the C preprocessor, "configure" configures the makefile -->

        <define name="AGR_CLIMB"/> 
    <define name="WIND_INFO"/>
    <define name="WIND_INFO_RET"/>
    <define name="STRONG_WIND"/>
     <define name="USE_ADC_1"/>
    <define name="USE_ADC_2"/>
<!--    <define name="USE_ADC_3"/>    -->
<!--    <define name="USE_ADC_4"/>    -->
    <define name="AHRS_TRIGGERED_ATTITUDE_LOOP"/>
    <define name="USE_AHRS_GPS_ACCELERATIONS"/>
<!--    <define name="USE_AIRSPEED"/>  -->
<!--    <define name="MEASURE_AIRSPEED"/>    -->
<!--    <define name="USE_BAROMETER"/>  -->
<!--
    <configure name="PERIODIC_FREQUENCY" value="120"/>
    <configure name="AHRS_PROPAGATE_FREQUENCY" value="100"/>
    <configure name="AHRS_CORRECT_FREQUENCY" value="100"/>
-->

<!--    <define name="USE_GROUNDSPEED_CONTROL"/> -->
<!--    <define name="ADC_CHANNEL_VSUPPLY" value="ADC_1" />  -->
<!--    <define name="USE_INS_NAV_INIT" value=TRUE"/> --> <!--Set Home to flight plan coordinates -->

<!--#######################################################################################-->
<!--##############################     SUBSYSTEMS         #################################-->
<!--#######################################################################################-->
<!-- "define" goes to the C preprocessor, "configure" configures the makefile -->

    <subsystem name="telemetry" type="transparent"> 
              <configure name="MODEM_BAUD" value="B9600"/> 
              <configure name="MODEM_PORT" value="UART6"/>
<!--             <configure name="MODEM_LED"  value="5"/>  -->
        </subsystem>
        <subsystem name="gps" type="ublox">
             <configure name="GPS_BAUD"          value="B38400"/>
             <configure name="GPS_PORT"          value="UART1"/>
<!--         <configure name="GPS_LED"           value="none"/> -->
        </subsystem>

    <subsystem name="control" />
    <subsystem name="radio_control" type="ppm">
        <configure name="RADIO_CONTROL_PPM_PIN" value="SERVO_6_IN"/>
    </subsystem>
    <subsystem name="navigation"/> 
    <subsystem name="imu"    type="mpu6000_hmc5883">
        <configure name="IMU_MPU_SPI_DEV" value="spi1"/>
        <configure name="IMU_MPU_SPI_SLAVE_IDX" value="SPI_SLAVE1"/>
        <configure name="IMU_HMC_I2C_DEV" value="i2c1"/>
    </subsystem>
    <subsystem name="ahrs" type="float_dcm"/>
    <subsystem name="ins" type="alt_float"/>
        <configure name="USE_MAGNETOMETER" value="0"/>
    <subsystem name="spi" type="master"/>

</firmware>
<!--#######################################################################################-->
<!--################################      MODULES         #################################-->
<!--#######################################################################################-->
 <modules>
    <load name="nav_line.xml"/>
    <load name="gps_ubx_ucenter.xml"/>
    <load name="my_baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />    <!-- affects the makefile -->
        <define name="MS5611_SLAVE_ADDR=0xEE"/>            <!-- affects the c files -->
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
        <!--<define name="SENSOR_SYNC_SEND"/> -->
    </load>
</modules>

<!--#######################################################################################-->
<!--#############################   SERVOS AND CONTROLS   #################################-->
<!--#######################################################################################-->
<!-- commands section -->
<servos>
    <servo name="AILEVON_RIGHT"    no="0" min="988"    neutral="1500" max="2012"/>
    <servo name="AILEVON_LEFT"    no="1" min="2012"    neutral="1500" max="988"/>
    <servo name="MOTOR"        no="2" min="1000"    neutral="1000" max="2000"/>
    <servo name="CAMERA_PAN"    no="6" min="700"    neutral="1420" max="2200"/>
    <servo name="CAMERA_TILT"    no="7" min="950"    neutral="1500" max="2050"/>
</servos>

<commands>
    <axis name="ROLL"        failsafe_value="0"/>
    <axis name="PITCH"        failsafe_value="0"/>
    <axis name="THROTTLE"        failsafe_value="0"/>
    <axis name="CAM_PAN"        failsafe_value="0"/>
    <axis name="CAM_TILT"        failsafe_value="0"/>
</commands>

<rc_commands>
    <set command="ROLL"          value="@ROLL"/>
    <set command="PITCH"         value="@PITCH"/>
    <set command="THROTTLE"      value="@THROTTLE"/>
</rc_commands>

  <section name="MIXER">
    <define name="AILEVON_AILERON_RATE" value="0.75"/>
    <define name="AILEVON_ELEVATOR_RATE" value="0.75"/>
  </section>

  <command_laws>
    <let var="aileron"  value="@ROLL  * AILEVON_AILERON_RATE"/>
    <let var="elevator" value="@PITCH * AILEVON_ELEVATOR_RATE"/>
    <set servo="MOTOR"            value="@THROTTLE"/>
    <set servo="AILEVON_LEFT"        value="$elevator + $aileron"/>
    <set servo="AILEVON_RIGHT"        value="$elevator - $aileron"/>
    <set servo="CAMERA_PAN"        value="@CAM_PAN"/>
    <set servo="CAMERA_TILT"        value="@CAM_TILT"/>
  </command_laws>

<!-- EMPTY "auto_rc_commands" block means NO RC RUDDER CONTROL IN AUTO2 AND AUTO1 -->
 <auto_rc_commands>
<!--    <set command="YAW" value="@YAW"/> -->
 </auto_rc_commands>


<ap_only_commands>
</ap_only_commands>

<!--#######################################################################################-->
<!--#################################    I M U SETUP      #################################-->
<!--#######################################################################################-->

<!-- Normalized Local magnetic field obtained from http://www.ngdc.noaa.gov/geomag-web/#igrfwmm -->
<!-- Magnetic field intensity / total field strength -->
<!-- Calculated for PIRAEUS HELLAS 10 APRIL 2013 -->
  <section name="AHRS" prefix="AHRS_" >
    <define name="H_X" value="(26536.1/45817.2)" />
    <define name="H_Y" value="(1843.5/45817.2)" />
    <define name="H_Z" value="(37304.9/45817.2) " />
  </section>

  <section name="IMU" prefix="IMU_">
    <!-- Calibration Neutral -->
    <define name="GYRO_P_NEUTRAL" value="0"/>
    <define name="GYRO_Q_NEUTRAL" value="0"/>
    <define name="GYRO_R_NEUTRAL" value="0"/>

    <!-- SENS = 14.375 LSB/(deg/sec) * 57.6 deg/rad = 828 LSB/rad/sec / 12bit FRAC: 4096 / 828 -->
    <define name="GYRO_P_SENS" value="4.947" integer="16"/>
    <define name="GYRO_Q_SENS" value="4.947" integer="16"/>
    <define name="GYRO_R_SENS" value="4.947" integer="16"/>

    <define name="GYRO_P_Q" value="0."/>
    <define name="GYRO_P_R" value="0"/>
    <define name="GYRO_Q_P" value="0."/>
    <define name="GYRO_Q_R" value="0."/>
    <define name="GYRO_R_P" value="0."/>
    <define name="GYRO_R_Q" value="0."/>

    <define name="GYRO_P_SIGN" value="1"/>
    <define name="GYRO_Q_SIGN" value="1"/>
    <define name="GYRO_R_SIGN" value="1"/>

    <define name="ACCEL_X_NEUTRAL" value="0"/>
    <define name="ACCEL_Y_NEUTRAL" value="0"/>
    <define name="ACCEL_Z_NEUTRAL" value="0"/>

    <!-- SENS = 256 LSB/g @ 2.5V [X&Y: 265 LSB/g @ 3.3V] / 9.81 ms2/g = 26.095 LSB/ms2 / 10bit FRAC: 1024 / 26.095 for z and 1024 / 27.01 for X&Y -->
    <define name="ACCEL_X_SENS" value="37.9" integer="16"/>
    <define name="ACCEL_Y_SENS" value="37.9" integer="16"/>
    <define name="ACCEL_Z_SENS" value="39.24" integer="16"/>

    <define name="ACCEL_X_SIGN" value="1"/>
    <define name="ACCEL_Y_SIGN" value="1"/>
    <define name="ACCEL_Z_SIGN" value="1"/>

    <define name="MAG_X_NEUTRAL" value="0"/>
    <define name="MAG_Y_NEUTRAL" value="0"/>
    <define name="MAG_Z_NEUTRAL" value="0"/>

    <define name="MAG_X_SENS" value="1" integer="16"/>
    <define name="MAG_Y_SENS" value="1" integer="16"/>
    <define name="MAG_Z_SENS" value="1" integer="16"/>

    <define name="MAG_X_SIGN" value="1"/>
    <define name="MAG_Y_SIGN" value="1"/>
    <define name="MAG_Z_SIGN" value="1"/>

    <define name="BODY_TO_IMU_PHI" value="0"/>
    <define name="BODY_TO_IMU_THETA" value="0"/>
    <define name="BODY_TO_IMU_PSI" value="0"/>
  </section>

<!--#######################################################################################-->
<!--##################   AIRCRAFT ATTITUDE TRIMMING AND AUTO1 LIMITS  #####################-->
<!--#######################################################################################-->
<section name="INS" prefix="INS_">
    <define name="ROLL_NEUTRAL_DEFAULT" value="RadOfDeg(-2)" unit="radians"/>
    <define name="PITCH_NEUTRAL_DEFAULT" value="RadOfDeg(0)" unit="radians"/>
</section>

<section name="AUTO1" prefix="AUTO1_">
    <define name="MAX_ROLL" value="50" unit="deg"/>
    <define name="MAX_PITCH" value="30" unit="deg"/>
</section>


<!--#######################################################################################-->
<!--#########################   AIRCRAFT  VERTICAL CONTROL SETUP   ########################-->
<!--#######################################################################################-->
<section name="VERTICAL CONTROL" prefix="V_CTL_">
                    <!-- OUTER LOOP PARAMETERS  -->
<!-- The below definition affect the throttle percentage shown on the GCS. -->
    <define name="POWER_CTL_BAT_NOMINAL" value="16.8" unit="volt"/>
    <!-- outer loop ALTITUDE proportional gain -->
    <define name="ALTITUDE_PGAIN" value="0.07" unit="(m/s)/m"/>
    <!-- outer loop ALTITUDE LIMIT (saturation) -->
    <define name="ALTITUDE_MAX_CLIMB" value="3" unit="m/s"/>
    <!-- outer loop AIRSPEED proportional gain -->
    <define name="AIRSPEED_PGAIN"    value="0.2"/>

                   <!-- INNER LOOP PARAMETERS -->
        <!-- The below definitions are used almost always -->
    <define name="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE"    value="0.40" unit="%"/>
    <define name="AUTO_THROTTLE_MIN_CRUISE_THROTTLE"    value="0.30" unit="%"/>
    <define name="AUTO_THROTTLE_MAX_CRUISE_THROTTLE"    value="0.50" unit="%"/>
    <define name="THROTTLE_SLEW_LIMITER"             value="0.6" unit="s"/>
    <define name="AUTO_PITCH_MAX_PITCH"            value="RadOfDeg(25)"/>
    <define name="AUTO_PITCH_MIN_PITCH"            value="RadOfDeg(-20)"/>
   
    <!-- Climb loop (throttle) -->
    <define name="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT"     value="0.1"  unit="%/(m/s)"/>
    <define name="AUTO_THROTTLE_NOMINAL_CRUISE_PITCH"    value="0.0" unit="rad"/>

    <define name="AUTO_THROTTLE_PGAIN"            value="0.008"unit="%/(m/s)"/>
    <define name="AUTO_THROTTLE_IGAIN"            value="0.0"/>
    <define name="AUTO_THROTTLE_DGAIN"             value="0.001"/>

    <!-- Climb loop (pitch) -->
        <!-- magnitude of elevator movement on altitude change -->
    <define name="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN"        value="0.15" unit="rad/(m/s)"/> <!-- 0.05 -->
        <define name="AUTO_PITCH_PGAIN"                value="0.04"/> <!--0.052-->
        <define name="AUTO_PITCH_IGAIN"                value="0.01"/> <!--0.065-->
        <define name="AUTO_PITCH_DGAIN"                value="0.0"/>

    <!-- Loiter and Dash trimming -->
    <define name="AUTO_THROTTLE_LOITER_TRIM"        value="0" unit="pprz_t"/>
    <define name="AUTO_THROTTLE_DASH_TRIM"            value="0" unit="pprz_t"/>
    <define name="PITCH_LOITER_TRIM"            value="0" unit="pprz_t"/>
    <define name="PITCH_DASH_TRIM"                value="0" unit="pprz_t"/>

        <!-- The below definitions are used when USE_AIRSPEED is defined -->
    <define name="AUTO_AIRSPEED_SETPOINT" value="14.5" unit="m/s"/>
    <define name="AUTO_AIRSPEED_PGAIN" value="0.060"/>
    <define name="AUTO_AIRSPEED_IGAIN" value="0.050"/>
    <define name="AUTO_GROUNDSPEED_SETPOINT" value="6.0" unit="m/s"/>
    <define name="AUTO_GROUNDSPEED_PGAIN" value="0.75"/>
    <define name="AUTO_GROUNDSPEED_IGAIN" value="0.25"/>

        <!-- The below definitions are used for the "energy" control loop -->
    <define name="AUTO_THROTTLE_OF_AIRSPEED_PGAIN"         value="0" />
    <define name="AUTO_THROTTLE_OF_AIRSPEED_IGAIN"         value="0.01" />
    <define name="AUTO_PITCH_OF_AIRSPEED_PGAIN"         value="0" />
    <define name="AUTO_PITCH_OF_AIRSPEED_IGAIN"         value="0" />
    <define name="AUTO_PITCH_OF_AIRSPEED_DGAIN"         value="0" />

    <define name="ENERGY_TOT_PGAIN"                value="0.35" />
    <define name="ENERGY_TOT_IGAIN"                value="0.25" />
    <define name="ENERGY_DIFF_PGAIN"            value="0.30" />
    <define name="ENERGY_DIFF_IGAIN"            value="0.20" />
    <define name="DESIRED_ACCELERATION"            value="0.3" />
    <define name="MAX_ACCELERATION"                value="0.5" />

</section>

<!--#######################################################################################-->
<!--########################   AIRCRAFT HORIZONTAL CONTROL SETUP   ########################-->
<!--#######################################################################################-->

<section name="HORIZONTAL CONTROL" prefix="H_CTL_">
    <define name="COURSE_PGAIN"                value="0.8"/>
        <define name="COURSE_DGAIN"                value="0.8"/>
        <define name="COURSE_PRE_BANK_CORRECTION"        value="1."/>

    <define name="PITCH_MAX_SETPOINT"            value="20" unit="deg"/>
    <define name="PITCH_MIN_SETPOINT"            value="-20" unit="deg"/>
    <define name="PITCH_PGAIN"                value="8000."/>
    <define name="ROLL_MAX_SETPOINT"            value="30" unit="deg"/>
    <define name="ROLL_SLEW"                value="0.1"/>
    <define name="ROLL_ATTITUDE_GAIN"            value="8000"/>
    <define name="ROLL_RATE_GAIN"                value="500."/>

    <define name="PITCH_OF_ROLL"                value="RadOfDeg(1.0)"/>
    <define name="ELEVATOR_OF_ROLL"                value="1250"/>
    <define name="AILERON_OF_THROTTLE"            value="0.0"/>

    <!-- The below definitions are used only for stabilization adaptive -->
    <define name="PITCH_DGAIN"                value="6."/>
    <define name="PITCH_IGAIN"                value="100."/>
    <define name="ROLL_KFFA"                value="0"/>
    <define name="ROLL_KFFD"                value="0"/>
    <define name="PITCH_KFFA"                value="0."/>
    <define name="PITCH_KFFD"                value="0."/>
</section>


<!--#######################################################################################-->
<!--############################    AIRBORNE BATTERY SETUP    #############################-->
<!--#######################################################################################-->
<section name="BAT">
    <!-- FOR USE WITH A CURRENT SENSOR  -->
        <define name="ADC_CHANNEL_CURRENT"            value="ADC_2" />
    <define name="MilliAmpereOfAdc(adc)"            value="(24*adc)"/>
<!--    <define name="VOLTAGE_ADC_A" value="0.080252493"/> -->
    <define name="VOLTAGE_ADC_A" value="0.009422237"/>
        <define name="VOLTAGE_ADC_B" value="0.0"/>
        <define name="VoltageOfAdc(adc)" value ="(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)"/>
<!--    <define name="MILLIAMP_AT_FULL_THROTTLE"        value="18000"/>  -->
    <define name="BAT_CAPACITY"                value="5000."/>
    <define name="FUEL_RESERVE_SECONDS"            value="300" unit="s"/>
    <define name="CATASTROPHIC_BAT_LEVEL"            value="10" unit="V"/>
    <define name="CRITIC_BAT_LEVEL"                value="12.8" unit="V"/>
    <define name="LOW_BAT_LEVEL"                value="13.5" unit="V"/>
    <define name="MAX_BAT_LEVEL"                value="16.8" unit="V"/>
</section>

<!--#######################################################################################-->
<!--#############################    MISCELLANEOUS SETUP    ###############################-->
<!--#######################################################################################-->

<section name="MISC">
    <define name="CLIMB_AIRSPEED"                value="14." unit="m/s"/>
    <define name="GLIDE_AIRSPEED"                value="14." unit="m/s"/>
    <define name="RACE_AIRSPEED"                value="23." unit="m/s"/>
    <define name="STALL_AIRSPEED"                value="12." unit="m/s"/>
    <define name="AIRSPEED_SETPOINT_SLEW"            value="1" unit="s"/> <!--default=1-->
    <define name="NOMINAL_AIRSPEED"                value="16" unit="m/s"/>
        <define name="MINIMUM_AIRSPEED"                value="14." unit="m/s"/>
        <define name="MAXIMUM_AIRSPEED"                value="26." unit="m/s"/>
    <define name="CARROT"                    value="3." unit="s"/>
    <define name="GLIDE_RATIO"                value="7."/>
    <define name="KILL_MODE_DISTANCE"            value="(1.5*MAX_DIST_FROM_HOME)"/>
    <define name="CONTROL_FREQUENCY"            value="60" unit="Hz"/>
    <define name="XBEE_INIT"                value="\"ATPL2\rATRN1\rATTT80\r\""/>
    <define name="NO_XBEE_API_INIT"                value="TRUE"/>
    <define name="TRIGGER_DELAY"                value="1."/>
    <define name="DEFAULT_CIRCLE_RADIUS"            value="100."/>
    <define name="MIN_CIRCLE_RADIUS"            value="100."/>
    <define name="UNLOCKED_HOME_MODE"            value="TRUE"/>
    <define name="RC_LOST_MODE"                value="PPRZ_MODE_AUTO2"/>
</section>

<section name="AGGRESSIVE"        prefix="AGR_">
    <define name="BLEND_START"                value="40"/><!-- Altitude Error to Initiate Aggressive Climb CANNOT BE ZERO!!-->
    <define name="BLEND_END"                value="10"/><!-- Altitude Error to Blend Aggressive to Regular Climb Modes NOT ZERO!!-->
    <define name="CLIMB_THROTTLE"                value="1.0"/><!-- Gaz for Aggressive Climb -->
    <define name="CLIMB_PITCH"                value="RadOfDeg(20)"/><!-- Pitch for Aggressive Climb -->
    <define name="DESCENT_THROTTLE"                value="0.1"/><!-- Gaz for Aggressive Decent -->
    <define name="DESCENT_PITCH"                value="RadOfDeg(-20)"/><!-- Pitch for Aggressive Decent -->
    <define name="CLIMB_NAV_RATIO"                value="0.8"/><!-- Percent Navigation for Altitude Error Equal to Start Altitude -->
    <define name="DESCENT_NAV_RATIO"            value="1.0"/>
</section>

  <section name="NAV">
    <define name="NAV_PITCH"        value="0."/>
    <define name="NAV_GLIDE_PITCH_TRIM" value="0"/>
    <define name="NAV_GROUND_SPEED_PGAIN" value="0.015"/>
    <define name="NAV_FOLLOW_PGAIN" value="-0.05"/>
  </section>

  <section name="GLS_APPROACH" prefix="APP_">
    <define name="ANGLE" value="5"/>
    <define name="INTERCEPT_AF_TOD" value="10"/>
    <define name="TARGET_SPEED" value="13"/>
  </section>

<section name="FAILSAFE" prefix="FAILSAFE_">
    <define name="DELAY_WITHOUT_GPS"            value="1" unit="s"/>
        <define name="DEFAULT_THROTTLE"                value="0.8" unit="%"/>
        <define name="DEFAULT_ROLL"                value="10" unit="deg"/>
        <define name="DEFAULT_PITCH"                value="10" unit="deg"/>
    <define name="HOME_RADIUS"                value="100" unit="m"/>
    <define name="KILL_MODE_DISTANCE"            value="(MAX_DIST_FROM_HOME*1.5)"/>
</section>

<section name="DATALINK" prefix="DATALINK_">
    <define name="DEVICE_TYPE"                value="PPRZ"/>
    <define name="DEVICE_ADDRESS"                value="...."/>
 </section>

  <section name="DIGITAL_CAMERA" prefix="DC_">
    <define name="AUTOSHOOT_QUARTERSEC_PERIOD" value="8" unit="quarter_second"/>
    <define name="AUTOSHOOT_METER_GRID" value="100" unit="meter"/>
  </section>

  <section name="GCS">
    <define name="ALT_SHIFT_PLUS_PLUS" value="100"/>
    <define name="ALT_SHIFT_PLUS" value="10"/>
    <define name="ALT_SHIFT_MINUS" value="-10"/>
    <define name="SPEECH_NAME" value="Xeno"/>
  </section>

  <section name="SIMU">
    <define name="WEIGHT" value ="1."/>
    <define name="YAW_RESPONSE_FACTOR" value =".9"/>   <!--default 1.-->
    <define name="PITCH_RESPONSE_FACTOR" value ="1."/> <!--default 1.-->
    <define name="ROLL_RESPONSE_FACTOR" value ="15."/> <!--default 15-->
  </section>

 <makefile>
#sim.srcs += my_code.c
#ap.srcs +=  my_code.c
 </makefile>
</airframe>

On Thu, May 19, 2016 at 5:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel




_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

flixr
Administrator
In reply to this post by Chris
If you want to USE_BARO_BOARD, you also have to add the baro to baro_board.makefile and baro_board.h in the board folder.
See e.g. https://github.com/flixr/paparazzi/commit/eb5ecd494b393520fc47fbc8ce932f93b29a3f4c#diff-1e5e2b52154a92d33d68378eaf23cc1e

On Thu, May 19, 2016 at 4:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

Chris
It is done!!!
Felix is the baro now active without the need of the module or i do need to run the module also?
Btw there is a typo error in line 202
+elf ifeq ($(BOARD), revo) it should be +else ifeq ($(BOARD), revo)
Also have a look in my board header file as i have changed some things.
The board i have is this
http://www.hobbyking.com/hobbyking/store/__98336__Mini_CC3D_Revolution_32bit_F4_Based_Flight_controller_EU_Warehouse_.html
and the only differences is that it does not have the onboard 433 Mhz modem, some regulators and filters are missing and that it is is small, very small...
Chris


On Thu, May 19, 2016 at 5:48 PM, Felix Ruess <[hidden email]> wrote:
If you want to USE_BARO_BOARD, you also have to add the baro to baro_board.makefile and baro_board.h in the board folder.
See e.g. https://github.com/flixr/paparazzi/commit/eb5ecd494b393520fc47fbc8ce932f93b29a3f4c#diff-1e5e2b52154a92d33d68378eaf23cc1e

On Thu, May 19, 2016 at 4:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

flixr
Administrator
Yes, the baro is now active. The BARO_BOARD mechanism is just to make it easier to use, i.e. use the baro on the board without having to add a module.
But we might remove that or make it into a module as well: https://github.com/paparazzi/paparazzi/pull/829

Thanks for pointing out the errors, already fixed them :-)
As soon as I had the chance to actually test it on the board, I'll add it to master.

The Mini Revolution looks interesting, we don't have a driver for the modem yet anyway...

On Thu, May 19, 2016 at 5:43 PM, hendrixgr . <[hidden email]> wrote:
It is done!!!
Felix is the baro now active without the need of the module or i do need to run the module also?
Btw there is a typo error in line 202
+elf ifeq ($(BOARD), revo) it should be +else ifeq ($(BOARD), revo)
Also have a look in my board header file as i have changed some things.
The board i have is this
http://www.hobbyking.com/hobbyking/store/__98336__Mini_CC3D_Revolution_32bit_F4_Based_Flight_controller_EU_Warehouse_.html
and the only differences is that it does not have the onboard 433 Mhz modem, some regulators and filters are missing and that it is is small, very small...
Chris


On Thu, May 19, 2016 at 5:48 PM, Felix Ruess <[hidden email]> wrote:
If you want to USE_BARO_BOARD, you also have to add the baro to baro_board.makefile and baro_board.h in the board folder.
See e.g. https://github.com/flixr/paparazzi/commit/eb5ecd494b393520fc47fbc8ce932f93b29a3f4c#diff-1e5e2b52154a92d33d68378eaf23cc1e

On Thu, May 19, 2016 at 4:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

Chris
About the modem there is code for using it as an rc receiver and modem at the same time.
Also there is standalone c code to make a modem with the rfm22 (100mw) or the rfm23bp (1w)
Since we already have the spi bus and the code uses bit banging for the spi it will be easy to adapt the code.
The only obstacle i found is that i don't know how to divert the telemetry serial data to an spi port easily as i have read and understood all the code
in the openLRSngDL branch

Have a look here
https://github.com/openLRSng

and here for the data modem for the data modem using an avr (not needed if we adapt the code) and a rfm22 or rfm23bp
https://github.com/openLRSng/openLRSngDL

I use the openlrsng receiver code all the time and i make custom receivers my self
Chris


On Thu, May 19, 2016 at 7:50 PM, Felix Ruess <[hidden email]> wrote:
Yes, the baro is now active. The BARO_BOARD mechanism is just to make it easier to use, i.e. use the baro on the board without having to add a module.
But we might remove that or make it into a module as well: https://github.com/paparazzi/paparazzi/pull/829

Thanks for pointing out the errors, already fixed them :-)
As soon as I had the chance to actually test it on the board, I'll add it to master.

The Mini Revolution looks interesting, we don't have a driver for the modem yet anyway...

On Thu, May 19, 2016 at 5:43 PM, hendrixgr . <[hidden email]> wrote:
It is done!!!
Felix is the baro now active without the need of the module or i do need to run the module also?
Btw there is a typo error in line 202
+elf ifeq ($(BOARD), revo) it should be +else ifeq ($(BOARD), revo)
Also have a look in my board header file as i have changed some things.
The board i have is this
http://www.hobbyking.com/hobbyking/store/__98336__Mini_CC3D_Revolution_32bit_F4_Based_Flight_controller_EU_Warehouse_.html
and the only differences is that it does not have the onboard 433 Mhz modem, some regulators and filters are missing and that it is is small, very small...
Chris


On Thu, May 19, 2016 at 5:48 PM, Felix Ruess <[hidden email]> wrote:
If you want to USE_BARO_BOARD, you also have to add the baro to baro_board.makefile and baro_board.h in the board folder.
See e.g. https://github.com/flixr/paparazzi/commit/eb5ecd494b393520fc47fbc8ce932f93b29a3f4c#diff-1e5e2b52154a92d33d68378eaf23cc1e

On Thu, May 19, 2016 at 4:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

flixr
Administrator
FYI, added the OpenPilot revolution board files and IMU driver: https://github.com/paparazzi/paparazzi/pull/1676

On Thu, May 19, 2016 at 7:12 PM, hendrixgr . <[hidden email]> wrote:
About the modem there is code for using it as an rc receiver and modem at the same time.
Also there is standalone c code to make a modem with the rfm22 (100mw) or the rfm23bp (1w)
Since we already have the spi bus and the code uses bit banging for the spi it will be easy to adapt the code.
The only obstacle i found is that i don't know how to divert the telemetry serial data to an spi port easily as i have read and understood all the code
in the openLRSngDL branch

Have a look here
https://github.com/openLRSng

and here for the data modem for the data modem using an avr (not needed if we adapt the code) and a rfm22 or rfm23bp
https://github.com/openLRSng/openLRSngDL

I use the openlrsng receiver code all the time and i make custom receivers my self
Chris


On Thu, May 19, 2016 at 7:50 PM, Felix Ruess <[hidden email]> wrote:
Yes, the baro is now active. The BARO_BOARD mechanism is just to make it easier to use, i.e. use the baro on the board without having to add a module.
But we might remove that or make it into a module as well: https://github.com/paparazzi/paparazzi/pull/829

Thanks for pointing out the errors, already fixed them :-)
As soon as I had the chance to actually test it on the board, I'll add it to master.

The Mini Revolution looks interesting, we don't have a driver for the modem yet anyway...

On Thu, May 19, 2016 at 5:43 PM, hendrixgr . <[hidden email]> wrote:
It is done!!!
Felix is the baro now active without the need of the module or i do need to run the module also?
Btw there is a typo error in line 202
+elf ifeq ($(BOARD), revo) it should be +else ifeq ($(BOARD), revo)
Also have a look in my board header file as i have changed some things.
The board i have is this
http://www.hobbyking.com/hobbyking/store/__98336__Mini_CC3D_Revolution_32bit_F4_Based_Flight_controller_EU_Warehouse_.html
and the only differences is that it does not have the onboard 433 Mhz modem, some regulators and filters are missing and that it is is small, very small...
Chris


On Thu, May 19, 2016 at 5:48 PM, Felix Ruess <[hidden email]> wrote:
If you want to USE_BARO_BOARD, you also have to add the baro to baro_board.makefile and baro_board.h in the board folder.
See e.g. https://github.com/flixr/paparazzi/commit/eb5ecd494b393520fc47fbc8ce932f93b29a3f4c#diff-1e5e2b52154a92d33d68378eaf23cc1e

On Thu, May 19, 2016 at 4:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

Chris
Ok!
I got hold of 2 rfm23bp (1w)  so i will start writing code for it.
Maybe i will modify the uart_arch.c file to stream data to the spi port instead of the serial port.
Chris


On Thu, May 19, 2016 at 11:33 PM, Felix Ruess <[hidden email]> wrote:
FYI, added the OpenPilot revolution board files and IMU driver: https://github.com/paparazzi/paparazzi/pull/1676

On Thu, May 19, 2016 at 7:12 PM, hendrixgr . <[hidden email]> wrote:
About the modem there is code for using it as an rc receiver and modem at the same time.
Also there is standalone c code to make a modem with the rfm22 (100mw) or the rfm23bp (1w)
Since we already have the spi bus and the code uses bit banging for the spi it will be easy to adapt the code.
The only obstacle i found is that i don't know how to divert the telemetry serial data to an spi port easily as i have read and understood all the code
in the openLRSngDL branch

Have a look here
https://github.com/openLRSng

and here for the data modem for the data modem using an avr (not needed if we adapt the code) and a rfm22 or rfm23bp
https://github.com/openLRSng/openLRSngDL

I use the openlrsng receiver code all the time and i make custom receivers my self
Chris


On Thu, May 19, 2016 at 7:50 PM, Felix Ruess <[hidden email]> wrote:
Yes, the baro is now active. The BARO_BOARD mechanism is just to make it easier to use, i.e. use the baro on the board without having to add a module.
But we might remove that or make it into a module as well: https://github.com/paparazzi/paparazzi/pull/829

Thanks for pointing out the errors, already fixed them :-)
As soon as I had the chance to actually test it on the board, I'll add it to master.

The Mini Revolution looks interesting, we don't have a driver for the modem yet anyway...

On Thu, May 19, 2016 at 5:43 PM, hendrixgr . <[hidden email]> wrote:
It is done!!!
Felix is the baro now active without the need of the module or i do need to run the module also?
Btw there is a typo error in line 202
+elf ifeq ($(BOARD), revo) it should be +else ifeq ($(BOARD), revo)
Also have a look in my board header file as i have changed some things.
The board i have is this
http://www.hobbyking.com/hobbyking/store/__98336__Mini_CC3D_Revolution_32bit_F4_Based_Flight_controller_EU_Warehouse_.html
and the only differences is that it does not have the onboard 433 Mhz modem, some regulators and filters are missing and that it is is small, very small...
Chris


On Thu, May 19, 2016 at 5:48 PM, Felix Ruess <[hidden email]> wrote:
If you want to USE_BARO_BOARD, you also have to add the baro to baro_board.makefile and baro_board.h in the board folder.
See e.g. https://github.com/flixr/paparazzi/commit/eb5ecd494b393520fc47fbc8ce932f93b29a3f4c#diff-1e5e2b52154a92d33d68378eaf23cc1e

On Thu, May 19, 2016 at 4:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

Chris
One last question Felix
How did you upload the firmware, i see in the makefile that the method is "SWD" but can you describe what you did in order to upload the program?
Did you had to solder some wires?
Chris


On Fri, May 20, 2016 at 8:28 AM, hendrixgr . <[hidden email]> wrote:
Ok!
I got hold of 2 rfm23bp (1w)  so i will start writing code for it.
Maybe i will modify the uart_arch.c file to stream data to the spi port instead of the serial port.
Chris


On Thu, May 19, 2016 at 11:33 PM, Felix Ruess <[hidden email]> wrote:
FYI, added the OpenPilot revolution board files and IMU driver: https://github.com/paparazzi/paparazzi/pull/1676

On Thu, May 19, 2016 at 7:12 PM, hendrixgr . <[hidden email]> wrote:
About the modem there is code for using it as an rc receiver and modem at the same time.
Also there is standalone c code to make a modem with the rfm22 (100mw) or the rfm23bp (1w)
Since we already have the spi bus and the code uses bit banging for the spi it will be easy to adapt the code.
The only obstacle i found is that i don't know how to divert the telemetry serial data to an spi port easily as i have read and understood all the code
in the openLRSngDL branch

Have a look here
https://github.com/openLRSng

and here for the data modem for the data modem using an avr (not needed if we adapt the code) and a rfm22 or rfm23bp
https://github.com/openLRSng/openLRSngDL

I use the openlrsng receiver code all the time and i make custom receivers my self
Chris


On Thu, May 19, 2016 at 7:50 PM, Felix Ruess <[hidden email]> wrote:
Yes, the baro is now active. The BARO_BOARD mechanism is just to make it easier to use, i.e. use the baro on the board without having to add a module.
But we might remove that or make it into a module as well: https://github.com/paparazzi/paparazzi/pull/829

Thanks for pointing out the errors, already fixed them :-)
As soon as I had the chance to actually test it on the board, I'll add it to master.

The Mini Revolution looks interesting, we don't have a driver for the modem yet anyway...

On Thu, May 19, 2016 at 5:43 PM, hendrixgr . <[hidden email]> wrote:
It is done!!!
Felix is the baro now active without the need of the module or i do need to run the module also?
Btw there is a typo error in line 202
+elf ifeq ($(BOARD), revo) it should be +else ifeq ($(BOARD), revo)
Also have a look in my board header file as i have changed some things.
The board i have is this
http://www.hobbyking.com/hobbyking/store/__98336__Mini_CC3D_Revolution_32bit_F4_Based_Flight_controller_EU_Warehouse_.html
and the only differences is that it does not have the onboard 433 Mhz modem, some regulators and filters are missing and that it is is small, very small...
Chris


On Thu, May 19, 2016 at 5:48 PM, Felix Ruess <[hidden email]> wrote:
If you want to USE_BARO_BOARD, you also have to add the baro to baro_board.makefile and baro_board.h in the board folder.
See e.g. https://github.com/flixr/paparazzi/commit/eb5ecd494b393520fc47fbc8ce932f93b29a3f4c#diff-1e5e2b52154a92d33d68378eaf23cc1e

On Thu, May 19, 2016 at 4:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel




_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

Chris
Ok i get an error when i am trying to compile the openpilot revo board (not the mini) on 5.8.1 with files taken from the master branch.
I guess there are differences between the master and 5.8.1 concerning the GPS_link macro?
(i have tried both UART2 and UART3)
The funny thing is that my version of the mini compiles fine.....

CC /home/hendrix/paparazzi/var/aircrafts/Quad_Revolution/ap/arch/stm32/subsystems/settings_arch.o
./subsystems/gps/gps_ubx.h: In function 'GpsEvent':
<command-line>:0:10: error: 'UART3' undeclared (first use in this function)
./subsystems/gps/gps_ubx.h:103:32: note: in expansion of macro 'GPS_LINK'
   struct link_device *dev = &((GPS_LINK).device);
                                ^
<command-line>:0:10: note: each undeclared identifier is reported only once for each function it appears in
./subsystems/gps/gps_ubx.h:103:32: note: in expansion of macro 'GPS_LINK'
   struct link_device *dev = &((GPS_LINK).device);
                                ^
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/Quad_Revolution/ap/subsystems/settings.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

FAILED 'make -C /home/hendrix/paparazzi -f Makefile.ac AIRCRAFT=Quad_Revolution ap.compile' with code 2

On Fri, May 20, 2016 at 8:54 AM, hendrixgr . <[hidden email]> wrote:
One last question Felix
How did you upload the firmware, i see in the makefile that the method is "SWD" but can you describe what you did in order to upload the program?
Did you had to solder some wires?
Chris


On Fri, May 20, 2016 at 8:28 AM, hendrixgr . <[hidden email]> wrote:
Ok!
I got hold of 2 rfm23bp (1w)  so i will start writing code for it.
Maybe i will modify the uart_arch.c file to stream data to the spi port instead of the serial port.
Chris


On Thu, May 19, 2016 at 11:33 PM, Felix Ruess <[hidden email]> wrote:
FYI, added the OpenPilot revolution board files and IMU driver: https://github.com/paparazzi/paparazzi/pull/1676

On Thu, May 19, 2016 at 7:12 PM, hendrixgr . <[hidden email]> wrote:
About the modem there is code for using it as an rc receiver and modem at the same time.
Also there is standalone c code to make a modem with the rfm22 (100mw) or the rfm23bp (1w)
Since we already have the spi bus and the code uses bit banging for the spi it will be easy to adapt the code.
The only obstacle i found is that i don't know how to divert the telemetry serial data to an spi port easily as i have read and understood all the code
in the openLRSngDL branch

Have a look here
https://github.com/openLRSng

and here for the data modem for the data modem using an avr (not needed if we adapt the code) and a rfm22 or rfm23bp
https://github.com/openLRSng/openLRSngDL

I use the openlrsng receiver code all the time and i make custom receivers my self
Chris


On Thu, May 19, 2016 at 7:50 PM, Felix Ruess <[hidden email]> wrote:
Yes, the baro is now active. The BARO_BOARD mechanism is just to make it easier to use, i.e. use the baro on the board without having to add a module.
But we might remove that or make it into a module as well: https://github.com/paparazzi/paparazzi/pull/829

Thanks for pointing out the errors, already fixed them :-)
As soon as I had the chance to actually test it on the board, I'll add it to master.

The Mini Revolution looks interesting, we don't have a driver for the modem yet anyway...

On Thu, May 19, 2016 at 5:43 PM, hendrixgr . <[hidden email]> wrote:
It is done!!!
Felix is the baro now active without the need of the module or i do need to run the module also?
Btw there is a typo error in line 202
+elf ifeq ($(BOARD), revo) it should be +else ifeq ($(BOARD), revo)
Also have a look in my board header file as i have changed some things.
The board i have is this
http://www.hobbyking.com/hobbyking/store/__98336__Mini_CC3D_Revolution_32bit_F4_Based_Flight_controller_EU_Warehouse_.html
and the only differences is that it does not have the onboard 433 Mhz modem, some regulators and filters are missing and that it is is small, very small...
Chris


On Thu, May 19, 2016 at 5:48 PM, Felix Ruess <[hidden email]> wrote:
If you want to USE_BARO_BOARD, you also have to add the baro to baro_board.makefile and baro_board.h in the board folder.
See e.g. https://github.com/flixr/paparazzi/commit/eb5ecd494b393520fc47fbc8ce932f93b29a3f4c#diff-1e5e2b52154a92d33d68378eaf23cc1e

On Thu, May 19, 2016 at 4:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel





_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

flixr
Administrator
Hi Chris,

regarding the upload: I wanted to use my BlackMagicProbe to flash via SWD but didn't have an appropriate adapter cable, so I tried STLink (but that failed for whatever reason). I then used DFU-util (shorting a jumper pad on the Revolution to pull BOOT0 hight at power up so it goes into DFU mode).

Regarding your GPS problem: What files did you use from master? There are no GPS specific changes in https://github.com/paparazzi/paparazzi/pull/1676

Maybe it would make sense for you to switch to master anyway?

Cheers, Felix

On Fri, May 20, 2016 at 8:37 AM, hendrixgr . <[hidden email]> wrote:
Ok i get an error when i am trying to compile the openpilot revo board (not the mini) on 5.8.1 with files taken from the master branch.
I guess there are differences between the master and 5.8.1 concerning the GPS_link macro?
(i have tried both UART2 and UART3)
The funny thing is that my version of the mini compiles fine.....

CC /home/hendrix/paparazzi/var/aircrafts/Quad_Revolution/ap/arch/stm32/subsystems/settings_arch.o
./subsystems/gps/gps_ubx.h: In function 'GpsEvent':
<command-line>:0:10: error: 'UART3' undeclared (first use in this function)
./subsystems/gps/gps_ubx.h:103:32: note: in expansion of macro 'GPS_LINK'
   struct link_device *dev = &((GPS_LINK).device);
                                ^
<command-line>:0:10: note: each undeclared identifier is reported only once for each function it appears in
./subsystems/gps/gps_ubx.h:103:32: note: in expansion of macro 'GPS_LINK'
   struct link_device *dev = &((GPS_LINK).device);
                                ^
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/Quad_Revolution/ap/subsystems/settings.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

FAILED 'make -C /home/hendrix/paparazzi -f Makefile.ac AIRCRAFT=Quad_Revolution ap.compile' with code 2

On Fri, May 20, 2016 at 8:54 AM, hendrixgr . <[hidden email]> wrote:
One last question Felix
How did you upload the firmware, i see in the makefile that the method is "SWD" but can you describe what you did in order to upload the program?
Did you had to solder some wires?
Chris


On Fri, May 20, 2016 at 8:28 AM, hendrixgr . <[hidden email]> wrote:
Ok!
I got hold of 2 rfm23bp (1w)  so i will start writing code for it.
Maybe i will modify the uart_arch.c file to stream data to the spi port instead of the serial port.
Chris


On Thu, May 19, 2016 at 11:33 PM, Felix Ruess <[hidden email]> wrote:
FYI, added the OpenPilot revolution board files and IMU driver: https://github.com/paparazzi/paparazzi/pull/1676

On Thu, May 19, 2016 at 7:12 PM, hendrixgr . <[hidden email]> wrote:
About the modem there is code for using it as an rc receiver and modem at the same time.
Also there is standalone c code to make a modem with the rfm22 (100mw) or the rfm23bp (1w)
Since we already have the spi bus and the code uses bit banging for the spi it will be easy to adapt the code.
The only obstacle i found is that i don't know how to divert the telemetry serial data to an spi port easily as i have read and understood all the code
in the openLRSngDL branch

Have a look here
https://github.com/openLRSng

and here for the data modem for the data modem using an avr (not needed if we adapt the code) and a rfm22 or rfm23bp
https://github.com/openLRSng/openLRSngDL

I use the openlrsng receiver code all the time and i make custom receivers my self
Chris


On Thu, May 19, 2016 at 7:50 PM, Felix Ruess <[hidden email]> wrote:
Yes, the baro is now active. The BARO_BOARD mechanism is just to make it easier to use, i.e. use the baro on the board without having to add a module.
But we might remove that or make it into a module as well: https://github.com/paparazzi/paparazzi/pull/829

Thanks for pointing out the errors, already fixed them :-)
As soon as I had the chance to actually test it on the board, I'll add it to master.

The Mini Revolution looks interesting, we don't have a driver for the modem yet anyway...

On Thu, May 19, 2016 at 5:43 PM, hendrixgr . <[hidden email]> wrote:
It is done!!!
Felix is the baro now active without the need of the module or i do need to run the module also?
Btw there is a typo error in line 202
+elf ifeq ($(BOARD), revo) it should be +else ifeq ($(BOARD), revo)
Also have a look in my board header file as i have changed some things.
The board i have is this
http://www.hobbyking.com/hobbyking/store/__98336__Mini_CC3D_Revolution_32bit_F4_Based_Flight_controller_EU_Warehouse_.html
and the only differences is that it does not have the onboard 433 Mhz modem, some regulators and filters are missing and that it is is small, very small...
Chris


On Thu, May 19, 2016 at 5:48 PM, Felix Ruess <[hidden email]> wrote:
If you want to USE_BARO_BOARD, you also have to add the baro to baro_board.makefile and baro_board.h in the board folder.
See e.g. https://github.com/flixr/paparazzi/commit/eb5ecd494b393520fc47fbc8ce932f93b29a3f4c#diff-1e5e2b52154a92d33d68378eaf23cc1e

On Thu, May 19, 2016 at 4:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel





_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

Chris
Hi Felix, about uploading the firmware that's what i thought also.
I will switch to master no problem but i do like to have a modern stable version ready as a backup because i have a lot of personal code added
for various projects.
The compiling problem affects the rotorcrafts only and not fixed wingsThe files i used were all the files that are marked as openpilot revo
like imu_openpilot_revo.makefile, openpilot_revo_1.0.makefile openpilot_revo_1.0.h etc.
Chris


On Fri, May 20, 2016 at 10:02 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

regarding the upload: I wanted to use my BlackMagicProbe to flash via SWD but didn't have an appropriate adapter cable, so I tried STLink (but that failed for whatever reason). I then used DFU-util (shorting a jumper pad on the Revolution to pull BOOT0 hight at power up so it goes into DFU mode).

Regarding your GPS problem: What files did you use from master? There are no GPS specific changes in https://github.com/paparazzi/paparazzi/pull/1676

Maybe it would make sense for you to switch to master anyway?

Cheers, Felix

On Fri, May 20, 2016 at 8:37 AM, hendrixgr . <[hidden email]> wrote:
Ok i get an error when i am trying to compile the openpilot revo board (not the mini) on 5.8.1 with files taken from the master branch.
I guess there are differences between the master and 5.8.1 concerning the GPS_link macro?
(i have tried both UART2 and UART3)
The funny thing is that my version of the mini compiles fine.....

CC /home/hendrix/paparazzi/var/aircrafts/Quad_Revolution/ap/arch/stm32/subsystems/settings_arch.o
./subsystems/gps/gps_ubx.h: In function 'GpsEvent':
<command-line>:0:10: error: 'UART3' undeclared (first use in this function)
./subsystems/gps/gps_ubx.h:103:32: note: in expansion of macro 'GPS_LINK'
   struct link_device *dev = &((GPS_LINK).device);
                                ^
<command-line>:0:10: note: each undeclared identifier is reported only once for each function it appears in
./subsystems/gps/gps_ubx.h:103:32: note: in expansion of macro 'GPS_LINK'
   struct link_device *dev = &((GPS_LINK).device);
                                ^
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/Quad_Revolution/ap/subsystems/settings.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

FAILED 'make -C /home/hendrix/paparazzi -f Makefile.ac AIRCRAFT=Quad_Revolution ap.compile' with code 2

On Fri, May 20, 2016 at 8:54 AM, hendrixgr . <[hidden email]> wrote:
One last question Felix
How did you upload the firmware, i see in the makefile that the method is "SWD" but can you describe what you did in order to upload the program?
Did you had to solder some wires?
Chris


On Fri, May 20, 2016 at 8:28 AM, hendrixgr . <[hidden email]> wrote:
Ok!
I got hold of 2 rfm23bp (1w)  so i will start writing code for it.
Maybe i will modify the uart_arch.c file to stream data to the spi port instead of the serial port.
Chris


On Thu, May 19, 2016 at 11:33 PM, Felix Ruess <[hidden email]> wrote:
FYI, added the OpenPilot revolution board files and IMU driver: https://github.com/paparazzi/paparazzi/pull/1676

On Thu, May 19, 2016 at 7:12 PM, hendrixgr . <[hidden email]> wrote:
About the modem there is code for using it as an rc receiver and modem at the same time.
Also there is standalone c code to make a modem with the rfm22 (100mw) or the rfm23bp (1w)
Since we already have the spi bus and the code uses bit banging for the spi it will be easy to adapt the code.
The only obstacle i found is that i don't know how to divert the telemetry serial data to an spi port easily as i have read and understood all the code
in the openLRSngDL branch

Have a look here
https://github.com/openLRSng

and here for the data modem for the data modem using an avr (not needed if we adapt the code) and a rfm22 or rfm23bp
https://github.com/openLRSng/openLRSngDL

I use the openlrsng receiver code all the time and i make custom receivers my self
Chris


On Thu, May 19, 2016 at 7:50 PM, Felix Ruess <[hidden email]> wrote:
Yes, the baro is now active. The BARO_BOARD mechanism is just to make it easier to use, i.e. use the baro on the board without having to add a module.
But we might remove that or make it into a module as well: https://github.com/paparazzi/paparazzi/pull/829

Thanks for pointing out the errors, already fixed them :-)
As soon as I had the chance to actually test it on the board, I'll add it to master.

The Mini Revolution looks interesting, we don't have a driver for the modem yet anyway...

On Thu, May 19, 2016 at 5:43 PM, hendrixgr . <[hidden email]> wrote:
It is done!!!
Felix is the baro now active without the need of the module or i do need to run the module also?
Btw there is a typo error in line 202
+elf ifeq ($(BOARD), revo) it should be +else ifeq ($(BOARD), revo)
Also have a look in my board header file as i have changed some things.
The board i have is this
http://www.hobbyking.com/hobbyking/store/__98336__Mini_CC3D_Revolution_32bit_F4_Based_Flight_controller_EU_Warehouse_.html
and the only differences is that it does not have the onboard 433 Mhz modem, some regulators and filters are missing and that it is is small, very small...
Chris


On Thu, May 19, 2016 at 5:48 PM, Felix Ruess <[hidden email]> wrote:
If you want to USE_BARO_BOARD, you also have to add the baro to baro_board.makefile and baro_board.h in the board folder.
See e.g. https://github.com/flixr/paparazzi/commit/eb5ecd494b393520fc47fbc8ce932f93b29a3f4c#diff-1e5e2b52154a92d33d68378eaf23cc1e

On Thu, May 19, 2016 at 4:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel





_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

flixr
Administrator
So if I add those new board files to v5.8 it compiles just fine as expected...

On Fri, May 20, 2016 at 9:34 PM, hendrixgr . <[hidden email]> wrote:
Hi Felix, about uploading the firmware that's what i thought also.
I will switch to master no problem but i do like to have a modern stable version ready as a backup because i have a lot of personal code added
for various projects.
The compiling problem affects the rotorcrafts only and not fixed wingsThe files i used were all the files that are marked as openpilot revo
like imu_openpilot_revo.makefile, openpilot_revo_1.0.makefile openpilot_revo_1.0.h etc.
Chris


On Fri, May 20, 2016 at 10:02 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

regarding the upload: I wanted to use my BlackMagicProbe to flash via SWD but didn't have an appropriate adapter cable, so I tried STLink (but that failed for whatever reason). I then used DFU-util (shorting a jumper pad on the Revolution to pull BOOT0 hight at power up so it goes into DFU mode).

Regarding your GPS problem: What files did you use from master? There are no GPS specific changes in https://github.com/paparazzi/paparazzi/pull/1676

Maybe it would make sense for you to switch to master anyway?

Cheers, Felix

On Fri, May 20, 2016 at 8:37 AM, hendrixgr . <[hidden email]> wrote:
Ok i get an error when i am trying to compile the openpilot revo board (not the mini) on 5.8.1 with files taken from the master branch.
I guess there are differences between the master and 5.8.1 concerning the GPS_link macro?
(i have tried both UART2 and UART3)
The funny thing is that my version of the mini compiles fine.....

CC /home/hendrix/paparazzi/var/aircrafts/Quad_Revolution/ap/arch/stm32/subsystems/settings_arch.o
./subsystems/gps/gps_ubx.h: In function 'GpsEvent':
<command-line>:0:10: error: 'UART3' undeclared (first use in this function)
./subsystems/gps/gps_ubx.h:103:32: note: in expansion of macro 'GPS_LINK'
   struct link_device *dev = &((GPS_LINK).device);
                                ^
<command-line>:0:10: note: each undeclared identifier is reported only once for each function it appears in
./subsystems/gps/gps_ubx.h:103:32: note: in expansion of macro 'GPS_LINK'
   struct link_device *dev = &((GPS_LINK).device);
                                ^
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/Quad_Revolution/ap/subsystems/settings.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

FAILED 'make -C /home/hendrix/paparazzi -f Makefile.ac AIRCRAFT=Quad_Revolution ap.compile' with code 2

On Fri, May 20, 2016 at 8:54 AM, hendrixgr . <[hidden email]> wrote:
One last question Felix
How did you upload the firmware, i see in the makefile that the method is "SWD" but can you describe what you did in order to upload the program?
Did you had to solder some wires?
Chris


On Fri, May 20, 2016 at 8:28 AM, hendrixgr . <[hidden email]> wrote:
Ok!
I got hold of 2 rfm23bp (1w)  so i will start writing code for it.
Maybe i will modify the uart_arch.c file to stream data to the spi port instead of the serial port.
Chris


On Thu, May 19, 2016 at 11:33 PM, Felix Ruess <[hidden email]> wrote:
FYI, added the OpenPilot revolution board files and IMU driver: https://github.com/paparazzi/paparazzi/pull/1676

On Thu, May 19, 2016 at 7:12 PM, hendrixgr . <[hidden email]> wrote:
About the modem there is code for using it as an rc receiver and modem at the same time.
Also there is standalone c code to make a modem with the rfm22 (100mw) or the rfm23bp (1w)
Since we already have the spi bus and the code uses bit banging for the spi it will be easy to adapt the code.
The only obstacle i found is that i don't know how to divert the telemetry serial data to an spi port easily as i have read and understood all the code
in the openLRSngDL branch

Have a look here
https://github.com/openLRSng

and here for the data modem for the data modem using an avr (not needed if we adapt the code) and a rfm22 or rfm23bp
https://github.com/openLRSng/openLRSngDL

I use the openlrsng receiver code all the time and i make custom receivers my self
Chris


On Thu, May 19, 2016 at 7:50 PM, Felix Ruess <[hidden email]> wrote:
Yes, the baro is now active. The BARO_BOARD mechanism is just to make it easier to use, i.e. use the baro on the board without having to add a module.
But we might remove that or make it into a module as well: https://github.com/paparazzi/paparazzi/pull/829

Thanks for pointing out the errors, already fixed them :-)
As soon as I had the chance to actually test it on the board, I'll add it to master.

The Mini Revolution looks interesting, we don't have a driver for the modem yet anyway...

On Thu, May 19, 2016 at 5:43 PM, hendrixgr . <[hidden email]> wrote:
It is done!!!
Felix is the baro now active without the need of the module or i do need to run the module also?
Btw there is a typo error in line 202
+elf ifeq ($(BOARD), revo) it should be +else ifeq ($(BOARD), revo)
Also have a look in my board header file as i have changed some things.
The board i have is this
http://www.hobbyking.com/hobbyking/store/__98336__Mini_CC3D_Revolution_32bit_F4_Based_Flight_controller_EU_Warehouse_.html
and the only differences is that it does not have the onboard 433 Mhz modem, some regulators and filters are missing and that it is is small, very small...
Chris


On Thu, May 19, 2016 at 5:48 PM, Felix Ruess <[hidden email]> wrote:
If you want to USE_BARO_BOARD, you also have to add the baro to baro_board.makefile and baro_board.h in the board folder.
See e.g. https://github.com/flixr/paparazzi/commit/eb5ecd494b393520fc47fbc8ce932f93b29a3f4c#diff-1e5e2b52154a92d33d68378eaf23cc1e

On Thu, May 19, 2016 at 4:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel





_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: errors during cc3d revo compile #2

Chris
k.
I will try again.
I already installed the master branch and converted most of my code last night.
The only "problems" i had was the bool_t conversion and the "messages.h" file but everything went smoothly.
Chris


On Fri, May 20, 2016 at 11:22 PM, Felix Ruess <[hidden email]> wrote:
So if I add those new board files to v5.8 it compiles just fine as expected...

On Fri, May 20, 2016 at 9:34 PM, hendrixgr . <[hidden email]> wrote:
Hi Felix, about uploading the firmware that's what i thought also.
I will switch to master no problem but i do like to have a modern stable version ready as a backup because i have a lot of personal code added
for various projects.
The compiling problem affects the rotorcrafts only and not fixed wingsThe files i used were all the files that are marked as openpilot revo
like imu_openpilot_revo.makefile, openpilot_revo_1.0.makefile openpilot_revo_1.0.h etc.
Chris


On Fri, May 20, 2016 at 10:02 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

regarding the upload: I wanted to use my BlackMagicProbe to flash via SWD but didn't have an appropriate adapter cable, so I tried STLink (but that failed for whatever reason). I then used DFU-util (shorting a jumper pad on the Revolution to pull BOOT0 hight at power up so it goes into DFU mode).

Regarding your GPS problem: What files did you use from master? There are no GPS specific changes in https://github.com/paparazzi/paparazzi/pull/1676

Maybe it would make sense for you to switch to master anyway?

Cheers, Felix

On Fri, May 20, 2016 at 8:37 AM, hendrixgr . <[hidden email]> wrote:
Ok i get an error when i am trying to compile the openpilot revo board (not the mini) on 5.8.1 with files taken from the master branch.
I guess there are differences between the master and 5.8.1 concerning the GPS_link macro?
(i have tried both UART2 and UART3)
The funny thing is that my version of the mini compiles fine.....

CC /home/hendrix/paparazzi/var/aircrafts/Quad_Revolution/ap/arch/stm32/subsystems/settings_arch.o
./subsystems/gps/gps_ubx.h: In function 'GpsEvent':
<command-line>:0:10: error: 'UART3' undeclared (first use in this function)
./subsystems/gps/gps_ubx.h:103:32: note: in expansion of macro 'GPS_LINK'
   struct link_device *dev = &((GPS_LINK).device);
                                ^
<command-line>:0:10: note: each undeclared identifier is reported only once for each function it appears in
./subsystems/gps/gps_ubx.h:103:32: note: in expansion of macro 'GPS_LINK'
   struct link_device *dev = &((GPS_LINK).device);
                                ^
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/Quad_Revolution/ap/subsystems/settings.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

FAILED 'make -C /home/hendrix/paparazzi -f Makefile.ac AIRCRAFT=Quad_Revolution ap.compile' with code 2

On Fri, May 20, 2016 at 8:54 AM, hendrixgr . <[hidden email]> wrote:
One last question Felix
How did you upload the firmware, i see in the makefile that the method is "SWD" but can you describe what you did in order to upload the program?
Did you had to solder some wires?
Chris


On Fri, May 20, 2016 at 8:28 AM, hendrixgr . <[hidden email]> wrote:
Ok!
I got hold of 2 rfm23bp (1w)  so i will start writing code for it.
Maybe i will modify the uart_arch.c file to stream data to the spi port instead of the serial port.
Chris


On Thu, May 19, 2016 at 11:33 PM, Felix Ruess <[hidden email]> wrote:
FYI, added the OpenPilot revolution board files and IMU driver: https://github.com/paparazzi/paparazzi/pull/1676

On Thu, May 19, 2016 at 7:12 PM, hendrixgr . <[hidden email]> wrote:
About the modem there is code for using it as an rc receiver and modem at the same time.
Also there is standalone c code to make a modem with the rfm22 (100mw) or the rfm23bp (1w)
Since we already have the spi bus and the code uses bit banging for the spi it will be easy to adapt the code.
The only obstacle i found is that i don't know how to divert the telemetry serial data to an spi port easily as i have read and understood all the code
in the openLRSngDL branch

Have a look here
https://github.com/openLRSng

and here for the data modem for the data modem using an avr (not needed if we adapt the code) and a rfm22 or rfm23bp
https://github.com/openLRSng/openLRSngDL

I use the openlrsng receiver code all the time and i make custom receivers my self
Chris


On Thu, May 19, 2016 at 7:50 PM, Felix Ruess <[hidden email]> wrote:
Yes, the baro is now active. The BARO_BOARD mechanism is just to make it easier to use, i.e. use the baro on the board without having to add a module.
But we might remove that or make it into a module as well: https://github.com/paparazzi/paparazzi/pull/829

Thanks for pointing out the errors, already fixed them :-)
As soon as I had the chance to actually test it on the board, I'll add it to master.

The Mini Revolution looks interesting, we don't have a driver for the modem yet anyway...

On Thu, May 19, 2016 at 5:43 PM, hendrixgr . <[hidden email]> wrote:
It is done!!!
Felix is the baro now active without the need of the module or i do need to run the module also?
Btw there is a typo error in line 202
+elf ifeq ($(BOARD), revo) it should be +else ifeq ($(BOARD), revo)
Also have a look in my board header file as i have changed some things.
The board i have is this
http://www.hobbyking.com/hobbyking/store/__98336__Mini_CC3D_Revolution_32bit_F4_Based_Flight_controller_EU_Warehouse_.html
and the only differences is that it does not have the onboard 433 Mhz modem, some regulators and filters are missing and that it is is small, very small...
Chris


On Thu, May 19, 2016 at 5:48 PM, Felix Ruess <[hidden email]> wrote:
If you want to USE_BARO_BOARD, you also have to add the baro to baro_board.makefile and baro_board.h in the board folder.
See e.g. https://github.com/flixr/paparazzi/commit/eb5ecd494b393520fc47fbc8ce932f93b29a3f4c#diff-1e5e2b52154a92d33d68378eaf23cc1e

On Thu, May 19, 2016 at 4:35 PM, hendrixgr . <[hidden email]> wrote:
Hi i use a modified revo version that i wrote after examining the mini revo board (the one without the onboard modem)
and yes it has the USE_BARO_BOARD set to TRUE.
If i set it to FALSE everything compiles fine.
The paparazzi version is the 5.8.1 stable

#ifndef CONFIG_OPENPILOT_REVO_MINI_1_0_H
#define CONFIG_OPENPILOT_REVO_MINI_1_0_H

#define BOARD_REVO

/* OpenPilot Revo has a 8MHz external clock and 168MHz internal. */
#define EXT_CLK 8000000
#define AHB_CLK 168000000

#if defined(USE_I2C2) && defined(USE_UART3)
#error CANNOT USE I2C2 AND UART3 BOTH AT THE SAME TIME
#endif

/*
 * Onboard LEDs
 */

/* STAT blue, on PB5 */
#ifndef USE_LED_1
#define USE_LED_1 1
#endif
#define LED_1_GPIO GPIOB
#define LED_1_GPIO_PIN GPIO5
#define LED_1_GPIO_ON gpio_clear
#define LED_1_GPIO_OFF gpio_set
#define LED_1_AFIO_REMAP ((void)0)

/* WARN red, on PB4 */
#ifndef USE_LED_2
#define USE_LED_2 1
#endif
#define LED_2_GPIO GPIOB
#define LED_2_GPIO_PIN GPIO4
#define LED_2_GPIO_ON gpio_clear
#define LED_2_GPIO_OFF gpio_set
#define LED_2_AFIO_REMAP ((void)0)


/* Default actuators driver */
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
#define ActuatorsDefaultInit() ActuatorsPwmInit()
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()






/* UART */
//CAN BE USED AS GPS SERIAL PORT, CONNECTED TO MAIN PORT PLUG
#define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_TX GPIOA
#define UART1_GPIO_TX GPIO9
#define UART1_GPIO_PORT_RX GPIOA
#define UART1_GPIO_RX GPIO10

//CANNOT BE USED IF SERVO3 AND SERVO4 ARE USED
#if (!defined(USE_PWM3) || USE_PWM3 == 0) && (!defined(USE_PWM4) || USE_PWM4 == 0)
#if (!defined(USE_ADC_3) || USE_ADC_3 == 0) && (!defined(USE_ADC_4) || USE_ADC_4 == 0)
#define UART2_GPIO_AF GPIO_AF7
#define UART2_GPIO_PORT_TX GPIOA
#define UART2_GPIO_TX GPIO2
#define UART2_GPIO_PORT_RX GPIOA
#define UART2_GPIO_RX GPIO3
#endif
#endif

//CANNOT BE USED IF IC2 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_I2C2)
#define UART3_GPIO_AF GPIO_AF7
#define UART3_GPIO_PORT_TX GPIOB
#define UART3_GPIO_TX GPIO10
#define UART3_GPIO_PORT_RX GPIOB
#define UART3_GPIO_RX GPIO11
#endif

//CANNOT BE USED IF SPI3 IS NEEDED, CONNECTED TO OPLINK PORT PLUG.
#define UART5_GPIO_AF GPIO_AF8
#define UART5_GPIO_PORT_RX GPIOD
#define UART5_GPIO_RX GPIO2
#define UART5_GPIO_PORT_TX GPIOC
#define UART5_GPIO_TX GPIO12

//CONNECTED TO RX INPUT PORT PLUG.
#define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7
#define UART6_GPIO_PORT_TX GPIOC
#define UART6_GPIO_TX GPIO6





/* SPI */
/* MPU6000 */
#define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6
#define SPI1_GPIO_PORT_MOSI GPIOA
#define SPI1_GPIO_MOSI GPIO7
#define SPI1_GPIO_PORT_SCK GPIOA
#define SPI1_GPIO_SCK GPIO5
#define SPI1_GPIO_PORT_NSS GPIOA
#define SPI1_GPIO_NSS GPIO4

/* flash and RFM22B-S2 modem */
#define SPI3_GPIO_AF GPIO_AF5
#define SPI3_GPIO_PORT_MISO GPIOC
#define SPI3_GPIO_MISO GPIO11
#define SPI3_GPIO_PORT_MOSI GPIOC
#define SPI3_GPIO_MOSI GPIO12
#define SPI3_GPIO_PORT_SCK GPIOC
#define SPI3_GPIO_SCK GPIO10
/* modem CS */
#define SPI3_GPIO_PORT_NSS GPIOA
#define SPI3_GPIO_NSS GPIO15

/* MODEM select */
#define SPI_SELECT_SLAVE0_PORT GPIOA
#define SPI_SELECT_SLAVE0_PIN GPIO15

/* external flash chip select */
#define SPI_SELECT_SLAVE1_PORT GPIOB
#define SPI_SELECT_SLAVE1_PIN GPIO3

/* MPU6000 select */
#define SPI_SELECT_SLAVE2_PORT GPIOA
#define SPI_SELECT_SLAVE2_PIN GPIO4


/* I2C mapping */
/* HMC5883L mag on I2C1 with DRDY on PB7 */
/* MS5611 baro on I2C1 */
#define I2C1_GPIO_PORT GPIOB
#define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9

//CANNOT BE USED IF UART3 IS NEEDED, CONNECTED TO FLEXI PORT PLUG
#if !defined(USE_UART3)
#define I2C2_GPIO_PORT GPIOB
#define I2C2_GPIO_SCL GPIO10
#define I2C2_GPIO_SDA GPIO11
#endif

/*
 * ADC
 */

/* Onboard ADCs */
/*
   ADC1 PC2/ADC12
   ADC2 PC1/ADC11
   ADC3 PA3/ADC3
   ADC4 PA2/ADC2
*/

/* provide defines that can be used to access the ADC_x in the code or airframe file
 * these directly map to the index number of the 4 adc channels defined above
 * 4th (index 3) is used for bat monitoring by default
 */

#define USE_AD_TIM2 1

#ifndef USE_ADC_1
#define USE_ADC_1 1
#endif

#ifndef USE_ADC_2
#define USE_ADC_2 1
#endif

/* Voltage on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_1
#define AD1_1_CHANNEL 12
#define ADC_1 AD1_1
#define ADC_1_GPIO_PORT GPIOC
#define ADC_1_GPIO_PIN GPIO2
#endif

/* Current on Pwr/Sen/Sonar CONN3 */
#if USE_ADC_2
#define AD1_2_CHANNEL 11
#define ADC_2 AD1_2
#define ADC_2_GPIO_PORT GPIOC
#define ADC_2_GPIO_PIN GPIO1
#endif

/* FREE ON SERVO 3 */
#if USE_ADC_3
#define AD1_3_CHANNEL 3
#define ADC_3 AD1_3
#define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3
#endif

/* FREE ON SERVO 4 */
#if USE_ADC_4
#define AD1_4_CHANNEL 2
#define ADC_4 AD1_4
#define ADC_4_GPIO_PORT GPIOA
#define ADC_4_GPIO_PIN GPIO2
#endif

/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
#ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_1
#endif

/* no voltage divider on board, adjust VoltageOfAdc in airframe file */
#define DefaultVoltageOfAdc(adc) (0.0045*adc)


/*
 * PWM
 *
 */
#define PWM_USE_TIM3 1
#define PWM_USE_TIM5 1
#if (defined(USE_ADC_3) && USE_ADC_3) || (defined(USE_ADC_4) && USE_ADC_4)
#define PWM_USE_TIM9 1
#endif


#define USE_PWM1 1
#define USE_PWM2 1
#define USE_PWM3 1
#define USE_PWM4 1
#define USE_PWM5 1
#define USE_PWM6 1
#define USE_PWM7 1
#define USE_PWM8 1

// PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
#if USE_PWM1
#define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM3
#define PWM_SERVO_1_GPIO GPIOB
#define PWM_SERVO_1_PIN GPIO0
#define PWM_SERVO_1_AF GPIO_AF2
#define PWM_SERVO_1_OC TIM_OC3
#define PWM_SERVO_1_OC_BIT (1<<2)
#else
#define PWM_SERVO_1_OC_BIT 0
#endif

#if USE_PWM2
#define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM3
#define PWM_SERVO_2_GPIO GPIOB
#define PWM_SERVO_2_PIN GPIO1
#define PWM_SERVO_2_AF GPIO_AF2
#define PWM_SERVO_2_OC TIM_OC4
#define PWM_SERVO_2_OC_BIT (1<<3)
#else
#define PWM_SERVO_2_OC_BIT 0
#endif

#if USE_PWM3 && (!defined(USE_ADC_3) || USE_ADC_3 != 1)
#define PWM_SERVO_3 2
#define PWM_SERVO_3_TIMER TIM9
#define PWM_SERVO_3_GPIO GPIOA
#define PWM_SERVO_3_PIN GPIO3
#define PWM_SERVO_3_AF GPIO_AF3
#define PWM_SERVO_3_OC TIM_OC2
#define PWM_SERVO_3_OC_BIT (1<<1)
#else
#define PWM_SERVO_3_OC_BIT 0
#undef USE_PWM3
#warning SERVO 3 NOT AVAILABLE
#endif

#if USE_PWM4 && (!defined(USE_ADC_4) || USE_ADC_4 != 1)
#define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM9
#define PWM_SERVO_4_GPIO GPIOA
#define PWM_SERVO_4_PIN GPIO2
#define PWM_SERVO_4_AF GPIO_AF3
#define PWM_SERVO_4_OC TIM_OC1
#define PWM_SERVO_4_OC_BIT (1<<0)
#else
#define PWM_SERVO_4_OC_BIT 0
#undef USE_PWM4
#warning SERVO 4 NOT AVAILABLE
#endif

#if USE_PWM5
#define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM5
#define PWM_SERVO_5_GPIO GPIOA
#define PWM_SERVO_5_PIN GPIO1
#define PWM_SERVO_5_AF GPIO_AF2
#define PWM_SERVO_5_OC TIM_OC2
#define PWM_SERVO_5_OC_BIT (1<<1)
#else
#define PWM_SERVO_5_OC_BIT 0
#endif

#if USE_PWM6
#define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM5
#define PWM_SERVO_6_GPIO GPIOA
#define PWM_SERVO_6_PIN GPIO0
#define PWM_SERVO_6_AF GPIO_AF2
#define PWM_SERVO_6_OC TIM_OC1
#define PWM_SERVO_6_OC_BIT (1<<0)
#else
#define PWM_SERVO_6_OC_BIT 0
#endif

#if USE_PWM7
#define PWM_SERVO_7 6
#define PWM_SERVO_7_TIMER TIM12
#define PWM_SERVO_7_GPIO GPIOB
#define PWM_SERVO_7_PIN GPIO14
#define PWM_SERVO_7_AF GPIO_AF9
#define PWM_SERVO_7_OC TIM_OC1
#define PWM_SERVO_7_OC_BIT (1<<0)
#else
#define PWM_SERVO_7_OC_BIT 0
#endif

#if USE_PWM8
#define PWM_SERVO_8 7
#define PWM_SERVO_8_TIMER TIM12
#define PWM_SERVO_8_GPIO GPIOB
#define PWM_SERVO_8_PIN GPIO15
#define PWM_SERVO_8_AF GPIO_AF9
#define PWM_SERVO_8_OC TIM_OC2
#define PWM_SERVO_8_OC_BIT (1<<1)
#else
#define PWM_SERVO_8_OC_BIT 0
#endif



/* servos 1-2 on TIM3 */
#define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT | PWM_SERVO_2_OC_BIT)
/* servos 3-4 on TIM9 */
#define PWM_TIM9_CHAN_MASK (PWM_SERVO_3_OC_BIT | PWM_SERVO_4_OC_BIT)
/* servos 5-6 on TIM5 */
#define PWM_TIM5_CHAN_MASK (PWM_SERVO_5_OC_BIT | PWM_SERVO_6_OC_BIT)
/* servos 7-8 on TIM12 */
#define PWM_TIM12_CHAN_MASK (PWM_SERVO_7_OC_BIT | PWM_SERVO_8_OC_BIT)


/* by default activate onboard baro */
#ifndef USE_BARO_BOARD
//#define USE_BARO_BOARD 1
#endif

/* PPM
 *
 * Default is PPM config 2, input on GPIOA1 (Servo pin 6)
 */

#ifndef PPM_CONFIG
#define PPM_CONFIG 1
#endif

#if PPM_CONFIG == 1
//#if defined(RADIO_CONTROL_PPM_PIN) && RADIO_CONTROL_PPM_PIN == SERVO_6_IN
 /* input on PC9 (SERVO 6 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC4
#define PPM_TIMER_INPUT     TIM_IC_IN_TI4
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC4IE
#define PPM_CC_IF           TIM_SR_CC4IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO9
#define PPM_GPIO_AF         GPIO_AF3

#elif PPM_CONFIG == 2

/* input on PC8 (SERVO 5 IN) */
#define USE_PPM_TIM8 1
#define PPM_CHANNEL         TIM_IC3
#define PPM_TIMER_INPUT     TIM_IC_IN_TI3
#define PPM_IRQ             NVIC_TIM8_CC_IRQ
#define PPM_IRQ2            NVIC_TIM8_UP_TIM13_IRQ
// Capture/Compare InteruptEnable and InterruptFlag
#define PPM_CC_IE           TIM_DIER_CC3IE
#define PPM_CC_IF           TIM_SR_CC3IF
#define PPM_GPIO_PORT       GPIOC
#define PPM_GPIO_PIN        GPIO8
#define PPM_GPIO_AF         GPIO_AF3

#else
#error "Unknown PPM config"

#endif // PPM_CONFIG


/*
 * Spektrum
 */
/* The line that is pulled low at power up to initiate the bind process */
#define SPEKTRUM_BIND_PIN GPIO0
#define SPEKTRUM_BIND_PIN_PORT GPIOB

#define SPEKTRUM_UART1_RCC RCC_USART1
#define SPEKTRUM_UART1_BANK GPIOA
#define SPEKTRUM_UART1_PIN GPIO10
#define SPEKTRUM_UART1_AF GPIO_AF7
#define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
#define SPEKTRUM_UART1_ISR usart1_isr
#define SPEKTRUM_UART1_DEV USART1

#define SPEKTRUM_UART2_RCC RCC_USART2
#define SPEKTRUM_UART2_BANK GPIOA
#define SPEKTRUM_UART2_PIN GPIO3
#define SPEKTRUM_UART2_AF GPIO_AF7
#define SPEKTRUM_UART2_IRQ NVIC_USART2_IRQ
#define SPEKTRUM_UART2_ISR usart2_isr
#define SPEKTRUM_UART2_DEV USART2

#define SPEKTRUM_UART5_RCC RCC_UART5
#define SPEKTRUM_UART5_BANK GPIOD
#define SPEKTRUM_UART5_PIN GPIO2
#define SPEKTRUM_UART5_AF GPIO_AF8
#define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
#define SPEKTRUM_UART5_ISR uart5_isr
#define SPEKTRUM_UART5_DEV UART5

#endif /* CONFIG_OPENPILOT_REVO_MINI_1_0_H */

On Thu, May 19, 2016 at 12:22 PM, Felix Ruess <[hidden email]> wrote:
Hi Chris,

what paparazzi_version are you using and more importantly which board files are you using? The (untested) revo board files from my op_revo branch?
It seems that whatever you are using has USE_BARO_BOARD set to TRUE, but there is no onboard baro defined.
Just post you airframe file as well...

Cheers, Felix

On Wed, May 18, 2016 at 11:37 PM, hendrixgr . <[hidden email]> wrote:
Ok i solved the ic20 error by changing the ms5611 module configuration from

   <load name="baro_ms5611_i2c.xml">
        <define name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>
to

   <load name="baro_ms5611_i2c.xml">
        <configure name="MS5611_I2C_DEV" value="i2c1" />
        <define name="MS5611_SLAVE_ADDR=0xEE"/>
        <define name="MS5611_SEND_BARO_ALTITUDE"/>
    </load>

but i do get the below error and i am not that experienced with the baro files.

/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `init_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:214: undefined reference to `baro_init'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `handle_periodic_tasks_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:287: undefined reference to `baro_periodic'
/home/hendrix/paparazzi/var/aircrafts/xeno/ap/firmwares/fixedwing/main_ap.o: In function `event_task_ap':
/home/hendrix/paparazzi/sw/airborne/firmwares/fixedwing/main_ap.c:714: undefined reference to `baro_event'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/hendrix/paparazzi/var/aircrafts/xeno/ap/ap.elf] Error 1
make[1]: Leaving directory `/home/hendrix/paparazzi/sw/airborne'
make: *** [ap.compile] Error 2
make: Leaving directory `/home/hendrix/paparazzi'

Chris


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel





_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel