Skip to content

Commit 2e72c9e

Browse files
Merge branch 'master' into bsp-stm32f407-micu_add_some_new_features
2 parents e27bd2a + 916b212 commit 2e72c9e

File tree

5 files changed

+88
-7
lines changed

5 files changed

+88
-7
lines changed

bsp/nxp/mcx/mcxa/Libraries/drivers/drv_pwm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#define BOARD_PWM_BASEADDR (FLEXPWM0)
1818
#define PWM_SRC_CLK_FREQ (CLOCK_GetFreq(kCLOCK_BusClk))
19-
#define FLEX_PWM_CLOCK_DEVIDER (kPWM_Prescale_Divide_2)
19+
#define FLEX_PWM_CLOCK_DEVIDER (kPWM_Prescale_Divide_32)
2020
#define FLEX_PWM_FAULT_LEVEL true
2121

2222
typedef struct

bsp/stm32/stm32f407-micu/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
/* #define HAL_IWDG_MODULE_ENABLED */
5959
/* #define HAL_LTDC_MODULE_ENABLED */
6060
/* #define HAL_RNG_MODULE_ENABLED */
61-
/* #define HAL_RTC_MODULE_ENABLED */
61+
#define HAL_RTC_MODULE_ENABLED
6262
/* #define HAL_SAI_MODULE_ENABLED */
63-
/* #define HAL_SD_MODULE_ENABLED */
63+
#define HAL_SD_MODULE_ENABLED
6464
/* #define HAL_MMC_MODULE_ENABLED */
6565
#define HAL_SPI_MODULE_ENABLED
6666
#define HAL_TIM_MODULE_ENABLED

bsp/stm32/stm32f407-micu/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,90 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
459459

460460
}
461461

462+
/**
463+
* @brief SD MSP Initialization
464+
* This function configures the hardware resources used in this example
465+
* @param hsd: SD handle pointer
466+
* @retval None
467+
*/
468+
void HAL_SD_MspInit(SD_HandleTypeDef* hsd)
469+
{
470+
GPIO_InitTypeDef GPIO_InitStruct = {0};
471+
if(hsd->Instance==SDIO)
472+
{
473+
/* USER CODE BEGIN SDIO_MspInit 0 */
474+
475+
/* USER CODE END SDIO_MspInit 0 */
476+
/* Peripheral clock enable */
477+
__HAL_RCC_SDIO_CLK_ENABLE();
478+
479+
__HAL_RCC_GPIOC_CLK_ENABLE();
480+
__HAL_RCC_GPIOD_CLK_ENABLE();
481+
/**SDIO GPIO Configuration
482+
PC8 ------> SDIO_D0
483+
PC9 ------> SDIO_D1
484+
PC10 ------> SDIO_D2
485+
PC11 ------> SDIO_D3
486+
PC12 ------> SDIO_CK
487+
PD2 ------> SDIO_CMD
488+
*/
489+
GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
490+
|GPIO_PIN_12;
491+
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
492+
GPIO_InitStruct.Pull = GPIO_NOPULL;
493+
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
494+
GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
495+
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
496+
497+
GPIO_InitStruct.Pin = GPIO_PIN_2;
498+
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
499+
GPIO_InitStruct.Pull = GPIO_NOPULL;
500+
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
501+
GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
502+
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
503+
504+
/* USER CODE BEGIN SDIO_MspInit 1 */
505+
506+
/* USER CODE END SDIO_MspInit 1 */
507+
}
508+
509+
}
510+
511+
/**
512+
* @brief SD MSP De-Initialization
513+
* This function de-initializes the hardware resources used in this example
514+
* @param hsd: SD handle pointer
515+
* @retval None
516+
*/
517+
void HAL_SD_MspDeInit(SD_HandleTypeDef* hsd)
518+
{
519+
if(hsd->Instance==SDIO)
520+
{
521+
/* USER CODE BEGIN SDIO_MspDeInit 0 */
522+
523+
/* USER CODE END SDIO_MspDeInit 0 */
524+
/* Peripheral clock disable */
525+
__HAL_RCC_SDIO_CLK_DISABLE();
526+
527+
/**SDIO GPIO Configuration
528+
PC8 ------> SDIO_D0
529+
PC9 ------> SDIO_D1
530+
PC10 ------> SDIO_D2
531+
PC11 ------> SDIO_D3
532+
PC12 ------> SDIO_CK
533+
PD2 ------> SDIO_CMD
534+
*/
535+
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
536+
|GPIO_PIN_12);
537+
538+
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_2);
539+
540+
/* USER CODE BEGIN SDIO_MspDeInit 1 */
541+
542+
/* USER CODE END SDIO_MspDeInit 1 */
543+
}
544+
545+
}
462546
/* USER CODE BEGIN 1 */
463547

464548
/* USER CODE END 1 */

bsp/stm32/stm32f407-micu/board/Kconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ menu "On-chip Peripheral Drivers"
8888
select BSP_SPI2_TX_USING_DMA
8989
default n
9090
endif
91-
<<<<<<< HEAD
92-
=======
9391

9492
config BSP_USING_SDIO
9593
bool "Enable SDIO"
@@ -222,7 +220,6 @@ menu "On-chip Peripheral Drivers"
222220
default n
223221
endif
224222
endif
225-
>>>>>>> 69a5eaa3df (add i2c,timer,pwm support for bsp:stm32f407-micu)
226223
source "$(BSP_DIR)/../libraries/HAL_Drivers/drivers/Kconfig"
227224

228225
endmenu

components/dfs/dfs_v2/filesystems/tmpfs/dfs_tmpfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ static ssize_t dfs_tmpfs_write(struct dfs_file *file, const void *buf, size_t co
358358
rt_mutex_take(&file->vnode->lock, RT_WAITING_FOREVER);
359359

360360
count = _dfs_tmpfs_write(d_file, buf, count, pos);
361-
361+
file->vnode->size = d_file->size;
362362
rt_mutex_release(&file->vnode->lock);
363363

364364
return count;

0 commit comments

Comments
 (0)