main.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file : main.c
  5. * @brief : Main program body
  6. ******************************************************************************
  7. ** This notice applies to any and all portions of this file
  8. * that are not between comment pairs USER CODE BEGIN and
  9. * USER CODE END. Other portions of this file, whether
  10. * inserted by the user or by software development tools
  11. * are owned by their respective copyright owners.
  12. *
  13. * COPYRIGHT(c) 2019 STMicroelectronics
  14. *
  15. * Redistribution and use in source and binary forms, with or without modification,
  16. * are permitted provided that the following conditions are met:
  17. * 1. Redistributions of source code must retain the above copyright notice,
  18. * this list of conditions and the following disclaimer.
  19. * 2. Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  23. * may be used to endorse or promote products derived from this software
  24. * without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  29. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  30. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  31. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  32. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  33. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  34. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  35. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  36. *
  37. ******************************************************************************
  38. */
  39. /* USER CODE END Header */
  40. /* Includes ------------------------------------------------------------------*/
  41. #include "main.h"
  42. /* Private includes ----------------------------------------------------------*/
  43. /* USER CODE BEGIN Includes */
  44. /* USER CODE END Includes */
  45. /* Private typedef -----------------------------------------------------------*/
  46. /* USER CODE BEGIN PTD */
  47. /* USER CODE END PTD */
  48. /* Private define ------------------------------------------------------------*/
  49. /* USER CODE BEGIN PD */
  50. /* USER CODE END PD */
  51. /* Private macro -------------------------------------------------------------*/
  52. /* USER CODE BEGIN PM */
  53. /* USER CODE END PM */
  54. /* Private variables ---------------------------------------------------------*/
  55. DMA2D_HandleTypeDef hdma2d;
  56. LTDC_HandleTypeDef hltdc;
  57. RTC_HandleTypeDef hrtc;
  58. UART_HandleTypeDef huart1;
  59. SDRAM_HandleTypeDef hsdram1;
  60. /* USER CODE BEGIN PV */
  61. /* USER CODE END PV */
  62. /* Private function prototypes -----------------------------------------------*/
  63. void SystemClock_Config(void);
  64. static void MX_GPIO_Init(void);
  65. static void MX_USART1_UART_Init(void);
  66. static void MX_FMC_Init(void);
  67. static void MX_DMA2D_Init(void);
  68. static void MX_LTDC_Init(void);
  69. static void MX_RTC_Init(void);
  70. /* USER CODE BEGIN PFP */
  71. /* USER CODE END PFP */
  72. /* Private user code ---------------------------------------------------------*/
  73. /* USER CODE BEGIN 0 */
  74. /* USER CODE END 0 */
  75. /**
  76. * @brief The application entry point.
  77. * @retval int
  78. */
  79. int main(void)
  80. {
  81. /* USER CODE BEGIN 1 */
  82. /* USER CODE END 1 */
  83. /* Enable I-Cache---------------------------------------------------------*/
  84. SCB_EnableICache();
  85. /* Enable D-Cache---------------------------------------------------------*/
  86. SCB_EnableDCache();
  87. /* MCU Configuration--------------------------------------------------------*/
  88. /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  89. HAL_Init();
  90. /* USER CODE BEGIN Init */
  91. /* USER CODE END Init */
  92. /* Configure the system clock */
  93. SystemClock_Config();
  94. /* USER CODE BEGIN SysInit */
  95. /* USER CODE END SysInit */
  96. /* Initialize all configured peripherals */
  97. MX_GPIO_Init();
  98. MX_USART1_UART_Init();
  99. MX_FMC_Init();
  100. MX_DMA2D_Init();
  101. MX_LTDC_Init();
  102. MX_RTC_Init();
  103. /* USER CODE BEGIN 2 */
  104. /* USER CODE END 2 */
  105. /* Infinite loop */
  106. /* USER CODE BEGIN WHILE */
  107. while (1)
  108. {
  109. /* USER CODE END WHILE */
  110. /* USER CODE BEGIN 3 */
  111. }
  112. /* USER CODE END 3 */
  113. }
  114. /**
  115. * @brief System Clock Configuration
  116. * @retval None
  117. */
  118. void SystemClock_Config(void)
  119. {
  120. RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  121. RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
  122. RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
  123. /** Supply configuration update enable
  124. */
  125. HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
  126. /** Configure the main internal regulator output voltage
  127. */
  128. __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
  129. while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}
  130. /** Configure LSE Drive Capability
  131. */
  132. HAL_PWR_EnableBkUpAccess();
  133. __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
  134. /** Macro to configure the PLL clock source
  135. */
  136. __HAL_RCC_PLL_PLLSOURCE_CONFIG(RCC_PLLSOURCE_HSE);
  137. /** Initializes the CPU, AHB and APB busses clocks
  138. */
  139. RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE|RCC_OSCILLATORTYPE_LSE;
  140. RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  141. RCC_OscInitStruct.LSEState = RCC_LSE_ON;
  142. RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  143. RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  144. RCC_OscInitStruct.PLL.PLLM = 5;
  145. RCC_OscInitStruct.PLL.PLLN = 160;
  146. RCC_OscInitStruct.PLL.PLLP = 2;
  147. RCC_OscInitStruct.PLL.PLLQ = 2;
  148. RCC_OscInitStruct.PLL.PLLR = 2;
  149. RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_2;
  150. RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE;
  151. RCC_OscInitStruct.PLL.PLLFRACN = 0;
  152. if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  153. {
  154. Error_Handler();
  155. }
  156. /** Initializes the CPU, AHB and APB busses clocks
  157. */
  158. RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
  159. |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2
  160. |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1;
  161. RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  162. RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
  163. RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2;
  164. RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2;
  165. RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2;
  166. RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2;
  167. RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2;
  168. if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
  169. {
  170. Error_Handler();
  171. }
  172. PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_LTDC
  173. |RCC_PERIPHCLK_USART1|RCC_PERIPHCLK_FMC;
  174. PeriphClkInitStruct.PLL3.PLL3M = 5;
  175. PeriphClkInitStruct.PLL3.PLL3N = 160;
  176. PeriphClkInitStruct.PLL3.PLL3P = 2;
  177. PeriphClkInitStruct.PLL3.PLL3Q = 2;
  178. PeriphClkInitStruct.PLL3.PLL3R = 88;
  179. PeriphClkInitStruct.PLL3.PLL3RGE = RCC_PLL3VCIRANGE_2;
  180. PeriphClkInitStruct.PLL3.PLL3VCOSEL = RCC_PLL3VCOWIDE;
  181. PeriphClkInitStruct.PLL3.PLL3FRACN = 0;
  182. PeriphClkInitStruct.FmcClockSelection = RCC_FMCCLKSOURCE_D1HCLK;
  183. PeriphClkInitStruct.Usart16ClockSelection = RCC_USART16CLKSOURCE_D2PCLK2;
  184. PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
  185. if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
  186. {
  187. Error_Handler();
  188. }
  189. }
  190. /**
  191. * @brief DMA2D Initialization Function
  192. * @param None
  193. * @retval None
  194. */
  195. static void MX_DMA2D_Init(void)
  196. {
  197. /* USER CODE BEGIN DMA2D_Init 0 */
  198. /* USER CODE END DMA2D_Init 0 */
  199. /* USER CODE BEGIN DMA2D_Init 1 */
  200. /* USER CODE END DMA2D_Init 1 */
  201. hdma2d.Instance = DMA2D;
  202. hdma2d.Init.Mode = DMA2D_R2M;
  203. hdma2d.Init.ColorMode = DMA2D_OUTPUT_RGB565;
  204. hdma2d.Init.OutputOffset = 0;
  205. if (HAL_DMA2D_Init(&hdma2d) != HAL_OK)
  206. {
  207. Error_Handler();
  208. }
  209. /* USER CODE BEGIN DMA2D_Init 2 */
  210. /* USER CODE END DMA2D_Init 2 */
  211. }
  212. /**
  213. * @brief LTDC Initialization Function
  214. * @param None
  215. * @retval None
  216. */
  217. static void MX_LTDC_Init(void)
  218. {
  219. /* USER CODE BEGIN LTDC_Init 0 */
  220. /* USER CODE END LTDC_Init 0 */
  221. LTDC_LayerCfgTypeDef pLayerCfg = {0};
  222. LTDC_LayerCfgTypeDef pLayerCfg1 = {0};
  223. /* USER CODE BEGIN LTDC_Init 1 */
  224. /* USER CODE END LTDC_Init 1 */
  225. hltdc.Instance = LTDC;
  226. hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;
  227. hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;
  228. hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;
  229. hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
  230. hltdc.Init.HorizontalSync = 7;
  231. hltdc.Init.VerticalSync = 3;
  232. hltdc.Init.AccumulatedHBP = 14;
  233. hltdc.Init.AccumulatedVBP = 5;
  234. hltdc.Init.AccumulatedActiveW = 654;
  235. hltdc.Init.AccumulatedActiveH = 485;
  236. hltdc.Init.TotalWidth = 660;
  237. hltdc.Init.TotalHeigh = 487;
  238. hltdc.Init.Backcolor.Blue = 0;
  239. hltdc.Init.Backcolor.Green = 0;
  240. hltdc.Init.Backcolor.Red = 0;
  241. if (HAL_LTDC_Init(&hltdc) != HAL_OK)
  242. {
  243. Error_Handler();
  244. }
  245. pLayerCfg.WindowX0 = 0;
  246. pLayerCfg.WindowX1 = 0;
  247. pLayerCfg.WindowY0 = 0;
  248. pLayerCfg.WindowY1 = 0;
  249. pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
  250. pLayerCfg.Alpha = 0;
  251. pLayerCfg.Alpha0 = 0;
  252. pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
  253. pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
  254. pLayerCfg.FBStartAdress = 0;
  255. pLayerCfg.ImageWidth = 0;
  256. pLayerCfg.ImageHeight = 0;
  257. pLayerCfg.Backcolor.Blue = 0;
  258. pLayerCfg.Backcolor.Green = 0;
  259. pLayerCfg.Backcolor.Red = 0;
  260. if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
  261. {
  262. Error_Handler();
  263. }
  264. pLayerCfg1.WindowX0 = 0;
  265. pLayerCfg1.WindowX1 = 0;
  266. pLayerCfg1.WindowY0 = 0;
  267. pLayerCfg1.WindowY1 = 0;
  268. pLayerCfg1.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
  269. pLayerCfg1.Alpha = 0;
  270. pLayerCfg1.Alpha0 = 0;
  271. pLayerCfg1.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
  272. pLayerCfg1.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
  273. pLayerCfg1.FBStartAdress = 0;
  274. pLayerCfg1.ImageWidth = 0;
  275. pLayerCfg1.ImageHeight = 0;
  276. pLayerCfg1.Backcolor.Blue = 0;
  277. pLayerCfg1.Backcolor.Green = 0;
  278. pLayerCfg1.Backcolor.Red = 0;
  279. if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg1, 1) != HAL_OK)
  280. {
  281. Error_Handler();
  282. }
  283. /* USER CODE BEGIN LTDC_Init 2 */
  284. /* USER CODE END LTDC_Init 2 */
  285. }
  286. /**
  287. * @brief RTC Initialization Function
  288. * @param None
  289. * @retval None
  290. */
  291. static void MX_RTC_Init(void)
  292. {
  293. /* USER CODE BEGIN RTC_Init 0 */
  294. /* USER CODE END RTC_Init 0 */
  295. /* USER CODE BEGIN RTC_Init 1 */
  296. /* USER CODE END RTC_Init 1 */
  297. /** Initialize RTC Only
  298. */
  299. hrtc.Instance = RTC;
  300. hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
  301. hrtc.Init.AsynchPrediv = 127;
  302. hrtc.Init.SynchPrediv = 255;
  303. hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
  304. hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
  305. hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
  306. hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE;
  307. if (HAL_RTC_Init(&hrtc) != HAL_OK)
  308. {
  309. Error_Handler();
  310. }
  311. /** Enable Calibrartion
  312. */
  313. if (HAL_RTCEx_SetCalibrationOutPut(&hrtc, RTC_CALIBOUTPUT_1HZ) != HAL_OK)
  314. {
  315. Error_Handler();
  316. }
  317. /* USER CODE BEGIN RTC_Init 2 */
  318. /* USER CODE END RTC_Init 2 */
  319. }
  320. /**
  321. * @brief USART1 Initialization Function
  322. * @param None
  323. * @retval None
  324. */
  325. static void MX_USART1_UART_Init(void)
  326. {
  327. /* USER CODE BEGIN USART1_Init 0 */
  328. /* USER CODE END USART1_Init 0 */
  329. /* USER CODE BEGIN USART1_Init 1 */
  330. /* USER CODE END USART1_Init 1 */
  331. huart1.Instance = USART1;
  332. huart1.Init.BaudRate = 115200;
  333. huart1.Init.WordLength = UART_WORDLENGTH_8B;
  334. huart1.Init.StopBits = UART_STOPBITS_1;
  335. huart1.Init.Parity = UART_PARITY_NONE;
  336. huart1.Init.Mode = UART_MODE_TX_RX;
  337. huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
  338. huart1.Init.OverSampling = UART_OVERSAMPLING_16;
  339. huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
  340. huart1.Init.ClockPrescaler = UART_PRESCALER_DIV1;
  341. huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
  342. if (HAL_UART_Init(&huart1) != HAL_OK)
  343. {
  344. Error_Handler();
  345. }
  346. if (HAL_UARTEx_SetTxFifoThreshold(&huart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
  347. {
  348. Error_Handler();
  349. }
  350. if (HAL_UARTEx_SetRxFifoThreshold(&huart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
  351. {
  352. Error_Handler();
  353. }
  354. if (HAL_UARTEx_DisableFifoMode(&huart1) != HAL_OK)
  355. {
  356. Error_Handler();
  357. }
  358. /* USER CODE BEGIN USART1_Init 2 */
  359. /* USER CODE END USART1_Init 2 */
  360. }
  361. /* FMC initialization function */
  362. static void MX_FMC_Init(void)
  363. {
  364. /* USER CODE BEGIN FMC_Init 0 */
  365. /* USER CODE END FMC_Init 0 */
  366. FMC_SDRAM_TimingTypeDef SdramTiming = {0};
  367. /* USER CODE BEGIN FMC_Init 1 */
  368. /* USER CODE END FMC_Init 1 */
  369. /** Perform the SDRAM1 memory initialization sequence
  370. */
  371. hsdram1.Instance = FMC_SDRAM_DEVICE;
  372. /* hsdram1.Init */
  373. hsdram1.Init.SDBank = FMC_SDRAM_BANK1;
  374. hsdram1.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_9;
  375. hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_13;
  376. hsdram1.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_WIDTH_16;
  377. hsdram1.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
  378. hsdram1.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_2;
  379. hsdram1.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
  380. hsdram1.Init.SDClockPeriod = FMC_SDRAM_CLOCK_PERIOD_2;
  381. hsdram1.Init.ReadBurst = FMC_SDRAM_RBURST_ENABLE;
  382. hsdram1.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_1;
  383. /* SdramTiming */
  384. SdramTiming.LoadToActiveDelay = 2;
  385. SdramTiming.ExitSelfRefreshDelay = 8;
  386. SdramTiming.SelfRefreshTime = 6;
  387. SdramTiming.RowCycleDelay = 6;
  388. SdramTiming.WriteRecoveryTime = 4;
  389. SdramTiming.RPDelay = 2;
  390. SdramTiming.RCDDelay = 2;
  391. if (HAL_SDRAM_Init(&hsdram1, &SdramTiming) != HAL_OK)
  392. {
  393. Error_Handler( );
  394. }
  395. /* USER CODE BEGIN FMC_Init 2 */
  396. /* USER CODE END FMC_Init 2 */
  397. }
  398. /**
  399. * @brief GPIO Initialization Function
  400. * @param None
  401. * @retval None
  402. */
  403. static void MX_GPIO_Init(void)
  404. {
  405. /* GPIO Ports Clock Enable */
  406. __HAL_RCC_GPIOC_CLK_ENABLE();
  407. __HAL_RCC_GPIOI_CLK_ENABLE();
  408. __HAL_RCC_GPIOF_CLK_ENABLE();
  409. __HAL_RCC_GPIOH_CLK_ENABLE();
  410. __HAL_RCC_GPIOG_CLK_ENABLE();
  411. __HAL_RCC_GPIOE_CLK_ENABLE();
  412. __HAL_RCC_GPIOD_CLK_ENABLE();
  413. __HAL_RCC_GPIOA_CLK_ENABLE();
  414. }
  415. /* USER CODE BEGIN 4 */
  416. /* USER CODE END 4 */
  417. /**
  418. * @brief This function is executed in case of error occurrence.
  419. * @retval None
  420. */
  421. void Error_Handler(void)
  422. {
  423. /* USER CODE BEGIN Error_Handler_Debug */
  424. /* User can add his own implementation to report the HAL error return state */
  425. /* USER CODE END Error_Handler_Debug */
  426. }
  427. #ifdef USE_FULL_ASSERT
  428. /**
  429. * @brief Reports the name of the source file and the source line number
  430. * where the assert_param error has occurred.
  431. * @param file: pointer to the source file name
  432. * @param line: assert_param error line source number
  433. * @retval None
  434. */
  435. void assert_failed(uint8_t *file, uint32_t line)
  436. {
  437. /* USER CODE BEGIN 6 */
  438. /* User can add his own implementation to report the file name and line number,
  439. tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  440. /* USER CODE END 6 */
  441. }
  442. #endif /* USE_FULL_ASSERT */
  443. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/