diff --git a/conf/airframes/booz2_a1.xml b/conf/airframes/booz2_a1.xml index d3d1fbfb68..ba3f491140 100644 --- a/conf/airframes/booz2_a1.xml +++ b/conf/airframes/booz2_a1.xml @@ -194,10 +194,11 @@ ARCH=lpc21 -BOARD_CFG = \"booz2_board_v1_0.h\" +BOARD_CFG = \"boards/booz2_v1_0.h\" # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS +ap.CFLAGS += -DMODEM_BAUD=B57600 include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile include $(CFG_BOOZ)/booz2_autopilot.makefile @@ -205,7 +206,6 @@ include $(CFG_BOOZ)/booz2_test_progs.makefile include $(CFG_BOOZ)/booz2_simulator_nps.makefile -ap.CFLAGS += -DMODEM_BAUD=B57600 include $(CFG_BOOZ)/subsystems/booz2_radio_control_ppm.makefile include $(CFG_BOOZ)/subsystems/booz2_actuators_buss.makefile include $(CFG_BOOZ)/subsystems/booz2_imu_b2v1.makefile diff --git a/conf/airframes/booz2_a2.xml b/conf/airframes/booz2_a2.xml index 85f6ec1909..768074366b 100644 --- a/conf/airframes/booz2_a2.xml +++ b/conf/airframes/booz2_a2.xml @@ -165,7 +165,7 @@ ARCH=lpc21 -BOARD_CFG = \"booz2_board_v1_0.h\" +BOARD_CFG = \"boards/booz2_v1_0.h\" # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS diff --git a/conf/airframes/booz2_a3.xml b/conf/airframes/booz2_a3.xml index c6ec35b733..2cc1355d10 100644 --- a/conf/airframes/booz2_a3.xml +++ b/conf/airframes/booz2_a3.xml @@ -165,7 +165,7 @@ ARCH=lpc21 -BOARD_CFG = \"booz2_board_v1_0.h\" +BOARD_CFG = \"boards/booz2_v1_0.h\" # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS diff --git a/conf/airframes/booz2_a4.xml b/conf/airframes/booz2_a4.xml index 38f60653c4..12c151d09a 100644 --- a/conf/airframes/booz2_a4.xml +++ b/conf/airframes/booz2_a4.xml @@ -143,7 +143,7 @@ ARCH=lpc21 -BOARD_CFG = \"booz2_board_v1_0.h\" +BOARD_CFG = \"boards/booz2_v1_0.h\" # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS diff --git a/conf/airframes/booz2_a5.xml b/conf/airframes/booz2_a5.xml index bb3801c2a0..0943517754 100644 --- a/conf/airframes/booz2_a5.xml +++ b/conf/airframes/booz2_a5.xml @@ -1,5 +1,80 @@ + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -10,8 +85,8 @@ TARGET_DIR = ~ SRC_FMS=fms -test_spi.ARCHDIR = omap -test_spi.srcs=$(SRC_FMS)/test_spi.c + +include $(PAPARAZZI_SRC)/conf/autopilot/booz2_common.makefile FLASH_MODE = IAP lpc_test_spi.ARCHDIR = arm7 @@ -25,24 +100,60 @@ lpc_test_spi.CFLAGS += -DUSE_LED lpc_test_spi.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c lpc_test_spi.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 +# +# test BUSS BLDC +# +lpc_test_motors.ARCHDIR = arm7 +lpc_test_motors.ARCH = arm7tdmi +lpc_test_motors.TARGET = lpc_test_motors +lpc_test_motors.TARGETDIR = lpc_test_motors -test_telemetry.ARCHDIR = omap -test_telemetry.srcs=$(SRC_FMS)/test_telemetry.c -test_telemetry.CFLAGS += -I$(GLIB_INC) -test_telemetry.LDFLAGS += -L$(GLIB_LIB) -lglib-2.0 +lpc_test_motors.CFLAGS += -DPERIPHERALS_AUTO_INIT +lpc_test_motors.CFLAGS += -DBOARD_CONFIG=\"boards/booz2_v1_0.h\" -I$(SRC_BOOZ) -I$(SRC_BOOZ_ARCH) +lpc_test_motors.srcs += $(SRC_BOOZ_TEST)/booz2_test_buss_bldc_hexa.c +lpc_test_motors.CFLAGS += -DUSE_LED +lpc_test_motors.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC((1./512.))' -DTIME_LED=1 +lpc_test_motors.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c + +lpc_test_motors.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 +lpc_test_motors.srcs += $(SRC_ARCH)/uart_hw.c + +lpc_test_motors.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_DEVICE=Uart1 +lpc_test_motors.srcs += downlink.c pprz_transport.c + +lpc_test_motors.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart1 +lpc_test_motors.srcs += $(SRC_BOOZ)/booz2_datalink.c + +lpc_test_motors.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=150 -DI2C0_SCLH=150 -DI2C0_VIC_SLOT=10 +lpc_test_motors.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c +# +# +# +overo_test_telemetry.ARCHDIR = omap +overo_test_telemetry.srcs=$(SRC_FMS)/overo_test_telemetry.c +overo_test_telemetry.CFLAGS += -I$(GLIB_INC) +overo_test_telemetry.LDFLAGS += -L$(GLIB_LIB) -lglib-2.0 -ap.ARCHDIR = $(ARCHI) -ap.LDFLAGS = -lm -levent -lrt -ap.CFLAGS += -I$(SRC_FMS) -ap.srcs=$(SRC_FMS)/fms_test_datalink.c -ap.CFLAGS += -DDOWNLINK -ap.CFLAGS += -DDOWNLINK_TRANSPORT=UdpTransport -ap.srcs += $(SRC_FMS)/fms_network.c -ap.srcs += $(SRC_FMS)/udp_transport.c -ap.srcs += downlink.c +# +# +# +overo_test_spi.ARCHDIR = omap +overo_test_spi.srcs=$(SRC_FMS)/overo_test_spi.c + + + +#ap.ARCHDIR = $(ARCHI) +#ap.LDFLAGS = -lm -levent -lrt +#ap.CFLAGS += -I$(SRC_FMS) +#ap.srcs=$(SRC_FMS)/fms_test_datalink.c +#ap.CFLAGS += -DDOWNLINK +#ap.CFLAGS += -DDOWNLINK_TRANSPORT=UdpTransport +#ap.srcs += $(SRC_FMS)/fms_network.c +#ap.srcs += $(SRC_FMS)/udp_transport.c +#ap.srcs += downlink.c diff --git a/conf/airframes/booz2_flixr.xml b/conf/airframes/booz2_flixr.xml index 9a6396f487..e6627ccb74 100644 --- a/conf/airframes/booz2_flixr.xml +++ b/conf/airframes/booz2_flixr.xml @@ -180,7 +180,7 @@ ARCH=lpc21 -BOARD_CFG = \"booz2_board_v1_0.h\" +BOARD_CFG = \"boards/booz2_v1_0.h\" # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS diff --git a/conf/airframes/booz2_g1.xml b/conf/airframes/booz2_g1.xml index e9f643c01e..e5c6617333 100644 --- a/conf/airframes/booz2_g1.xml +++ b/conf/airframes/booz2_g1.xml @@ -177,7 +177,7 @@ ARCH=lpc21 -BOARD_CFG = \"booz2_board_v1_0.h\" +BOARD_CFG = \"boards/booz2_v1_0.h\" # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS diff --git a/conf/airframes/booz2_s1.xml b/conf/airframes/booz2_s1.xml index 54f4082c79..29e60e99dc 100644 --- a/conf/airframes/booz2_s1.xml +++ b/conf/airframes/booz2_s1.xml @@ -185,7 +185,7 @@ ARCH=lpc21 -BOARD_CFG = \"booz2_board_v1_0.h\" +BOARD_CFG = \"boards/booz2_v1_0.h\" # prevents motors from ever starting # ap.CFLAGS += -DKILL_MOTORS diff --git a/conf/airframes/booz2_x1.xml b/conf/airframes/booz2_x1.xml index 8228f9a391..f246e701d6 100644 --- a/conf/airframes/booz2_x1.xml +++ b/conf/airframes/booz2_x1.xml @@ -185,7 +185,7 @@ ARCH=lpc21 -BOARD_CFG = \"booz2_board_v1_0.h\" +BOARD_CFG = \"boards/booz2_v1_0.h\" # prevents motors from ever starting #ap.CFLAGS += -DKILL_MOTORS diff --git a/conf/autopilot/booz2_board_v1_0.h b/conf/autopilot/boards/booz2_v1_0.h similarity index 100% rename from conf/autopilot/booz2_board_v1_0.h rename to conf/autopilot/boards/booz2_v1_0.h diff --git a/conf/autopilot/booz2_autopilot.makefile b/conf/autopilot/booz2_autopilot.makefile index 6bb806546d..ba896d55f1 100644 --- a/conf/autopilot/booz2_autopilot.makefile +++ b/conf/autopilot/booz2_autopilot.makefile @@ -124,6 +124,7 @@ ap.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/booz_stabilization_a ap.srcs += $(SRC_BOOZ)/stabilization/booz_stabilization_attitude_ref_euler_int.c ap.srcs += $(SRC_BOOZ)/stabilization/booz_stabilization_attitude_euler_int.c +ap.CFLAGS += -DUSE_NAVIGATION ap.srcs += $(SRC_BOOZ)/guidance/booz2_guidance_h.c ap.srcs += $(SRC_BOOZ)/guidance/booz2_guidance_v.c diff --git a/conf/autopilot/booz2_board_usb.h b/conf/autopilot/booz2_board_usb.h deleted file mode 100644 index f921b2e511..0000000000 --- a/conf/autopilot/booz2_board_usb.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef CONFIG_DEMO_H -#define CONFIG_DEMO_H - -/* Master oscillator freq. */ -#define FOSC (12000000) -/* PLL multiplier */ -#define PLL_MUL (5) -/* CPU clock freq. */ -#define CCLK (FOSC * PLL_MUL) -/* Peripheral bus speed mask 0x00->4, 0x01-> 1, 0x02 -> 2 */ -#define PBSD_BITS 0x02 -#define PBSD_VAL 2 -/* Peripheral bus clock freq. */ -#define PCLK (CCLK / PBSD_VAL) - -#define LED_1_BANK 1 -#define LED_1_PIN 24 - - -#endif /* CONFIG_DEMO_H */ diff --git a/conf/settings/settings_booz2_test_motors_hexa.xml b/conf/settings/settings_booz2_test_motors_hexa.xml new file mode 100644 index 0000000000..2db350eddf --- /dev/null +++ b/conf/settings/settings_booz2_test_motors_hexa.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sw/airborne/booz/booz2_supervision.h b/sw/airborne/booz/actuators/booz_supervision.h similarity index 98% rename from sw/airborne/booz/booz2_supervision.h rename to sw/airborne/booz/actuators/booz_supervision.h index 49721d7d14..2278354136 100644 --- a/sw/airborne/booz/booz2_supervision.h +++ b/sw/airborne/booz/actuators/booz_supervision.h @@ -21,8 +21,8 @@ * Boston, MA 02111-1307, USA. */ -#ifndef BOOZ2_SUPERVISION_H -#define BOOZ2_SUPERVISION_H +#ifndef BOOZ_SUPERVISION_H +#define BOOZ_SUPERVISION_H #include "airframe.h" @@ -117,4 +117,4 @@ -#endif /* BOOZ2_SUPERVISION_H */ +#endif /* BOOZ_SUPERVISION_H */ diff --git a/sw/airborne/booz/arch/lpc21/actuators_buss_twi_blmc_hw.h b/sw/airborne/booz/arch/lpc21/actuators_buss_twi_blmc_hw.h index 75af8fddb1..35719f25c2 100644 --- a/sw/airborne/booz/arch/lpc21/actuators_buss_twi_blmc_hw.h +++ b/sw/airborne/booz/arch/lpc21/actuators_buss_twi_blmc_hw.h @@ -31,7 +31,7 @@ #include "i2c.h" #include "airframe.h" -#include "booz2_supervision.h" +#include "actuators/booz_supervision.h" /* We're not using the airframe file "mixer" facility @@ -68,7 +68,7 @@ buss_twi_blmc_idx = 0; \ buss_twi_blmc_status = BUSS_TWI_BLMC_STATUS_BUSY; \ ActuatorsBussTwiBlmcSend(); \ -} + } #else #define ActuatorsCommit() { \ if ( buss_twi_blmc_status == BUSS_TWI_BLMC_STATUS_IDLE) { \ @@ -76,8 +76,8 @@ buss_twi_blmc_status = BUSS_TWI_BLMC_STATUS_BUSY; \ ActuatorsBussTwiBlmcSend(); \ } \ - else \ - twi_blmc_nb_err++; \ + else \ + twi_blmc_nb_err++; \ } #endif @@ -85,7 +85,8 @@ #define BUSS_TWI_BLMC_STATUS_IDLE 0 #define BUSS_TWI_BLMC_STATUS_BUSY 1 -#define BUSS_TWI_BLMC_NB 4 +#define BUSS_TWI_BLMC_NB 4 +//(sizeof(buss_twi_blmc_addr)/sizeof(uint8_t)) extern uint8_t buss_twi_blmc_motor_power[BUSS_TWI_BLMC_NB]; extern volatile bool_t buss_twi_blmc_status; extern uint8_t twi_blmc_nb_err; diff --git a/sw/airborne/booz/booz2_datalink.c b/sw/airborne/booz/booz2_datalink.c index 68e52ece9e..1524f3adfb 100644 --- a/sw/airborne/booz/booz2_datalink.c +++ b/sw/airborne/booz/booz2_datalink.c @@ -68,7 +68,7 @@ void dl_parse_msg(void) { } break; #endif - +#if defined USE_NAVIGATION case DL_BLOCK : { if (DL_BLOCK_ac_id(dl_buffer) != AC_ID) break; @@ -94,6 +94,7 @@ void dl_parse_msg(void) { DOWNLINK_SEND_WP_MOVED_LTP(&wp_id, &enu.x, &enu.y, &enu.z); } break; +#endif /* USE_NAVIGATION */ } } diff --git a/sw/airborne/booz/test/booz2_test_buss_bldc_hexa.c b/sw/airborne/booz/test/booz2_test_buss_bldc_hexa.c index 709a2d5e61..ef661aeed1 100644 --- a/sw/airborne/booz/test/booz2_test_buss_bldc_hexa.c +++ b/sw/airborne/booz/test/booz2_test_buss_bldc_hexa.c @@ -26,14 +26,23 @@ #include "init_hw.h" #include "sys_time.h" #include "interrupt_hw.h" +#include "downlink.h" +#include "datalink.h" + +#include "booz2_test_buss_bldc_hexa.h" + +#define NB_MOTORS 6 +static const uint8_t motor_addr[] = {0x52, 0x54, 0x56, 0x58, 0x5A, 0x5C}; +uint8_t motor = 0; +uint8_t thrust = 10; +static bool_t i2c_done; //static uint8_t addr = 0x52; /* 1 : back right */ //static uint8_t addr = 0x54; /* 2 : back left bad balanced */ //static uint8_t addr = 0x56; /* 3 : center right not so well balanced */ -static uint8_t addr = 0x58; /* 4 : center left */ +//static uint8_t addr = 0x58; /* 4 : center left */ //static uint8_t addr = 0x5A; /* 5 : front right */ //static uint8_t addr = 0x5C; /* 6 : front left */ -static bool_t i2c_done; static inline void main_init( void ); static inline void main_periodic_task( void ); @@ -56,12 +65,14 @@ static inline void main_init( void ) { } static inline void main_periodic_task( void ) { - uint8_t thrust = 20; i2c0_buf[0] = thrust; - i2c0_transmit(addr, 1, &i2c_done); + i2c0_transmit(motor_addr[motor], 1, &i2c_done); + + RunOnceEvery(128, { DOWNLINK_SEND_ALIVE(16, MD5SUM);}); + } static inline void main_event_task( void ) { - + DatalinkEvent(); }