Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bsp/stm32/libraries/HAL_Drivers/drivers/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if GetDepend(['RT_USING_I2C']):
if GetDepend('BSP_USING_HARD_I2C1') or GetDepend('BSP_USING_HARD_I2C2') or GetDepend('BSP_USING_HARD_I2C3') or GetDepend('BSP_USING_HARD_I2C4'):
src += ['drv_hard_i2c.c']

if GetDepend(['BSP_USING_ETH', 'RT_USING_LWIP']):
if GetDepend(['BSP_USING_ETH', 'RT_USING_LWIP']) and not GetDepend(['SOC_STM32H750_ARTPI']):
src += ['drv_eth.c']

if GetDepend(['RT_USING_ADC']):
Expand Down
12 changes: 9 additions & 3 deletions bsp/stm32/libraries/STM32H7xx_HAL/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_lptim.c']

if GetDepend(['BSP_USING_ETH']) or GetDepend(['BSP_USING_ETH_H750']):
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth.c']
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth_ex.c']
if not GetDepend(['SOC_STM32H750_ARTPI']):
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth.c']
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth_ex.c']
else :
src += ['STM32H7xx_HAL_Driver/Src/Legacy/stm32h7xx_hal_eth.c']
src += ['STM32H7xx_HAL_Driver/Src/Legacy/stm32h7xx_hal_eth_ex.c']

if GetDepend(['RT_USING_ADC']):
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc.c']
Expand Down Expand Up @@ -109,7 +113,9 @@ if GetDepend(['BSP_USING_DCMI']):
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dcmi.c']

path = [cwd + '/STM32H7xx_HAL_Driver/Inc',
cwd + '/CMSIS/Device/ST/STM32H7xx/Include']
cwd + '/CMSIS/Device/ST/STM32H7xx/Include',
cwd + '/STM32H7xx_HAL_Driver/Inc/Legacy']


CPPDEFINES = ['USE_HAL_DRIVER']
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ typedef struct{
*/

/* Include ETH HAL Extension module */
#include "stm32h7xx_hal_eth_ex.h"
#include "stm32h7xx_hal_eth_ex_legacy.h"

/* Exported functions --------------------------------------------------------*/

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
scons.args: &scons
scons_arg:
- '--strict'

# ------ peripheral CI ------
peripheral.eth:
kconfig:
- CONFIG_BSP_USING_ETH_H750=y

Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
/* #define HAL_DAC_MODULE_ENABLED */
/* #define HAL_DCMI_MODULE_ENABLED */
/* #define HAL_DMA2D_MODULE_ENABLED */
#define HAL_ETH_MODULE_ENABLED
/* #define HAL_ETH_LEGACY_MODULE_ENABLED */
/* #define HAL_ETH_MODULE_ENABLED */
#define HAL_ETH_LEGACY_MODULE_ENABLED
/* #define HAL_NAND_MODULE_ENABLED */
/* #define HAL_NOR_MODULE_ENABLED */
/* #define HAL_OTFDEC_MODULE_ENABLED */
Expand Down Expand Up @@ -169,7 +169,7 @@
#define TICK_INT_PRIORITY (0UL) /*!< tick interrupt priority */
#define USE_RTOS 0
#define USE_SD_TRANSCEIVER 0U /*!< use uSD Transceiver */
#define USE_SPI_CRC 0U /*!< use CRC in SPI */
#define USE_SPI_CRC 0U /*!< use CRC in SPI */

#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
Expand Down
5 changes: 4 additions & 1 deletion bsp/stm32/stm32h750-artpi/board/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
menu "Hardware Drivers Config"

config SOC_STM32H750_ARTPI
bool
default y

menu "Board extended module"

menuconfig ART_PI_USING_MEDIA_IO
Expand Down
2 changes: 2 additions & 0 deletions bsp/stm32/stm32h750-artpi/board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ list = os.listdir(cwd)
# add the general drivers.
src = Glob('board.c')
src += Glob('CubeMX_Config/Core/Src/stm32h7xx_hal_msp.c')
if GetDepend(['BSP_SCB_ENABLE_I_CACHE']) or GetDepend(['BSP_SCB_ENABLE_D_CACHE']):
src += Glob('port/drv_mpu.c')

if GetDepend(['BSP_USING_QSPI_FLASH']):
src += Glob('port/drv_qspi_flash.c')
Expand Down
6 changes: 3 additions & 3 deletions bsp/stm32/stm32h750-artpi/board/port/drv_eth.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
* Copyright (c) 2006-2025 RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -117,7 +117,7 @@ static rt_err_t rt_stm32_eth_init(rt_device_t dev)
{
ETH_MACConfigTypeDef MACConf;
uint32_t regvalue = 0;
uint8_t status = RT_EOK;
rt_err_t status = RT_EOK;

__HAL_RCC_D2SRAM3_CLK_ENABLE();

Expand Down Expand Up @@ -357,7 +357,7 @@ struct pbuf *rt_stm32_eth_rx(rt_device_t dev)
{
for (q = p, l = 0; q != NULL; q = q->next)
{
memcpy((rt_uint8_t *)q->payload, (rt_uint8_t *)&RxBuff.buffer[l], q->len);
rt_memcpy((rt_uint8_t *)q->payload, (rt_uint8_t *)&RxBuff.buffer[l], q->len);
l = l + q->len;
}
}
Expand Down
2 changes: 1 addition & 1 deletion bsp/stm32/stm32h750-artpi/board/port/drv_eth.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
* Copyright (c) 2006-2025 RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
Expand Down
100 changes: 100 additions & 0 deletions bsp/stm32/stm32h750-artpi/board/port/drv_mpu.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*
* Copyright (c) 2006-2025 RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-04-14 whj4674672 first version
*/
#include <rtthread.h>
#include "stm32h7xx.h"
#include "board.h"
int mpu_init(void)
{
MPU_Region_InitTypeDef MPU_InitStruct;

/* Disable the MPU */
HAL_MPU_Disable();

/* Configure the MPU attributes as WT for AXI SRAM */
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.BaseAddress = 0x24000000;
MPU_InitStruct.Size = MPU_REGION_SIZE_512KB;
MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER0;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
MPU_InitStruct.SubRegionDisable = 0X00;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;

HAL_MPU_ConfigRegion(&MPU_InitStruct);

#ifdef BSP_USING_SDRAM
/* Configure the MPU attributes as WT for SDRAM */
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.BaseAddress = 0xC0000000;
MPU_InitStruct.Size = MPU_REGION_SIZE_32MB;
MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER1;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
MPU_InitStruct.SubRegionDisable = 0x00;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;

HAL_MPU_ConfigRegion(&MPU_InitStruct);
#endif

#ifdef BSP_USING_ETH_H750
/* Configure the MPU attributes as Device not cacheable
for ETH DMA descriptors and RX Buffers*/
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.BaseAddress = 0x30040000;
MPU_InitStruct.Size = MPU_REGION_SIZE_32KB;
MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER2;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;
MPU_InitStruct.SubRegionDisable = 0x00;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;

HAL_MPU_ConfigRegion(&MPU_InitStruct);
#endif

/* Configure the MPU attributes as WT for QSPI */
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.BaseAddress = 0x90000000;
MPU_InitStruct.Size = MPU_REGION_SIZE_8MB;
MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER3;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
MPU_InitStruct.SubRegionDisable = 0X00;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;

HAL_MPU_ConfigRegion(&MPU_InitStruct);

/* Enable the MPU */
HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);

/* Enable CACHE */
#ifdef BSP_SCB_ENABLE_I_CACHE
SCB_EnableICache();
#endif

#ifdef BSP_SCB_ENABLE_D_CACHE
SCB_EnableDCache();
#endif

return RT_EOK;

}
INIT_BOARD_EXPORT(mpu_init);