diff --git a/demos/STM32/RT-STM32L053-DISCOVERY/cfg/mcuconf.h b/demos/STM32/RT-STM32L053-DISCOVERY/cfg/mcuconf.h index 92cbe8366..6a8821556 100644 --- a/demos/STM32/RT-STM32L053-DISCOVERY/cfg/mcuconf.h +++ b/demos/STM32/RT-STM32L053-DISCOVERY/cfg/mcuconf.h @@ -125,16 +125,21 @@ */ #define STM32_I2C_USE_I2C1 FALSE #define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_USE_I2C3 FALSE #define STM32_I2C_BUSY_TIMEOUT 50 #define STM32_I2C_I2C1_IRQ_PRIORITY 3 #define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_I2C3_IRQ_PRIORITY 3 #define STM32_I2C_USE_DMA TRUE #define STM32_I2C_I2C1_DMA_PRIORITY 1 #define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_I2C3_DMA_PRIORITY 1 #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) +#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") /* diff --git a/demos/STM32/RT-STM32L053R8-NUCLEO64/cfg/mcuconf.h b/demos/STM32/RT-STM32L053R8-NUCLEO64/cfg/mcuconf.h index 474fb1388..898940a6f 100644 --- a/demos/STM32/RT-STM32L053R8-NUCLEO64/cfg/mcuconf.h +++ b/demos/STM32/RT-STM32L053R8-NUCLEO64/cfg/mcuconf.h @@ -125,16 +125,21 @@ */ #define STM32_I2C_USE_I2C1 FALSE #define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_USE_I2C3 FALSE #define STM32_I2C_BUSY_TIMEOUT 50 #define STM32_I2C_I2C1_IRQ_PRIORITY 3 #define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_I2C3_IRQ_PRIORITY 3 #define STM32_I2C_USE_DMA TRUE #define STM32_I2C_I2C1_DMA_PRIORITY 1 #define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_I2C3_DMA_PRIORITY 1 #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) +#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") /* diff --git a/os/hal/ports/STM32/STM32L0xx/stm32_registry.h b/os/hal/ports/STM32/STM32L0xx/stm32_registry.h index 3ac41a1fd..1dc62b2d5 100644 --- a/os/hal/ports/STM32/STM32L0xx/stm32_registry.h +++ b/os/hal/ports/STM32/STM32L0xx/stm32_registry.h @@ -852,10 +852,10 @@ #define STM32_HAS_I2C3 TRUE #define STM32_I2C3_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\ STM32_DMA_STREAM_ID_MSK(1, 5)) -#define STM32_I2C3_RX_DMA_CHN 0x00E0E000 -#define STM32_I2C3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\ - STM32_DMA_STREAM_ID_MSK(1, 6)) -#define STM32_I2C3_TX_DMA_CHN 0x0E0E0000 +#define STM32_I2C3_RX_DMA_CHN 0x000E0E00 +#define STM32_I2C3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\ + STM32_DMA_STREAM_ID_MSK(1, 4)) +#define STM32_I2C3_TX_DMA_CHN 0x0000E0E0 /* SDIO attributes.*/ #define STM32_HAS_SDIO FALSE @@ -1070,10 +1070,10 @@ #define STM32_HAS_I2C3 TRUE #define STM32_I2C3_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\ STM32_DMA_STREAM_ID_MSK(1, 5)) -#define STM32_I2C3_RX_DMA_CHN 0x00E0E000 -#define STM32_I2C3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\ - STM32_DMA_STREAM_ID_MSK(1, 6)) -#define STM32_I2C3_TX_DMA_CHN 0x0E0E0000 +#define STM32_I2C3_RX_DMA_CHN 0x000E0E00 +#define STM32_I2C3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\ + STM32_DMA_STREAM_ID_MSK(1, 4)) +#define STM32_I2C3_TX_DMA_CHN 0x0000E0E0 /* SDIO attributes.*/ #define STM32_HAS_SDIO FALSE diff --git a/readme.txt b/readme.txt index b080795bd..0ca326f3d 100644 --- a/readme.txt +++ b/readme.txt @@ -131,6 +131,8 @@ - NEW: Increased stacks size in RT test suite from 128 to 192. added an option to override the stack size by defining THREADS_STACK_SIZE in the makefile. +- FIX: Fixed wrong DMA definitions for STM32L0xx I2C3 peripheral (bug #1245) + (backported to 20.3.5)(backported to 21.11.3). - FIX: Fixed wrong path in STM32L053 ADC demo makefile (bug #1244) (backported to 20.3.5)(backported to 21.11.3). - FIX: Fixed missing semicolon in STM32 OTGv1 driver (bug #1243) diff --git a/testhal/STM32/multi/ADC/cfg/stm32l053r8_nucleo64/mcuconf.h b/testhal/STM32/multi/ADC/cfg/stm32l053r8_nucleo64/mcuconf.h index 47f98d9d7..1363a6ea1 100644 --- a/testhal/STM32/multi/ADC/cfg/stm32l053r8_nucleo64/mcuconf.h +++ b/testhal/STM32/multi/ADC/cfg/stm32l053r8_nucleo64/mcuconf.h @@ -125,16 +125,21 @@ */ #define STM32_I2C_USE_I2C1 FALSE #define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_USE_I2C3 FALSE #define STM32_I2C_BUSY_TIMEOUT 50 #define STM32_I2C_I2C1_IRQ_PRIORITY 3 #define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_I2C3_IRQ_PRIORITY 3 #define STM32_I2C_USE_DMA TRUE #define STM32_I2C_I2C1_DMA_PRIORITY 1 #define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_I2C3_DMA_PRIORITY 1 #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) +#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") /* diff --git a/testhal/STM32/multi/PAL/cfg/stm32l053_discovery/mcuconf.h b/testhal/STM32/multi/PAL/cfg/stm32l053_discovery/mcuconf.h index f08d02ba1..19a0abbd4 100644 --- a/testhal/STM32/multi/PAL/cfg/stm32l053_discovery/mcuconf.h +++ b/testhal/STM32/multi/PAL/cfg/stm32l053_discovery/mcuconf.h @@ -125,16 +125,21 @@ */ #define STM32_I2C_USE_I2C1 FALSE #define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_USE_I2C3 FALSE #define STM32_I2C_BUSY_TIMEOUT 50 #define STM32_I2C_I2C1_IRQ_PRIORITY 3 #define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_I2C3_IRQ_PRIORITY 3 #define STM32_I2C_USE_DMA TRUE #define STM32_I2C_I2C1_DMA_PRIORITY 1 #define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_I2C3_DMA_PRIORITY 1 #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) +#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") /* diff --git a/testhal/STM32/multi/RTC/cfg/stm32l053_discovery/mcuconf.h b/testhal/STM32/multi/RTC/cfg/stm32l053_discovery/mcuconf.h index f08d02ba1..19a0abbd4 100644 --- a/testhal/STM32/multi/RTC/cfg/stm32l053_discovery/mcuconf.h +++ b/testhal/STM32/multi/RTC/cfg/stm32l053_discovery/mcuconf.h @@ -125,16 +125,21 @@ */ #define STM32_I2C_USE_I2C1 FALSE #define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_USE_I2C3 FALSE #define STM32_I2C_BUSY_TIMEOUT 50 #define STM32_I2C_I2C1_IRQ_PRIORITY 3 #define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_I2C3_IRQ_PRIORITY 3 #define STM32_I2C_USE_DMA TRUE #define STM32_I2C_I2C1_DMA_PRIORITY 1 #define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_I2C3_DMA_PRIORITY 1 #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) +#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") /* diff --git a/testhal/STM32/multi/SPI/cfg/stm32l053r8_nucleo64/mcuconf.h b/testhal/STM32/multi/SPI/cfg/stm32l053r8_nucleo64/mcuconf.h index 292a4741f..d907124a6 100644 --- a/testhal/STM32/multi/SPI/cfg/stm32l053r8_nucleo64/mcuconf.h +++ b/testhal/STM32/multi/SPI/cfg/stm32l053r8_nucleo64/mcuconf.h @@ -125,16 +125,21 @@ */ #define STM32_I2C_USE_I2C1 FALSE #define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_USE_I2C3 FALSE #define STM32_I2C_BUSY_TIMEOUT 50 #define STM32_I2C_I2C1_IRQ_PRIORITY 3 #define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_I2C3_IRQ_PRIORITY 3 #define STM32_I2C_USE_DMA TRUE #define STM32_I2C_I2C1_DMA_PRIORITY 1 #define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_I2C3_DMA_PRIORITY 1 #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) +#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") /* diff --git a/tools/ftl/processors/conf/mcuconf_stm32l05xxx/mcuconf.h.ftl b/tools/ftl/processors/conf/mcuconf_stm32l05xxx/mcuconf.h.ftl index d209fd500..4726ccdcf 100644 --- a/tools/ftl/processors/conf/mcuconf_stm32l05xxx/mcuconf.h.ftl +++ b/tools/ftl/processors/conf/mcuconf_stm32l05xxx/mcuconf.h.ftl @@ -136,16 +136,21 @@ */ #define STM32_I2C_USE_I2C1 ${doc.STM32_I2C_USE_I2C1!"FALSE"} #define STM32_I2C_USE_I2C2 ${doc.STM32_I2C_USE_I2C2!"FALSE"} +#define STM32_I2C_USE_I2C3 ${doc.STM32_I2C_USE_I2C3!"FALSE"} #define STM32_I2C_BUSY_TIMEOUT ${doc.STM32_I2C_BUSY_TIMEOUT!"50"} #define STM32_I2C_I2C1_IRQ_PRIORITY ${doc.STM32_I2C_I2C1_IRQ_PRIORITY!"3"} #define STM32_I2C_I2C2_IRQ_PRIORITY ${doc.STM32_I2C_I2C2_IRQ_PRIORITY!"3"} +#define STM32_I2C_I2C3_IRQ_PRIORITY ${doc.STM32_I2C_I2C3_IRQ_PRIORITY!"3"} #define STM32_I2C_USE_DMA ${doc.STM32_I2C_USE_DMA!"TRUE"} #define STM32_I2C_I2C1_DMA_PRIORITY ${doc.STM32_I2C_I2C1_DMA_PRIORITY!"1"} #define STM32_I2C_I2C2_DMA_PRIORITY ${doc.STM32_I2C_I2C2_DMA_PRIORITY!"1"} +#define STM32_I2C_I2C3_DMA_PRIORITY ${doc.STM32_I2C_I2C3_DMA_PRIORITY!"1"} #define STM32_I2C_I2C1_RX_DMA_STREAM ${doc.STM32_I2C_I2C1_RX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 7)"} -#define STM32_I2C_I2C1_TX_DMA_STREAM ${doc.STM32_I2C_I2C1_TX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 2)"} +#define STM32_I2C_I2C1_TX_DMA_STREAM ${doc.STM32_I2C_I2C1_TX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 6)"} #define STM32_I2C_I2C2_RX_DMA_STREAM ${doc.STM32_I2C_I2C2_RX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 5)"} #define STM32_I2C_I2C2_TX_DMA_STREAM ${doc.STM32_I2C_I2C2_TX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 4)"} +#define STM32_I2C_I2C3_RX_DMA_STREAM ${doc.STM32_I2C_I2C3_RX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 3)"} +#define STM32_I2C_I2C3_TX_DMA_STREAM ${doc.STM32_I2C_I2C3_TX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 2)"} #define STM32_I2C_DMA_ERROR_HOOK(i2cp) ${doc.STM32_I2C_DMA_ERROR_HOOK!"osalSysHalt(\"DMA failure\")"} /* diff --git a/tools/ftl/processors/conf/mcuconf_stm32l07xxx/mcuconf.h.ftl b/tools/ftl/processors/conf/mcuconf_stm32l07xxx/mcuconf.h.ftl index 27af11620..5c0c42df0 100644 --- a/tools/ftl/processors/conf/mcuconf_stm32l07xxx/mcuconf.h.ftl +++ b/tools/ftl/processors/conf/mcuconf_stm32l07xxx/mcuconf.h.ftl @@ -155,11 +155,11 @@ #define STM32_I2C_I2C2_DMA_PRIORITY ${doc.STM32_I2C_I2C2_DMA_PRIORITY!"1"} #define STM32_I2C_I2C3_DMA_PRIORITY ${doc.STM32_I2C_I2C3_DMA_PRIORITY!"1"} #define STM32_I2C_I2C1_RX_DMA_STREAM ${doc.STM32_I2C_I2C1_RX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 7)"} -#define STM32_I2C_I2C1_TX_DMA_STREAM ${doc.STM32_I2C_I2C1_TX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 2)"} +#define STM32_I2C_I2C1_TX_DMA_STREAM ${doc.STM32_I2C_I2C1_TX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 6)"} #define STM32_I2C_I2C2_RX_DMA_STREAM ${doc.STM32_I2C_I2C2_RX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 5)"} #define STM32_I2C_I2C2_TX_DMA_STREAM ${doc.STM32_I2C_I2C2_TX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 4)"} #define STM32_I2C_I2C3_RX_DMA_STREAM ${doc.STM32_I2C_I2C3_RX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 3)"} -#define STM32_I2C_I2C3_TX_DMA_STREAM ${doc.STM32_I2C_I2C3_TX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 6)"} +#define STM32_I2C_I2C3_TX_DMA_STREAM ${doc.STM32_I2C_I2C3_TX_DMA_STREAM!"STM32_DMA_STREAM_ID(1, 2)"} #define STM32_I2C_DMA_ERROR_HOOK(i2cp) ${doc.STM32_I2C_DMA_ERROR_HOOK!"osalSysHalt(\"DMA failure\")"} /*