Ignore:
Timestamp:
Feb 6, 2025, 8:27:24 AM (3 months ago)
Author:
Zed
Message:

DMA transfer to µSD-card was implemented.

Location:
ctrl/firmware/Main/CubeMX/Core
Files:
3 edited

Legend:

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

    r81 r82  
    6767void TIM7_IRQHandler(void);
    6868void SPI4_IRQHandler(void);
     69void MDMA_IRQHandler(void);
    6970void USART10_IRQHandler(void);
    7071/* USER CODE BEGIN EFP */
  • ctrl/firmware/Main/CubeMX/Core/Src/main.c

    r81 r82  
    2222#include "dma.h"
    2323#include "fatfs.h"
     24#include "mdma.h"
    2425#include "memorymap.h"
    2526#include "rtc.h"
     
    105106  /* USER CODE BEGIN Init */
    106107
    107   SCB_DisableDCache();
     108  //SCB_DisableDCache();
    108109
    109110  /* USER CODE END Init */
     
    124125  MX_GPIO_Init();
    125126  MX_DMA_Init();
     127  MX_MDMA_Init();
    126128  MX_RTC_Init();
    127129  MX_SPI4_Init();
     
    280282
    281283  HAL_MPU_ConfigRegion(&MPU_InitStruct);
     284
     285  /** Initializes and configures the Region and the memory to be protected
     286  */
     287  MPU_InitStruct.Number = MPU_REGION_NUMBER1;
     288  MPU_InitStruct.BaseAddress = 0x24000000;
     289  MPU_InitStruct.Size = MPU_REGION_SIZE_128KB;
     290  MPU_InitStruct.SubRegionDisable = 0x0;
     291  MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;
     292  MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
     293  MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
     294
     295  HAL_MPU_ConfigRegion(&MPU_InitStruct);
    282296  /* Enables the MPU */
    283297  HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
  • ctrl/firmware/Main/CubeMX/Core/Src/stm32h7xx_it.c

    r81 r82  
    2525
    2626#include "FreeRTOS.h"
    27 #include "semphr.h"
     27#include "modbus.h"
     28//#include "semphr.h"
    2829
    2930/* USER CODE END Includes */
     
    6061
    6162/* External variables --------------------------------------------------------*/
     63extern MDMA_HandleTypeDef hmdma_mdma_channel0_sdmmc1_end_data_0;
    6264extern SD_HandleTypeDef hsd1;
    6365extern DMA_HandleTypeDef hdma_spi2_rx;
     
    374376
    375377/**
     378  * @brief This function handles MDMA global interrupt.
     379  */
     380void MDMA_IRQHandler(void)
     381{
     382  /* USER CODE BEGIN MDMA_IRQn 0 */
     383
     384  /* USER CODE END MDMA_IRQn 0 */
     385  HAL_MDMA_IRQHandler(&hmdma_mdma_channel0_sdmmc1_end_data_0);
     386  /* USER CODE BEGIN MDMA_IRQn 1 */
     387
     388  /* USER CODE END MDMA_IRQn 1 */
     389}
     390
     391/**
    376392  * @brief This function handles USART10 global interrupt.
    377393  */
     
    379395{
    380396  /* USER CODE BEGIN USART10_IRQn 0 */
     397  extern modbus_t lb_mbData;
     398  MODBUS_UART_IRQHandler(&huart10, &lb_mbData);
     399  return;
     400
    381401
    382402  /* USER CODE END USART10_IRQn 0 */
Note: See TracChangeset for help on using the changeset viewer.