diff --git a/conf/Makefile.arm-embedded-toolchain b/conf/Makefile.arm-embedded-toolchain index a3fb4b7ba35..aebc4420bb8 100644 --- a/conf/Makefile.arm-embedded-toolchain +++ b/conf/Makefile.arm-embedded-toolchain @@ -7,25 +7,25 @@ # This is the common Makefile for finding the arm compiler # for bare metal systems like on the ARM7TDMI, cortex M3/4 -PREFIX ?= arm-none-eabi +PREFIX ?= arm-none-eabi- -ifeq ($(shell which $(PREFIX)-gcc),) +ifeq ($(shell which $(PREFIX)gcc),) ifneq ($(MAKECMDGOALS),clean) $(warning Warning: arm-none-eabi-gcc cross-compiler not found! Some tools might not be able to build correctly) endif endif -CC = $(PREFIX)-gcc -CXX = $(PREFIX)-g++ -LD = $(PREFIX)-g++ -AR = $(PREFIX)-ar -CP = $(PREFIX)-objcopy -DMP = $(PREFIX)-objdump -NM = $(PREFIX)-nm -SIZE = $(PREFIX)-size -STRIP = $(PREFIX)-strip +CC = $(PREFIX)gcc +CXX = $(PREFIX)g++ +LD = $(PREFIX)g++ +AR = $(PREFIX)ar +CP = $(PREFIX)objcopy +DMP = $(PREFIX)objdump +NM = $(PREFIX)nm +SIZE = $(PREFIX)size +STRIP = $(PREFIX)strip -GDB = $(shell which $(PREFIX)-gdb) +GDB = $(shell which $(PREFIX)gdb) ifeq ($(GDB),) GDB = $(shell which gdb-multiarch) endif diff --git a/conf/Makefile.arm-linux-toolchain b/conf/Makefile.arm-linux-toolchain index 04c747e9d1f..afc1ab3d2ca 100644 --- a/conf/Makefile.arm-linux-toolchain +++ b/conf/Makefile.arm-linux-toolchain @@ -9,15 +9,15 @@ # If HARD_FLOAT is defined try to find armhf cross compiler, otherwise default to softfloat ifdef HARD_FLOAT -PREFIX ?= arm-linux-gnueabihf +PREFIX ?= arm-linux-gnueabihf- else -PREFIX ?= arm-linux-gnueabi +PREFIX ?= arm-linux-gnueabi- endif # # if gcc can't be found in path, try the codesourcery toolchain in /usr/local/codesourcery # -ifeq ($(shell which $(PREFIX)-gcc),) +ifeq ($(shell which $(PREFIX)gcc),) ifndef HARD_FLOAT TOOLCHAIN=$(shell find -L /usr/local/codesourcery -maxdepth 2 -type d -name arm-none-linux-gnueabi 2>/dev/null | head -n 1) ifneq ($(TOOLCHAIN),) @@ -27,7 +27,7 @@ endif endif # if toolchain could not be found, print some useful info -ifeq ($(shell which $(PREFIX)-gcc),) +ifeq ($(shell which $(PREFIX)gcc),) # no suitable toolchain found... ifdef HARD_FLOAT $(error Error: arm-linux-gnueabihf-gcc cross-compiler not found! Please install the gcc-arm-linux-gnueabihf package.) @@ -36,17 +36,17 @@ ifeq ($(shell which $(PREFIX)-gcc),) endif endif -CC = $(PREFIX)-gcc -CXX = $(PREFIX)-g++ -LD = $(PREFIX)-g++ -AR = $(PREFIX)-ar -CP = $(PREFIX)-objcopy -DMP = $(PREFIX)-objdump -NM = $(PREFIX)-nm -SIZE = $(PREFIX)-size -STRIP = $(PREFIX)-strip - -GDB = $(shell which $(PREFIX)-gdb) +CC = $(PREFIX)gcc +CXX = $(PREFIX)g++ +LD = $(PREFIX)g++ +AR = $(PREFIX)ar +CP = $(PREFIX)objcopy +DMP = $(PREFIX)objdump +NM = $(PREFIX)nm +SIZE = $(PREFIX)size +STRIP = $(PREFIX)strip + +GDB = $(shell which $(PREFIX)gdb) ifeq ($(GDB),) GDB = $(shell which gdb-multiarch) endif diff --git a/sw/airborne/arch/stm32/apogee.ld b/sw/airborne/arch/stm32/apogee.ld index 542e8d055f6..350be841d37 100644 --- a/sw/airborne/arch/stm32/apogee.ld +++ b/sw/airborne/arch/stm32/apogee.ld @@ -31,5 +31,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f4.ld - +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/cc3d.ld b/sw/airborne/arch/stm32/cc3d.ld index 1356a7cb54f..91f3627d51a 100644 --- a/sw/airborne/arch/stm32/cc3d.ld +++ b/sw/airborne/arch/stm32/cc3d.ld @@ -32,4 +32,5 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f1.ld +INCLUDE cortex-m-generic.ld + diff --git a/sw/airborne/arch/stm32/cjmcu.ld b/sw/airborne/arch/stm32/cjmcu.ld index 17adb0aaa72..481164109c9 100644 --- a/sw/airborne/arch/stm32/cjmcu.ld +++ b/sw/airborne/arch/stm32/cjmcu.ld @@ -32,4 +32,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f1.ld +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/crazybee_f4_1.0.ld b/sw/airborne/arch/stm32/crazybee_f4_1.0.ld index ff1bd7d8f14..854216eb81e 100644 --- a/sw/airborne/arch/stm32/crazybee_f4_1.0.ld +++ b/sw/airborne/arch/stm32/crazybee_f4_1.0.ld @@ -34,5 +34,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f4.ld -/* INCLUDE cortex-m-generic.ld */ +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/elle0.ld b/sw/airborne/arch/stm32/elle0.ld index 683779e9c2f..432753243a7 100644 --- a/sw/airborne/arch/stm32/elle0.ld +++ b/sw/airborne/arch/stm32/elle0.ld @@ -32,4 +32,5 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f4.ld +INCLUDE cortex-m-generic.ld + diff --git a/sw/airborne/arch/stm32/krooz.ld b/sw/airborne/arch/stm32/krooz.ld index 35dac1e100d..abd47f99753 100644 --- a/sw/airborne/arch/stm32/krooz.ld +++ b/sw/airborne/arch/stm32/krooz.ld @@ -33,4 +33,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f4.ld +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/lisa-l.ld b/sw/airborne/arch/stm32/lisa-l.ld index d0dce5a1681..fa0d03536f2 100644 --- a/sw/airborne/arch/stm32/lisa-l.ld +++ b/sw/airborne/arch/stm32/lisa-l.ld @@ -32,4 +32,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f1.ld +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/lisa-m.ld b/sw/airborne/arch/stm32/lisa-m.ld index b8e17d164b1..fd07adfddec 100644 --- a/sw/airborne/arch/stm32/lisa-m.ld +++ b/sw/airborne/arch/stm32/lisa-m.ld @@ -32,5 +32,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f1.ld - +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/lisa-mx.ld b/sw/airborne/arch/stm32/lisa-mx.ld index a4810e0371b..f3fc1cdf8c3 100644 --- a/sw/airborne/arch/stm32/lisa-mx.ld +++ b/sw/airborne/arch/stm32/lisa-mx.ld @@ -32,4 +32,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f4.ld +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/lisa-s.ld b/sw/airborne/arch/stm32/lisa-s.ld index 75932615d6d..f19daafcf75 100644 --- a/sw/airborne/arch/stm32/lisa-s.ld +++ b/sw/airborne/arch/stm32/lisa-s.ld @@ -32,5 +32,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f1.ld - +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/mcu_arch.c b/sw/airborne/arch/stm32/mcu_arch.c index 0fa9b3f9f37..460ac6cd966 100644 --- a/sw/airborne/arch/stm32/mcu_arch.c +++ b/sw/airborne/arch/stm32/mcu_arch.c @@ -52,7 +52,7 @@ const struct rcc_clock_scale rcc_hse_24mhz_3v3[RCC_CLOCK_3V3_END] = { .hpre = RCC_CFGR_HPRE_DIV_NONE, .ppre1 = RCC_CFGR_PPRE_DIV_4, .ppre2 = RCC_CFGR_PPRE_DIV_2, - .power_save = 1, + .voltage_scale = PWR_SCALE1, .flash_config = FLASH_ACR_ICEN | FLASH_ACR_DCEN | FLASH_ACR_LATENCY_3WS, .ahb_frequency = 48000000, .apb1_frequency = 12000000, @@ -66,7 +66,7 @@ const struct rcc_clock_scale rcc_hse_24mhz_3v3[RCC_CLOCK_3V3_END] = { .hpre = RCC_CFGR_HPRE_DIV_NONE, .ppre1 = RCC_CFGR_PPRE_DIV_2, .ppre2 = RCC_CFGR_PPRE_DIV_NONE, - .power_save = 1, + .voltage_scale = PWR_SCALE1, .flash_config = FLASH_ACR_ICEN | FLASH_ACR_DCEN | FLASH_ACR_LATENCY_2WS, .ahb_frequency = 84000000, .apb1_frequency = 42000000, @@ -80,7 +80,7 @@ const struct rcc_clock_scale rcc_hse_24mhz_3v3[RCC_CLOCK_3V3_END] = { .hpre = RCC_CFGR_HPRE_DIV_NONE, .ppre1 = RCC_CFGR_PPRE_DIV_4, .ppre2 = RCC_CFGR_PPRE_DIV_2, - .power_save = 1, + .voltage_scale = PWR_SCALE1, .flash_config = FLASH_ACR_ICEN | FLASH_ACR_DCEN | FLASH_ACR_LATENCY_3WS, .ahb_frequency = 120000000, .apb1_frequency = 30000000, @@ -227,40 +227,40 @@ void mcu_arch_init(void) #if EXT_CLK == 8000000 #if defined(STM32F1) PRINT_CONFIG_MSG("Using 8MHz external clock to PLL it to 72MHz.") - rcc_clock_setup_in_hse_8mhz_out_72mhz(); + rcc_clock_setup_pll(&rcc_hse_configs[RCC_CLOCK_HSE8_72MHZ]) #elif defined(STM32F4) #if AHB_CLK == 84000000 PRINT_CONFIG_MSG("Using 8MHz external clock to PLL it to 84MHz.") - rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_84MHZ]); + rcc_clock_setup_pll(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_84MHZ]); #else PRINT_CONFIG_MSG("Using 8MHz external clock to PLL it to 168MHz.") - rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]); + rcc_clock_setup_pll(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]); #endif #endif #elif EXT_CLK == 12000000 #if defined(STM32F1) PRINT_CONFIG_MSG("Using 12MHz external clock to PLL it to 72MHz.") - rcc_clock_setup_in_hse_12mhz_out_72mhz(); + rcc_clock_setup_pll(&rcc_hse_configs[RCC_CLOCK_HSE12_72MHZ]); #elif defined(STM32F4) PRINT_CONFIG_MSG("Using 12MHz external clock to PLL it to 168MHz.") - rcc_clock_setup_hse_3v3(&rcc_hse_12mhz_3v3[RCC_CLOCK_3V3_168MHZ]); + rcc_clock_setup_pll(&rcc_hse_12mhz_3v3[RCC_CLOCK_3V3_168MHZ]); #endif #elif EXT_CLK == 16000000 #if defined(STM32F4) PRINT_CONFIG_MSG("Using 16MHz external clock to PLL it to 168MHz.") - rcc_clock_setup_hse_3v3(&rcc_hse_16mhz_3v3[RCC_CLOCK_3V3_168MHZ]); + rcc_clock_setup_pll(&rcc_hse_16mhz_3v3[RCC_CLOCK_3V3_168MHZ]); #endif #elif EXT_CLK == 24000000 #if defined(STM32F4) PRINT_CONFIG_MSG("Using 24MHz external clock to PLL it to 168MHz.") - rcc_clock_setup_hse_3v3(&rcc_hse_24mhz_3v3[RCC_CLOCK_3V3_168MHZ]); + rcc_clock_setup_pll(&rcc_hse_24mhz_3v3[RCC_CLOCK_3V3_168MHZ]); #elif defined(STM32F1) rcc_clock_setup_in_hse_24mhz_out_24mhz_pprz(); #endif #elif EXT_CLK == 25000000 #if defined(STM32F4) PRINT_CONFIG_MSG("Using 25MHz external clock to PLL it to 168MHz.") - rcc_clock_setup_hse_3v3(&rcc_hse_25mhz_3v3[RCC_CLOCK_3V3_168MHZ]); + rcc_clock_setup_pll(&rcc_hse_25mhz_3v3[RCC_CLOCK_3V3_168MHZ]); #endif #else #error EXT_CLK is either set to an unsupported frequency or not defined at all. Please check! diff --git a/sw/airborne/arch/stm32/mcu_periph/adc_arch.c b/sw/airborne/arch/stm32/mcu_periph/adc_arch.c index 890525fc4a1..9bef5bec4e6 100644 --- a/sw/airborne/arch/stm32/mcu_periph/adc_arch.c +++ b/sw/airborne/arch/stm32/mcu_periph/adc_arch.c @@ -132,6 +132,10 @@ #endif #endif +#define RST_ADC1 RST_ADC +#define RST_ADC2 RST_ADC +#define RST_ADC3 RST_ADC + #else // !STM32F4 // ADC 3 not supported on STM32F1 #undef USE_AD3 @@ -435,16 +439,18 @@ static inline void adc_init_rcc(void) /* Enable ADC peripheral clocks. */ #if USE_AD1 rcc_periph_clock_enable(RCC_ADC1); + rcc_periph_reset_pulse(RST_ADC1); #endif #if USE_AD2 rcc_periph_clock_enable(RCC_ADC2); + rcc_periph_reset_pulse(RST_ADC2); #endif #if USE_AD3 rcc_periph_clock_enable(RCC_ADC3); + rcc_periph_reset_pulse(RST_ADC3); #endif /* Time Base configuration */ - timer_reset(TIM_ADC); timer_set_mode(TIM_ADC, TIM_CR1_CKD_CK_INT, TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP); /* timer counts with ADC_TIMER_FREQUENCY */ diff --git a/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c b/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c index 8337fbc1004..432f0ba5c54 100644 --- a/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c +++ b/sw/airborne/arch/stm32/mcu_periph/i2c_arch.c @@ -1134,9 +1134,9 @@ static void i2c_stm32_setbitrate(struct i2c_periph *periph, int bitrate) // 1) #ifdef STM32F1 - i2c_set_clock_frequency(i2c, I2C_CR2_FREQ_36MHZ); + i2c_set_clock_frequency(i2c, 36); #else // STM32F4 - i2c_set_clock_frequency(i2c, I2C_CR2_FREQ_42MHZ); + i2c_set_clock_frequency(i2c, 42); #endif // 2) //i2c_set_fast_mode(i2c); diff --git a/sw/airborne/arch/stm32/modules/actuators/actuators_shared_arch.c b/sw/airborne/arch/stm32/modules/actuators/actuators_shared_arch.c index 332aa8aa8fc..8d216315d32 100644 --- a/sw/airborne/arch/stm32/modules/actuators/actuators_shared_arch.c +++ b/sw/airborne/arch/stm32/modules/actuators/actuators_shared_arch.c @@ -59,7 +59,8 @@ void actuators_pwm_arch_channel_init(uint32_t timer_peripheral, void set_servo_timer(uint32_t timer, uint32_t freq, uint8_t channels_mask) { // WARNING, this reset is only implemented for TIM1-8 in libopencm3!! - timer_reset(timer); + + //FIXME removed deprecated timer_reset(timer), should it be replaced by rcc_periph_reset_pulse(RST_TIMx) ? /* Timer global mode: * - No divider. diff --git a/sw/airborne/arch/stm32/modules/radio_control/ppm_arch.c b/sw/airborne/arch/stm32/modules/radio_control/ppm_arch.c index 2c2d288461e..c9b94803837 100644 --- a/sw/airborne/arch/stm32/modules/radio_control/ppm_arch.c +++ b/sw/airborne/arch/stm32/modules/radio_control/ppm_arch.c @@ -61,48 +61,56 @@ static uint32_t timer_rollover_cnt; PRINT_CONFIG_MSG("Using TIM1 for PPM input.") #define PPM_TIMER TIM1 #define RCC_TIM_PPM RCC_TIM1 +#define RST_TIM_PPM RST_TIM1 #elif USE_PPM_TIM2 PRINT_CONFIG_MSG("Using TIM2 for PPM input.") #define PPM_TIMER TIM2 #define RCC_TIM_PPM RCC_TIM2 +#define RST_TIM_PPM RST_TIM2 #elif USE_PPM_TIM3 PRINT_CONFIG_MSG("Using TIM3 for PPM input.") #define PPM_TIMER TIM3 #define RCC_TIM_PPM RCC_TIM3 +#define RST_TIM_PPM RST_TIM3 #elif USE_PPM_TIM4 PRINT_CONFIG_MSG("Using TIM4 for PPM input.") #define PPM_TIMER TIM4 #define RCC_TIM_PPM RCC_TIM4 +#define RST_TIM_PPM RST_TIM4 #elif USE_PPM_TIM5 PRINT_CONFIG_MSG("Using TIM5 for PPM input.") #define PPM_TIMER TIM5 #define RCC_TIM_PPM RCC_TIM5 +#define RST_TIM_PPM RST_TIM5 #elif USE_PPM_TIM8 PRINT_CONFIG_MSG("Using TIM8 for PPM input.") #define PPM_TIMER TIM8 #define RCC_TIM_PPM RCC_TIM8 +#define RST_TIM_PPM RST_TIM8 #elif USE_PPM_TIM9 PRINT_CONFIG_MSG("Using TIM9 for PPM input.") #define PPM_TIMER TIM9 #define RCC_TIM_PPM RCC_TIM9 +#define RST_TIM_PPM RST_TIM9 #elif USE_PPM_TIM12 PRINT_CONFIG_MSG("Using TIM12 for PPM input.") #define PPM_TIMER TIM12 #define RCC_TIM_PPM RCC_TIM12 +#define RST_TIM_PPM RST_TIM12 #else #error Unknown PPM input timer configuration. @@ -117,7 +125,7 @@ void ppm_arch_init(void) gpio_setup_pin_af(PPM_GPIO_PORT, PPM_GPIO_PIN, PPM_GPIO_AF, FALSE); /* Time Base configuration */ - timer_reset(PPM_TIMER); + rcc_periph_reset_pulse(RST_TIM_PPM); timer_set_mode(PPM_TIMER, TIM_CR1_CKD_CK_INT, TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP); timer_set_period(PPM_TIMER, 0xFFFF); diff --git a/sw/airborne/arch/stm32/navstik.ld b/sw/airborne/arch/stm32/navstik.ld index a3292f1f94e..cd9c9c99bba 100644 --- a/sw/airborne/arch/stm32/navstik.ld +++ b/sw/airborne/arch/stm32/navstik.ld @@ -33,4 +33,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f4.ld +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/naze32.ld b/sw/airborne/arch/stm32/naze32.ld index da613a87149..9023b24f431 100644 --- a/sw/airborne/arch/stm32/naze32.ld +++ b/sw/airborne/arch/stm32/naze32.ld @@ -32,4 +32,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f1.ld +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/openpilot_revo.ld b/sw/airborne/arch/stm32/openpilot_revo.ld index cfd9897dff0..9403fe7e1dc 100644 --- a/sw/airborne/arch/stm32/openpilot_revo.ld +++ b/sw/airborne/arch/stm32/openpilot_revo.ld @@ -32,4 +32,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f4.ld +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/openpilot_revo_nano.ld b/sw/airborne/arch/stm32/openpilot_revo_nano.ld index a83518f8cc9..3b9bc7a1cbe 100644 --- a/sw/airborne/arch/stm32/openpilot_revo_nano.ld +++ b/sw/airborne/arch/stm32/openpilot_revo_nano.ld @@ -32,4 +32,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f4.ld +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/px4fmu_2.4.ld b/sw/airborne/arch/stm32/px4fmu_2.4.ld index 2d31823fb82..434044a34c3 100644 --- a/sw/airborne/arch/stm32/px4fmu_2.4.ld +++ b/sw/airborne/arch/stm32/px4fmu_2.4.ld @@ -30,4 +30,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f4.ld +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/px4fmu_4.0.ld b/sw/airborne/arch/stm32/px4fmu_4.0.ld index 53d65c7979b..2c1e3bfaf58 100644 --- a/sw/airborne/arch/stm32/px4fmu_4.0.ld +++ b/sw/airborne/arch/stm32/px4fmu_4.0.ld @@ -31,4 +31,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f4.ld +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/px4io_2.4.ld b/sw/airborne/arch/stm32/px4io_2.4.ld index b560cf8996b..74f17313c2f 100644 --- a/sw/airborne/arch/stm32/px4io_2.4.ld +++ b/sw/airborne/arch/stm32/px4io_2.4.ld @@ -32,5 +32,4 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f1.ld - +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/stm32default.ld b/sw/airborne/arch/stm32/stm32default.ld index 1dac0b3a5af..0abd0338cde 100644 --- a/sw/airborne/arch/stm32/stm32default.ld +++ b/sw/airborne/arch/stm32/stm32default.ld @@ -33,5 +33,5 @@ MEMORY } /* Include the common ld script. */ -INCLUDE libopencm3_stm32f1.ld +INCLUDE cortex-m-generic.ld diff --git a/sw/airborne/arch/stm32/usb_ser_hw.c b/sw/airborne/arch/stm32/usb_ser_hw.c index 78b89a3fd94..c653b36ba77 100644 --- a/sw/airborne/arch/stm32/usb_ser_hw.c +++ b/sw/airborne/arch/stm32/usb_ser_hw.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include "mcu_periph/usb_serial.h" @@ -230,7 +230,7 @@ uint8_t usbd_control_buffer[128]; * CDC device control request * (from libopencm3 examples) */ -static int cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, +static enum usbd_request_return_codes cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len, void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req)) { (void)complete; @@ -256,16 +256,16 @@ static int cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data * local_buf[8] = req->wValue & 3; local_buf[9] = 0; usbd_ep_write_packet(usbd_dev, 0x83, local_buf, 10); - return 1; + return USBD_REQ_HANDLED; } case USB_CDC_REQ_SET_LINE_CODING: if (*len < sizeof(struct usb_cdc_line_coding)) { - return 0; + return USBD_REQ_NOTSUPP; } - return 1; + return USBD_REQ_HANDLED; default: - return 0; + return USBD_REQ_NOTSUPP; } } diff --git a/sw/ext/libopencm3 b/sw/ext/libopencm3 index 953bf531ea1..5980c58f9b7 160000 --- a/sw/ext/libopencm3 +++ b/sw/ext/libopencm3 @@ -1 +1 @@ -Subproject commit 953bf531ea1c0b36a5b32b05ede8c6c77e480009 +Subproject commit 5980c58f9b72bf302f64da76bdf105a85b9d1903 diff --git a/sw/ext/luftboot b/sw/ext/luftboot index 6af6ab63a36..836f16c0abc 160000 --- a/sw/ext/luftboot +++ b/sw/ext/luftboot @@ -1 +1 @@ -Subproject commit 6af6ab63a36557a3cc894777129351fb8b5f89d2 +Subproject commit 836f16c0abc74617c87fe073fd4b06462c3db1ad