Ignore:
Timestamp:
Dec 10, 2024, 11:42:57 AM (5 weeks ago)
Author:
Zed
Message:

SDMMC(DMA) and Azure_RTOS(with FileX) are activated.

Location:
ctrl/firmware/Main/CubeMX/Core
Files:
6 added
6 edited

Legend:

Unmodified
Added
Removed
  • ctrl/firmware/Main/CubeMX/Core/Inc/main.h

    r50 r54  
    7070#define RST_DISPLAY_Pin GPIO_PIN_15
    7171#define RST_DISPLAY_GPIO_Port GPIOE
     72#define SD_DETECT_Pin GPIO_PIN_8
     73#define SD_DETECT_GPIO_Port GPIOA
    7274#define OUTPUT_ON_LED_Pin GPIO_PIN_7
    7375#define OUTPUT_ON_LED_GPIO_Port GPIOD
  • ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_hal_conf.h

    r51 r54  
    7575#define HAL_SPI_MODULE_ENABLED
    7676/* #define HAL_SWPMI_MODULE_ENABLED   */
    77 /* #define HAL_TIM_MODULE_ENABLED   */
     77#define HAL_TIM_MODULE_ENABLED
    7878/* #define HAL_UART_MODULE_ENABLED   */
    7979/* #define HAL_USART_MODULE_ENABLED   */
  • ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_it.h

    r51 r54  
    5252void BusFault_Handler(void);
    5353void UsageFault_Handler(void);
    54 void SVC_Handler(void);
    5554void DebugMon_Handler(void);
    56 void PendSV_Handler(void);
    57 void SysTick_Handler(void);
    5855void DMA1_Stream0_IRQHandler(void);
    5956void SDMMC1_IRQHandler(void);
     57void TIM7_IRQHandler(void);
    6058void SPI4_IRQHandler(void);
    6159/* USER CODE BEGIN EFP */
  • ctrl/firmware/Main/CubeMX/Core/Src/gpio.c

    r51 r54  
    108108  /*Configure GPIO pins : PA0 PA1 PA2 PA3
    109109                           PA4 PA5 PA6 PA7
    110                            PA8 PA9 PA10 PA11
    111                            PA12 PA15 */
     110                           PA9 PA10 PA11 PA12
     111                           PA15 */
    112112  GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
    113113                          |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7
    114                           |GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
    115                           |GPIO_PIN_12|GPIO_PIN_15;
     114                          |GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12
     115                          |GPIO_PIN_15;
    116116  GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
    117117  GPIO_InitStruct.Pull = GPIO_NOPULL;
     
    152152  HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
    153153
     154  /*Configure GPIO pin : SD_DETECT_Pin */
     155  GPIO_InitStruct.Pin = SD_DETECT_Pin;
     156  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
     157  GPIO_InitStruct.Pull = GPIO_PULLDOWN;
     158  HAL_GPIO_Init(SD_DETECT_GPIO_Port, &GPIO_InitStruct);
     159
    154160  /*Configure GPIO pin : OUTPUT_ON_LED_Pin */
    155161  GPIO_InitStruct.Pin = OUTPUT_ON_LED_Pin;
  • ctrl/firmware/Main/CubeMX/Core/Src/main.c

    r51 r54  
    1818/* USER CODE END Header */
    1919/* Includes ------------------------------------------------------------------*/
     20#include "app_threadx.h"
    2021#include "main.h"
    2122#include "dma.h"
     
    118119  /* USER CODE BEGIN 2 */
    119120
    120   //HAL_GPIO_WritePin(PWM_DISPLAY_LIGHT_GPIO_Port, PWM_DISPLAY_LIGHT_Pin, GPIO_PIN_SET);
    121   //HAL_GPIO_WritePin(TX1_LED_GPIO_Port, TX1_LED_Pin, GPIO_PIN_SET);
    122   //HAL_GPIO_WritePin(RX1_LED_GPIO_Port, RX1_LED_Pin, GPIO_PIN_SET);
    123   //HAL_GPIO_WritePin(OUTPUT_ON_LED_GPIO_Port, OUTPUT_ON_LED_Pin, GPIO_PIN_RESET);
    124 
    125 
    126121  /* USER CODE END 2 */
     122
     123  MX_ThreadX_Init();
     124
     125  /* We should never get here as control is now taken by the scheduler */
    127126
    128127  /* Infinite loop */
     
    260259
    261260/**
     261  * @brief  Period elapsed callback in non blocking mode
     262  * @note   This function is called  when TIM7 interrupt took place, inside
     263  * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
     264  * a global variable "uwTick" used as application time base.
     265  * @param  htim : TIM handle
     266  * @retval None
     267  */
     268void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
     269{
     270  /* USER CODE BEGIN Callback 0 */
     271
     272  /* USER CODE END Callback 0 */
     273  if (htim->Instance == TIM7) {
     274    HAL_IncTick();
     275  }
     276  /* USER CODE BEGIN Callback 1 */
     277
     278  /* USER CODE END Callback 1 */
     279}
     280
     281/**
    262282  * @brief  This function is executed in case of error occurrence.
    263283  * @retval None
  • ctrl/firmware/Main/CubeMX/Core/Src/stm32h7xx_it.c

    r51 r54  
    5959extern DMA_HandleTypeDef hdma_spi4_tx;
    6060extern SPI_HandleTypeDef hspi4;
     61extern TIM_HandleTypeDef htim7;
     62
    6163/* USER CODE BEGIN EV */
    6264
     
    142144
    143145/**
    144   * @brief This function handles System service call via SWI instruction.
    145   */
    146 void SVC_Handler(void)
    147 {
    148   /* USER CODE BEGIN SVCall_IRQn 0 */
    149 
    150   /* USER CODE END SVCall_IRQn 0 */
    151   /* USER CODE BEGIN SVCall_IRQn 1 */
    152 
    153   /* USER CODE END SVCall_IRQn 1 */
    154 }
    155 
    156 /**
    157146  * @brief This function handles Debug monitor.
    158147  */
     
    165154
    166155  /* USER CODE END DebugMonitor_IRQn 1 */
    167 }
    168 
    169 /**
    170   * @brief This function handles Pendable request for system service.
    171   */
    172 void PendSV_Handler(void)
    173 {
    174   /* USER CODE BEGIN PendSV_IRQn 0 */
    175 
    176   /* USER CODE END PendSV_IRQn 0 */
    177   /* USER CODE BEGIN PendSV_IRQn 1 */
    178 
    179   /* USER CODE END PendSV_IRQn 1 */
    180 }
    181 
    182 /**
    183   * @brief This function handles System tick timer.
    184   */
    185 void SysTick_Handler(void)
    186 {
    187   /* USER CODE BEGIN SysTick_IRQn 0 */
    188 
    189   /* USER CODE END SysTick_IRQn 0 */
    190   HAL_IncTick();
    191   /* USER CODE BEGIN SysTick_IRQn 1 */
    192 
    193   /* USER CODE END SysTick_IRQn 1 */
    194156}
    195157
     
    230192
    231193/**
     194  * @brief This function handles TIM7 global interrupt.
     195  */
     196void TIM7_IRQHandler(void)
     197{
     198  /* USER CODE BEGIN TIM7_IRQn 0 */
     199
     200  /* USER CODE END TIM7_IRQn 0 */
     201  HAL_TIM_IRQHandler(&htim7);
     202  /* USER CODE BEGIN TIM7_IRQn 1 */
     203
     204  /* USER CODE END TIM7_IRQn 1 */
     205}
     206
     207/**
    232208  * @brief This function handles SPI4 global interrupt.
    233209  */
Note: See TracChangeset for help on using the changeset viewer.