Skip to content

Commit 096ce41

Browse files
author
Mika Leppänen
committed
Disabled interrupts on smt32f7 and stm32h7 before calling disable data cache
Interrupts are disabled before calling disable data cache on Ethernet initialization.
1 parent ca5126e commit 096ce41

File tree

9 files changed

+27
-0
lines changed

9 files changed

+27
-0
lines changed

connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/stm32f7_eth_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#ifndef USE_USER_DEFINED_HAL_ETH_MSPINIT
3030

3131
#include "stm32f7xx_hal.h"
32+
#include "platform/mbed_critical.h"
3233

3334
/**
3435
* Override HAL Eth Init function
@@ -38,7 +39,9 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
3839
GPIO_InitTypeDef GPIO_InitStructure;
3940
if (heth->Instance == ETH) {
4041
/* Disable DCache for STM32F7 family */
42+
core_util_critical_section_enter();
4143
SCB_DisableDCache();
44+
core_util_critical_section_exit();
4245

4346
/* Enable GPIOs clocks */
4447
__HAL_RCC_GPIOA_CLK_ENABLE();

connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/stm32f7_eth_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#ifndef USE_USER_DEFINED_HAL_ETH_MSPINIT
3030

3131
#include "stm32f7xx_hal.h"
32+
#include "platform/mbed_critical.h"
3233

3334
/**
3435
* Override HAL Eth Init function
@@ -38,7 +39,9 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
3839
GPIO_InitTypeDef GPIO_InitStructure;
3940
if (heth->Instance == ETH) {
4041
/* Disable DCache for STM32F7 family */
42+
core_util_critical_section_enter();
4143
SCB_DisableDCache();
44+
core_util_critical_section_exit();
4245

4346
/* Enable GPIOs clocks */
4447
__HAL_RCC_GPIOA_CLK_ENABLE();

connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/stm32f7_eth_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#ifndef USE_USER_DEFINED_HAL_ETH_MSPINIT
3030

3131
#include "stm32f7xx_hal.h"
32+
#include "platform/mbed_critical.h"
3233

3334
/**
3435
* Override HAL Eth Init function
@@ -38,7 +39,9 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
3839
GPIO_InitTypeDef GPIO_InitStructure;
3940
if (heth->Instance == ETH) {
4041
/* Disable DCache for STM32F7 family */
42+
core_util_critical_section_enter();
4143
SCB_DisableDCache();
44+
core_util_critical_section_exit();
4245

4346
/* Enable GPIOs clocks */
4447
__HAL_RCC_GPIOA_CLK_ENABLE();

connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/stm32f7_eth_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#ifndef USE_USER_DEFINED_HAL_ETH_MSPINIT
3030

3131
#include "stm32f7xx_hal.h"
32+
#include "platform/mbed_critical.h"
3233

3334
/**
3435
* Override HAL Eth Init function
@@ -38,7 +39,9 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
3839
GPIO_InitTypeDef GPIO_InitStructure;
3940
if (heth->Instance == ETH) {
4041
/* Disable DCache for STM32F7 family */
42+
core_util_critical_section_enter();
4143
SCB_DisableDCache();
44+
core_util_critical_section_exit();
4245

4346
/* Enable GPIOs clocks */
4447
__HAL_RCC_GPIOA_CLK_ENABLE();

connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/stm32f7_eth_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#ifndef USE_USER_DEFINED_HAL_ETH_MSPINIT
3030

3131
#include "stm32f7xx_hal.h"
32+
#include "platform/mbed_critical.h"
3233

3334
/**
3435
* Override HAL Eth Init function
@@ -38,7 +39,9 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
3839
GPIO_InitTypeDef GPIO_InitStructure;
3940
if (heth->Instance == ETH) {
4041
/* Disable DCache for STM32F7 family */
42+
core_util_critical_section_enter();
4143
SCB_DisableDCache();
44+
core_util_critical_section_exit();
4245

4346
/* Enable GPIOs clocks */
4447
__HAL_RCC_GPIOA_CLK_ENABLE();

connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_DISCO_H747I/stm32h7_eth_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#ifndef USE_USER_DEFINED_HAL_ETH_MSPINIT
3737

3838
#include "stm32h7xx_hal.h"
39+
#include "platform/mbed_critical.h"
3940

4041
#define ETH_TX_EN_Pin GPIO_PIN_11
4142
#define ETH_TX_EN_GPIO_Port GPIOG
@@ -66,7 +67,9 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
6667
if (heth->Instance == ETH) {
6768
#if defined(CORE_CM7)
6869
/* Disable DCache for STM32H7 family */
70+
core_util_critical_section_enter();
6971
SCB_DisableDCache();
72+
core_util_critical_section_exit();
7073
#endif
7174

7275
/* GPIO Ports Clock Enable */

connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI/stm32h7_eth_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#ifndef USE_USER_DEFINED_HAL_ETH_MSPINIT
3030

3131
#include "stm32h7xx_hal.h"
32+
#include "platform/mbed_critical.h"
3233

3334
#define MCO_Pin GPIO_PIN_0
3435
#define MCO_GPIO_Port GPIOH
@@ -63,7 +64,9 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
6364
GPIO_InitTypeDef GPIO_InitStruct;
6465
if (heth->Instance == ETH) {
6566
/* Disable DCache for STM32H7 family */
67+
core_util_critical_section_enter();
6668
SCB_DisableDCache();
69+
core_util_critical_section_exit();
6770

6871
/* GPIO Ports Clock Enable */
6972
__HAL_RCC_GPIOH_CLK_ENABLE();

connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI2/stm32h7_eth_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#ifndef USE_USER_DEFINED_HAL_ETH_MSPINIT
3030

3131
#include "stm32h7xx_hal.h"
32+
#include "platform/mbed_critical.h"
3233

3334
#define MCO_Pin GPIO_PIN_0
3435
#define MCO_GPIO_Port GPIOH
@@ -63,7 +64,9 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
6364
GPIO_InitTypeDef GPIO_InitStruct;
6465
if (heth->Instance == ETH) {
6566
/* Disable DCache for STM32H7 family */
67+
core_util_critical_section_enter();
6668
SCB_DisableDCache();
69+
core_util_critical_section_exit();
6770

6871
/* GPIO Ports Clock Enable */
6972
__HAL_RCC_GPIOH_CLK_ENABLE();

connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_PORTENTA_H7/stm32h7_eth_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
#include "stm32h7xx_hal.h"
3737
#include "portenta_power.h"
38+
#include "platform/mbed_critical.h"
3839

3940
#define ETH_TX_EN_Pin GPIO_PIN_11
4041
#define ETH_TX_EN_GPIO_Port GPIOG
@@ -66,7 +67,9 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
6667

6768
#if !(defined(DUAL_CORE) && defined(CORE_CM4))
6869
/* Disable DCache for STM32H7 family */
70+
core_util_critical_section_enter();
6971
SCB_DisableDCache();
72+
core_util_critical_section_exit();
7073
#endif
7174

7275
/* GPIO Ports Clock Enable */

0 commit comments

Comments
 (0)