diff --git a/os/hal/platforms/STM32/I2Cv2/i2c_lld.c b/os/hal/platforms/STM32/I2Cv2/i2c_lld.c
index 3a6c8f7f8..7ba62a44c 100644
--- a/os/hal/platforms/STM32/I2Cv2/i2c_lld.c
+++ b/os/hal/platforms/STM32/I2Cv2/i2c_lld.c
@@ -612,7 +612,7 @@ msg_t i2c_lld_master_receive_timeout(I2CDriver *i2cp, i2caddr_t addr,
VirtualTimer vt;
uint32_t addr_cr2 = addr & I2C_CR2_SADD;
- chDbgCheck((rxbytes > 1), "i2c_lld_master_receive_timeout");
+ chDbgCheck((rxbytes > 0), "i2c_lld_master_receive_timeout");
/* Resetting error flags for this transfer.*/
i2cp->errors = I2CD_NO_ERROR;
diff --git a/os/hal/platforms/STM32F0xx/adc_lld.c b/os/hal/platforms/STM32F0xx/adc_lld.c
index 2fad88cda..5fa419679 100644
--- a/os/hal/platforms/STM32F0xx/adc_lld.c
+++ b/os/hal/platforms/STM32F0xx/adc_lld.c
@@ -102,7 +102,7 @@ static void adc_lld_serve_rx_interrupt(ADCDriver *adcp, uint32_t flags) {
*
* @isr
*/
-CH_IRQ_HANDLER(ADC1_COMP_IRQHandler) {
+CH_IRQ_HANDLER(Vector70) {
uint32_t isr;
CH_IRQ_PROLOGUE();
diff --git a/os/hal/platforms/STM32F0xx/ext_lld_isr.c b/os/hal/platforms/STM32F0xx/ext_lld_isr.c
index d4fd06155..afccfdd8c 100644
--- a/os/hal/platforms/STM32F0xx/ext_lld_isr.c
+++ b/os/hal/platforms/STM32F0xx/ext_lld_isr.c
@@ -50,11 +50,11 @@
/*===========================================================================*/
/**
- * @brief EXTI[0] interrupt handler.
+ * @brief EXTI[0]...EXTI[1] interrupt handler.
*
* @isr
*/
-CH_IRQ_HANDLER(EXTI0_1_IRQHandler) {
+CH_IRQ_HANDLER(Vector54) {
uint32_t pr;
CH_IRQ_PROLOGUE();
@@ -70,11 +70,11 @@ CH_IRQ_HANDLER(EXTI0_1_IRQHandler) {
}
/**
- * @brief EXTI[1] interrupt handler.
+ * @brief EXTI[2]...EXTI[3] interrupt handler.
*
* @isr
*/
-CH_IRQ_HANDLER(EXTI2_3_IRQHandler) {
+CH_IRQ_HANDLER(Vector58) {
uint32_t pr;
CH_IRQ_PROLOGUE();
@@ -94,7 +94,7 @@ CH_IRQ_HANDLER(EXTI2_3_IRQHandler) {
*
* @isr
*/
-CH_IRQ_HANDLER(EXTI4_15_IRQHandler) {
+CH_IRQ_HANDLER(Vector5C) {
uint32_t pr;
CH_IRQ_PROLOGUE();
@@ -136,7 +136,7 @@ CH_IRQ_HANDLER(EXTI4_15_IRQHandler) {
*
* @isr
*/
-CH_IRQ_HANDLER(PVD_IRQHandler) {
+CH_IRQ_HANDLER(Vector44) {
CH_IRQ_PROLOGUE();
@@ -151,7 +151,7 @@ CH_IRQ_HANDLER(PVD_IRQHandler) {
*
* @isr
*/
-CH_IRQ_HANDLER(RTC_IRQHandler) {
+CH_IRQ_HANDLER(Vector48) {
CH_IRQ_PROLOGUE();
diff --git a/os/hal/platforms/STM32F0xx/stm32_dma.c b/os/hal/platforms/STM32F0xx/stm32_dma.c
index 44f10cbf6..2305d952d 100644
--- a/os/hal/platforms/STM32F0xx/stm32_dma.c
+++ b/os/hal/platforms/STM32F0xx/stm32_dma.c
@@ -109,7 +109,7 @@ static dma_isr_redir_t dma_isr_redir[STM32_DMA_STREAMS];
*
* @isr
*/
-CH_IRQ_HANDLER(DMA1_Ch1_IRQHandler) {
+CH_IRQ_HANDLER(Vector64) {
uint32_t flags;
CH_IRQ_PROLOGUE();
@@ -127,7 +127,7 @@ CH_IRQ_HANDLER(DMA1_Ch1_IRQHandler) {
*
* @isr
*/
-CH_IRQ_HANDLER(DMA1_Ch2_3_IRQHandler) {
+CH_IRQ_HANDLER(Vector68) {
uint32_t flags;
CH_IRQ_PROLOGUE();
@@ -156,7 +156,7 @@ CH_IRQ_HANDLER(DMA1_Ch2_3_IRQHandler) {
*
* @isr
*/
-CH_IRQ_HANDLER(DMA1_Ch4_5_IRQHandler) {
+CH_IRQ_HANDLER(Vector6C) {
uint32_t flags;
CH_IRQ_PROLOGUE();
diff --git a/readme.txt b/readme.txt
index 6ee12707e..07762bf05 100644
--- a/readme.txt
+++ b/readme.txt
@@ -89,6 +89,7 @@
*****************************************************************************
*** 2.5.2 ***
+- FIX: Fixed STM32F051 various (bug #400).
- FIX: Fixed STM32F103 HSI configuration (bug #399).
- FIX: Fixed patch to allow simulator to be restarted quicker (bug #398).
- FIX: Fixed blkDisconnect macro typo (bug #397).
diff --git a/testhal/STM32F0xx/ADC/.cproject b/testhal/STM32F0xx/ADC/.cproject
new file mode 100644
index 000000000..a3fb831a8
--- /dev/null
+++ b/testhal/STM32F0xx/ADC/.cproject
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testhal/STM32F0xx/ADC/.project b/testhal/STM32F0xx/ADC/.project
new file mode 100644
index 000000000..4aa2b6463
--- /dev/null
+++ b/testhal/STM32F0xx/ADC/.project
@@ -0,0 +1,38 @@
+
+
+ STM32F0xx-ADC
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
+
+ board
+ 2
+ CHIBIOS/boards/ST_STM32F0_DISCOVERY
+
+
+ os
+ 2
+ CHIBIOS/os
+
+
+
diff --git a/testhal/STM32F0xx/EXT/.cproject b/testhal/STM32F0xx/EXT/.cproject
new file mode 100644
index 000000000..818c355d4
--- /dev/null
+++ b/testhal/STM32F0xx/EXT/.cproject
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testhal/STM32F0xx/EXT/.project b/testhal/STM32F0xx/EXT/.project
new file mode 100644
index 000000000..301651983
--- /dev/null
+++ b/testhal/STM32F0xx/EXT/.project
@@ -0,0 +1,38 @@
+
+
+ STM32F0xx-EXT
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
+
+ board
+ 2
+ CHIBIOS/boards/ST_STM32F0_DISCOVERY
+
+
+ os
+ 2
+ CHIBIOS/os
+
+
+
diff --git a/testhal/STM32F0xx/IRQ_STORM/.cproject b/testhal/STM32F0xx/IRQ_STORM/.cproject
new file mode 100644
index 000000000..aea7bcbae
--- /dev/null
+++ b/testhal/STM32F0xx/IRQ_STORM/.cproject
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testhal/STM32F0xx/IRQ_STORM/.project b/testhal/STM32F0xx/IRQ_STORM/.project
new file mode 100644
index 000000000..a3027689a
--- /dev/null
+++ b/testhal/STM32F0xx/IRQ_STORM/.project
@@ -0,0 +1,38 @@
+
+
+ STM32F0xx-IRQ_STORM
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
+
+ board
+ 2
+ CHIBIOS/boards/ST_STM32F0_DISCOVERY
+
+
+ os
+ 2
+ CHIBIOS/os
+
+
+
diff --git a/testhal/STM32F0xx/PWM-ICU/.cproject b/testhal/STM32F0xx/PWM-ICU/.cproject
new file mode 100644
index 000000000..b8b1e0f2b
--- /dev/null
+++ b/testhal/STM32F0xx/PWM-ICU/.cproject
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testhal/STM32F0xx/PWM-ICU/.project b/testhal/STM32F0xx/PWM-ICU/.project
new file mode 100644
index 000000000..60ef1bb65
--- /dev/null
+++ b/testhal/STM32F0xx/PWM-ICU/.project
@@ -0,0 +1,38 @@
+
+
+ STM32F0xx-PWM-ICU
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
+
+ board
+ 2
+ CHIBIOS/boards/ST_STM32F0_DISCOVERY
+
+
+ os
+ 2
+ CHIBIOS/os
+
+
+
diff --git a/testhal/STM32F0xx/UART/.cproject b/testhal/STM32F0xx/UART/.cproject
new file mode 100644
index 000000000..9dc8b7121
--- /dev/null
+++ b/testhal/STM32F0xx/UART/.cproject
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testhal/STM32F0xx/UART/.project b/testhal/STM32F0xx/UART/.project
new file mode 100644
index 000000000..d05252ac5
--- /dev/null
+++ b/testhal/STM32F0xx/UART/.project
@@ -0,0 +1,38 @@
+
+
+ STM32F0xx-UART
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
+
+ board
+ 2
+ CHIBIOS/boards/ST_STM32F0_DISCOVERY
+
+
+ os
+ 2
+ CHIBIOS/os
+
+
+