Skip to content

Commit 27a8ff8

Browse files
committed
完善ART-PI BSP
1 parent 173913b commit 27a8ff8

File tree

26 files changed

+4129
-116
lines changed

26 files changed

+4129
-116
lines changed

bsp/stm32/libraries/HAL_Drivers/drv_sdram.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static struct rt_memheap system_heap;
2424
#endif
2525

2626
/**
27-
* @brief Perform the SDRAM exernal memory inialization sequence
27+
* @brief
2828
* @param hsdram: SDRAM handle
2929
* @param Command: Pointer to SDRAM command structure
3030
* @retval None
@@ -51,7 +51,7 @@ static void SDRAM_Initialization_Sequence(SDRAM_HandleTypeDef *hsdram, FMC_SDRAM
5151

5252
/* Insert 100 ms delay */
5353
/* interrupt is not enable, just to delay some time. */
54-
for (tmpmrd = 0; tmpmrd < 0xffffff; tmpmrd ++)
54+
for (tmpmrd = 0; tmpmrd < 0xffff; tmpmrd ++)
5555
;
5656

5757
/* Configure a PALL (precharge all) command */

bsp/stm32/libraries/STM32H7xx_HAL/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
5656
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c']
5757
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_lptim.c']
5858

59-
if GetDepend(['BSP_USING_ETH']):
59+
if GetDepend(['BSP_USING_ETH']) or GetDepend(['BSP_USING_ETH_H750']):
6060
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth.c']
6161
src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_eth_ex.c']
6262

bsp/stm32/stm32h750-artpi-h750/applications/main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@
1515
/* defined the LED0 pin: PI8 */
1616
#define LED0_PIN GET_PIN(I, 8)
1717

18+
#ifdef RT_USING_WIFI
19+
extern void wlan_autoconnect_init(void);
20+
#endif
21+
1822
int main(void)
1923
{
2024
/* set LED0 pin mode to output */
2125
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
26+
#ifdef RT_USING_WIFI
27+
/* init Wi-Fi auto connect feature */
28+
wlan_autoconnect_init();
29+
/* enable auto reconnect on WLAN device */
30+
rt_wlan_config_autoreconnect(RT_TRUE);
31+
#endif
2232

2333
while (1)
2434
{

bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/Core/Inc/main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern "C" {
5151
/* USER CODE END EM */
5252

5353
/* Exported functions prototypes ---------------------------------------------*/
54-
54+
void Error_Handler(void);
5555

5656
/* USER CODE BEGIN EFP */
5757

bsp/stm32/stm32h750-artpi-h750/board/CubeMX_Config/Core/Inc/stm32h7xx_hal_conf.h

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@
4545
/* #define HAL_DAC_MODULE_ENABLED */
4646
/* #define HAL_DCMI_MODULE_ENABLED */
4747
/* #define HAL_DMA2D_MODULE_ENABLED */
48-
/* #define HAL_ETH_MODULE_ENABLED */
48+
#define HAL_ETH_MODULE_ENABLED
4949
/* #define HAL_NAND_MODULE_ENABLED */
5050
/* #define HAL_NOR_MODULE_ENABLED */
5151
/* #define HAL_OTFDEC_MODULE_ENABLED */
5252
/* #define HAL_SRAM_MODULE_ENABLED */
53-
/* #define HAL_SDRAM_MODULE_ENABLED */
53+
#define HAL_SDRAM_MODULE_ENABLED
5454
/* #define HAL_HASH_MODULE_ENABLED */
5555
/* #define HAL_HRTIM_MODULE_ENABLED */
5656
/* #define HAL_HSEM_MODULE_ENABLED */
@@ -61,25 +61,25 @@
6161
/* #define HAL_OSPI_MODULE_ENABLED */
6262
/* #define HAL_I2S_MODULE_ENABLED */
6363
/* #define HAL_SMBUS_MODULE_ENABLED */
64-
/* #define HAL_IWDG_MODULE_ENABLED */
64+
#define HAL_IWDG_MODULE_ENABLED
6565
/* #define HAL_LPTIM_MODULE_ENABLED */
66-
/* #define HAL_LTDC_MODULE_ENABLED */
66+
#define HAL_LTDC_MODULE_ENABLED
6767
/* #define HAL_QSPI_MODULE_ENABLED */
6868
/* #define HAL_RNG_MODULE_ENABLED */
6969
/* #define HAL_RTC_MODULE_ENABLED */
7070
/* #define HAL_SAI_MODULE_ENABLED */
71-
/* #define HAL_SD_MODULE_ENABLED */
71+
#define HAL_SD_MODULE_ENABLED
7272
/* #define HAL_MMC_MODULE_ENABLED */
7373
/* #define HAL_SPDIFRX_MODULE_ENABLED */
74-
/* #define HAL_SPI_MODULE_ENABLED */
74+
#define HAL_SPI_MODULE_ENABLED
7575
/* #define HAL_SWPMI_MODULE_ENABLED */
7676
/* #define HAL_TIM_MODULE_ENABLED */
7777
#define HAL_UART_MODULE_ENABLED
7878
/* #define HAL_USART_MODULE_ENABLED */
7979
/* #define HAL_IRDA_MODULE_ENABLED */
8080
/* #define HAL_SMARTCARD_MODULE_ENABLED */
8181
/* #define HAL_WWDG_MODULE_ENABLED */
82-
/* #define HAL_PCD_MODULE_ENABLED */
82+
#define HAL_PCD_MODULE_ENABLED
8383
/* #define HAL_HCD_MODULE_ENABLED */
8484
/* #define HAL_DFSDM_MODULE_ENABLED */
8585
/* #define HAL_DSI_MODULE_ENABLED */
@@ -105,19 +105,19 @@
105105
* (when HSE is used as system clock source, directly or through the PLL).
106106
*/
107107
#if !defined (HSE_VALUE)
108-
#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz : FPGA case fixed to 60MHZ */
108+
#define HSE_VALUE (25000000UL) /*!< Value of the External oscillator in Hz : FPGA case fixed to 60MHZ */
109109
#endif /* HSE_VALUE */
110110

111111
#if !defined (HSE_STARTUP_TIMEOUT)
112-
#define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */
112+
#define HSE_STARTUP_TIMEOUT (100UL) /*!< Time out for HSE start up, in ms */
113113
#endif /* HSE_STARTUP_TIMEOUT */
114114

115115
/**
116116
* @brief Internal oscillator (CSI) default value.
117117
* This value is the default CSI value after Reset.
118118
*/
119119
#if !defined (CSI_VALUE)
120-
#define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/
120+
#define CSI_VALUE (4000000UL) /*!< Value of the Internal oscillator in Hz*/
121121
#endif /* CSI_VALUE */
122122

123123
/**
@@ -126,19 +126,19 @@
126126
* (when HSI is used as system clock source, directly or through the PLL).
127127
*/
128128
#if !defined (HSI_VALUE)
129-
#define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/
129+
#define HSI_VALUE (64000000UL) /*!< Value of the Internal oscillator in Hz*/
130130
#endif /* HSI_VALUE */
131131

132132
/**
133133
* @brief External Low Speed oscillator (LSE) value.
134134
* This value is used by the UART, RTC HAL module to compute the system frequency
135135
*/
136136
#if !defined (LSE_VALUE)
137-
#define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/
137+
#define LSE_VALUE (32768UL) /*!< Value of the External oscillator in Hz*/
138138
#endif /* LSE_VALUE */
139139

140140
#if !defined (LSE_STARTUP_TIMEOUT)
141-
#define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
141+
#define LSE_STARTUP_TIMEOUT (5000UL) /*!< Time out for LSE start up, in ms */
142142
#endif /* LSE_STARTUP_TIMEOUT */
143143

144144
#if !defined (LSI_VALUE)
@@ -153,7 +153,7 @@
153153
* frequency, this source is inserted directly through I2S_CKIN pad.
154154
*/
155155
#if !defined (EXTERNAL_CLOCK_VALUE)
156-
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/
156+
#define EXTERNAL_CLOCK_VALUE 12288000UL /*!< Value of the External clock in Hz*/
157157
#endif /* EXTERNAL_CLOCK_VALUE */
158158

159159
/* Tip: To avoid modifying this file each time you need to use different HSE,
@@ -163,9 +163,9 @@
163163
/**
164164
* @brief This is the HAL system configuration section
165165
*/
166-
#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
167-
#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */
168-
#define USE_RTOS 0U
166+
#define VDD_VALUE (3300UL) /*!< Value of VDD in mv */
167+
#define TICK_INT_PRIORITY (0UL) /*!< tick interrupt priority */
168+
#define USE_RTOS 0
169169
#define USE_SD_TRANSCEIVER 0U /*!< use uSD Transceiver */
170170
#define USE_SPI_CRC 0U /*!< use CRC in SPI */
171171

@@ -222,12 +222,12 @@
222222
#define ETH_TX_DESC_CNT 4 /* number of Ethernet Tx DMA descriptors */
223223
#define ETH_RX_DESC_CNT 4 /* number of Ethernet Rx DMA descriptors */
224224

225-
#define ETH_MAC_ADDR0 ((uint8_t)0x02)
226-
#define ETH_MAC_ADDR1 ((uint8_t)0x00)
227-
#define ETH_MAC_ADDR2 ((uint8_t)0x00)
228-
#define ETH_MAC_ADDR3 ((uint8_t)0x00)
229-
#define ETH_MAC_ADDR4 ((uint8_t)0x00)
230-
#define ETH_MAC_ADDR5 ((uint8_t)0x00)
225+
#define ETH_MAC_ADDR0 (0x02UL)
226+
#define ETH_MAC_ADDR1 (0x00UL)
227+
#define ETH_MAC_ADDR2 (0x00UL)
228+
#define ETH_MAC_ADDR3 (0x00UL)
229+
#define ETH_MAC_ADDR4 (0x00UL)
230+
#define ETH_MAC_ADDR5 (0x00UL)
231231

232232
/* ########################## Assert Selection ############################## */
233233
/**
@@ -277,6 +277,10 @@
277277
#include "stm32h7xx_hal_dfsdm.h"
278278
#endif /* HAL_DFSDM_MODULE_ENABLED */
279279

280+
#ifdef HAL_DTS_MODULE_ENABLED
281+
#include "stm32h7xx_hal_dts.h"
282+
#endif /* HAL_DTS_MODULE_ENABLED */
283+
280284
#ifdef HAL_ETH_MODULE_ENABLED
281285
#include "stm32h7xx_hal_eth.h"
282286
#endif /* HAL_ETH_MODULE_ENABLED */
@@ -306,7 +310,7 @@
306310
#endif /* HAL_COMP_MODULE_ENABLED */
307311

308312
#ifdef HAL_CORDIC_MODULE_ENABLED
309-
#include "stm32h7xx_hal_cordic.h"
313+
#include "stm32h7xx_hal_cordic.h"
310314
#endif /* HAL_CORDIC_MODULE_ENABLED */
311315

312316
#ifdef HAL_CRC_MODULE_ENABLED
@@ -325,14 +329,14 @@
325329
#include "stm32h7xx_hal_flash.h"
326330
#endif /* HAL_FLASH_MODULE_ENABLED */
327331

328-
#ifdef HAL_FMAC_MODULE_ENABLED
329-
#include "stm32h7xx_hal_fmac.h"
330-
#endif /* HAL_FMAC_MODULE_ENABLED */
331-
332332
#ifdef HAL_GFXMMU_MODULE_ENABLED
333333
#include "stm32h7xx_hal_gfxmmu.h"
334334
#endif /* HAL_GFXMMU_MODULE_ENABLED */
335335

336+
#ifdef HAL_FMAC_MODULE_ENABLED
337+
#include "stm32h7xx_hal_fmac.h"
338+
#endif /* HAL_FMAC_MODULE_ENABLED */
339+
336340
#ifdef HAL_HRTIM_MODULE_ENABLED
337341
#include "stm32h7xx_hal_hrtim.h"
338342
#endif /* HAL_HRTIM_MODULE_ENABLED */
@@ -390,13 +394,17 @@
390394
#endif /* HAL_OPAMP_MODULE_ENABLED */
391395

392396
#ifdef HAL_OSPI_MODULE_ENABLED
393-
#include "stm32h7xx_hal_ospi.h"
397+
#include "stm32h7xx_hal_ospi.h"
394398
#endif /* HAL_OSPI_MODULE_ENABLED */
395399

396400
#ifdef HAL_OTFDEC_MODULE_ENABLED
397401
#include "stm32h7xx_hal_otfdec.h"
398402
#endif /* HAL_OTFDEC_MODULE_ENABLED */
399403

404+
#ifdef HAL_PSSI_MODULE_ENABLED
405+
#include "stm32h7xx_hal_pssi.h"
406+
#endif /* HAL_PSSI_MODULE_ENABLED */
407+
400408
#ifdef HAL_PWR_MODULE_ENABLED
401409
#include "stm32h7xx_hal_pwr.h"
402410
#endif /* HAL_PWR_MODULE_ENABLED */
@@ -407,7 +415,7 @@
407415

408416
#ifdef HAL_RAMECC_MODULE_ENABLED
409417
#include "stm32h7xx_hal_ramecc.h"
410-
#endif /* HAL_HCD_MODULE_ENABLED */
418+
#endif /* HAL_RAMECC_MODULE_ENABLED */
411419

412420
#ifdef HAL_RNG_MODULE_ENABLED
413421
#include "stm32h7xx_hal_rng.h"
@@ -477,14 +485,6 @@
477485
#include "stm32h7xx_hal_hcd.h"
478486
#endif /* HAL_HCD_MODULE_ENABLED */
479487

480-
#ifdef HAL_PSSI_MODULE_ENABLED
481-
#include "stm32h7xx_hal_pssi.h"
482-
#endif /* HAL_PSSI_MODULE_ENABLED */
483-
484-
#ifdef HAL_DTS_MODULE_ENABLED
485-
#include "stm32h7xx_hal_dts.h"
486-
#endif /* HAL_DTS_MODULE_ENABLED */
487-
488488
/* Exported macro ------------------------------------------------------------*/
489489
#ifdef USE_FULL_ASSERT
490490
/**
@@ -497,7 +497,7 @@
497497
*/
498498
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
499499
/* Exported functions ------------------------------------------------------- */
500-
void assert_failed(uint8_t* file, uint32_t line);
500+
void assert_failed(uint8_t *file, uint32_t line);
501501
#else
502502
#define assert_param(expr) ((void)0U)
503503
#endif /* USE_FULL_ASSERT */
@@ -506,6 +506,6 @@
506506
}
507507
#endif
508508

509-
#endif /* __STM32H7xx_HAL_CONF_H */
509+
#endif /* STM32H7xx_HAL_CONF_H */
510510

511511
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)