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
Files:
99 added
7 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  */
  • ctrl/firmware/Main/CubeMX/charger.ioc

    r51 r54  
    5151Mcu.Pin10=PC8
    5252Mcu.Pin11=PC9
    53 Mcu.Pin12=PA13(JTMS/SWDIO)
    54 Mcu.Pin13=PA14(JTCK/SWCLK)
    55 Mcu.Pin14=PC10
    56 Mcu.Pin15=PC11
    57 Mcu.Pin16=PC12
    58 Mcu.Pin17=PD2
    59 Mcu.Pin18=PD7
    60 Mcu.Pin19=PG9
     53Mcu.Pin12=PA8
     54Mcu.Pin13=PA13(JTMS/SWDIO)
     55Mcu.Pin14=PA14(JTCK/SWCLK)
     56Mcu.Pin15=PC10
     57Mcu.Pin16=PC11
     58Mcu.Pin17=PC12
     59Mcu.Pin18=PD2
     60Mcu.Pin19=PD7
    6161Mcu.Pin2=PC15-OSC32_OUT
    62 Mcu.Pin20=PG10
    63 Mcu.Pin21=PG11
    64 Mcu.Pin22=PG12
    65 Mcu.Pin23=PG13
    66 Mcu.Pin24=VP_RTC_VS_RTC_Activate
    67 Mcu.Pin25=VP_SYS_VS_Systick
    68 Mcu.Pin26=VP_MEMORYMAP_VS_MEMORYMAP
     62Mcu.Pin20=PG9
     63Mcu.Pin21=PG10
     64Mcu.Pin22=PG11
     65Mcu.Pin23=PG12
     66Mcu.Pin24=PG13
     67Mcu.Pin25=VP_RTC_VS_RTC_Activate
     68Mcu.Pin26=VP_SYS_VS_tim7
     69Mcu.Pin27=VP_MEMORYMAP_VS_MEMORYMAP
     70Mcu.Pin28=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0
     71Mcu.Pin29=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0
    6972Mcu.Pin3=PH0-OSC_IN
     73Mcu.Pin30=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0
    7074Mcu.Pin4=PH1-OSC_OUT
    7175Mcu.Pin5=PE11
     
    7478Mcu.Pin8=PE14
    7579Mcu.Pin9=PE15
    76 Mcu.PinsNb=27
    77 Mcu.ThirdPartyNb=0
     80Mcu.PinsNb=31
     81Mcu.ThirdParty0=STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0
     82Mcu.ThirdPartyNb=1
    7883Mcu.UserConstants=
    7984Mcu.UserName=STM32H723ZETx
    8085MxCube.Version=6.13.0
    8186MxDb.Version=DB.6.0.130
    82 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
    83 NVIC.DMA1_Stream0_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true
    84 NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
     87NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
     88NVIC.DMA1_Stream0_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true\:true
     89NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
    8590NVIC.ForceEnableDMAVector=true
    86 NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
    87 NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
    88 NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
    89 NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
     91NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
     92NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
     93NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
     94NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:false
    9095NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
    91 NVIC.SDMMC1_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
    92 NVIC.SPI4_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true
    93 NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
    94 NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false
    95 NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
     96NVIC.SDMMC1_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true\:true
     97NVIC.SPI4_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true\:true
     98NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:false
     99NVIC.SavedPendsvIrqHandlerGenerated=true
     100NVIC.SavedSvcallIrqHandlerGenerated=true
     101NVIC.SavedSystickIrqHandlerGenerated=true
     102NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:true\:false
     103NVIC.TIM7_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true\:true
     104NVIC.TimeBase=TIM7_IRQn
     105NVIC.TimeBaseIP=TIM7
     106NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
    96107PA13(JTMS/SWDIO).Mode=Serial_Wire
    97108PA13(JTMS/SWDIO).Signal=DEBUG_JTMS-SWDIO
    98109PA14(JTCK/SWCLK).Mode=Serial_Wire
    99110PA14(JTCK/SWCLK).Signal=DEBUG_JTCK-SWCLK
     111PA8.GPIOParameters=GPIO_PuPd,GPIO_Label
     112PA8.GPIO_Label=SD_DETECT
     113PA8.GPIO_PuPd=GPIO_PULLDOWN
     114PA8.Locked=true
     115PA8.Signal=GPIO_Input
    100116PC10.Mode=SD_4_bits_Wide_bus
    101117PC10.Signal=SDMMC1_D2
     
    187203ProjectManager.KeepUserCode=true
    188204ProjectManager.LastFirmware=true
    189 ProjectManager.LibraryCopy=0
     205ProjectManager.LibraryCopy=1
    190206ProjectManager.MainLocation=Core/Src
    191207ProjectManager.NoMain=false
    192 ProjectManager.PreviousToolchain=
     208ProjectManager.PreviousToolchain=STM32CubeIDE
    193209ProjectManager.ProjectBuild=false
    194210ProjectManager.ProjectFileName=charger.ioc
     
    197213ProjectManager.RegisterCallBack=
    198214ProjectManager.StackSize=0x400
    199 ProjectManager.TargetToolchain=EWARM V8.50
     215ProjectManager.TargetToolchain=STM32CubeIDE
    200216ProjectManager.ToolChainLocation=
    201217ProjectManager.UAScriptAfterPath=
    202218ProjectManager.UAScriptBeforePath=
    203 ProjectManager.UnderRoot=false
    204 ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_RTC_Init-RTC-false-HAL-true,5-MX_SPI4_Init-SPI4-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
     219ProjectManager.UnderRoot=true
     220ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_RTC_Init-RTC-false-HAL-true,5-MX_SPI4_Init-SPI4-false-HAL-true,6-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
    205221RCC.ADCFreq_Value=166666666.66666666
    206222RCC.AHB12Freq_Value=100000000
     
    293309SPI4.VirtualNSS=VM_NSSHARD
    294310SPI4.VirtualType=VM_MASTER
     311STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FX_APP_MEM_POOL_SIZE=8192
     312STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FX_DRIVER_SD_INIT=0
     313STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FX_ENABLE_EXFAT=1
     314STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FX_ENABLE_FAULT_TOLERANT=1
     315STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FX_FAULT_TOLERANT=1
     316STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FX_FAULT_TOLERANT_DATA=1
     317STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FileOoSystemJjFileX_Checked=true
     318STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FileOoSystemJjInterfaces_Checked=true
     319STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.FileXCcFileOoSystemJjFileXJjCore=true
     320STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.IPParameters=TX_APP_MEM_POOL_SIZE,FX_APP_MEM_POOL_SIZE,TX_APP_GENERATE_INIT_CODE,TX_APP_CREATION,TX_ENABLE_STACK_CHECKING,TX_NO_FILEX_POINTER,TX_LOW_POWER,FX_ENABLE_EXFAT,FX_ENABLE_FAULT_TOLERANT,FX_FAULT_TOLERANT,FX_FAULT_TOLERANT_DATA,FX_DRIVER_SD_INIT,ThreadXCcRTOSJjThreadXJjCore,ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport,FileXCcFileOoSystemJjFileXJjCore,InterfacesCcFileOoSystemJjFileXOoSDOointerface
     321STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.InterfacesCcFileOoSystemJjFileXOoSDOointerface=true
     322STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.RTOSJjThreadX_Checked=true
     323STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_CREATION=1
     324STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_GENERATE_INIT_CODE=false
     325STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_MEM_POOL_SIZE=8192
     326STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_ENABLE_STACK_CHECKING=1
     327STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_LOW_POWER=1
     328STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_NO_FILEX_POINTER=1
     329STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.ThreadXCcRTOSJjThreadXJjCore=true
     330STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport=true
     331STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_IsAnAzureRtosMw=true
     332STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0_SwParameter=InterfacesCcFileOoSystemJjFileXOoSDOointerface\:true;ThreadXCcRTOSJjThreadXJjLowOoPowerOosupport\:true;FileXCcFileOoSystemJjFileXJjCore\:true;ThreadXCcRTOSJjThreadXJjCore\:true;
    295333VP_MEMORYMAP_VS_MEMORYMAP.Mode=CurAppReg
    296334VP_MEMORYMAP_VS_MEMORYMAP.Signal=MEMORYMAP_VS_MEMORYMAP
    297335VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
    298336VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
    299 VP_SYS_VS_Systick.Mode=SysTick
    300 VP_SYS_VS_Systick.Signal=SYS_VS_Systick
     337VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0.Mode=FileOoSystemJjFileX
     338VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0.Signal=STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjFileX_6.4.0_3.3.0
     339VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0.Mode=FileOoSystemJjInterfaces
     340VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0.Signal=STMicroelectronics.X-CUBE-AZRTOS-H7_VS_FileOoSystemJjInterfaces_3.3.0_3.3.0
     341VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0.Mode=RTOSJjThreadX
     342VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0.Signal=STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.4.0_3.3.0
     343VP_SYS_VS_tim7.Mode=TIM7
     344VP_SYS_VS_tim7.Signal=SYS_VS_tim7
    301345board=custom
Note: See TracChangeset for help on using the changeset viewer.