feat:add rtt support

This commit is contained in:
2025-09-02 16:09:41 +08:00
parent 4b4e1a7d89
commit 86f64a8594
18 changed files with 4915 additions and 2 deletions

View File

@@ -23,6 +23,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "stdlib.h"
#include "log.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@@ -72,6 +73,14 @@ int main(void)
/* MPU Configuration--------------------------------------------------------*/
MPU_Config();
/* Enable the CPU Cache */
/* Enable I-Cache---------------------------------------------------------*/
SCB_EnableICache();
/* Enable D-Cache---------------------------------------------------------*/
SCB_EnableDCache();
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
@@ -92,12 +101,18 @@ int main(void)
MX_GPIO_Init();
/* USER CODE BEGIN 2 */
int *i = malloc(sizeof(int));
*i = 0;
rtt_log_init();
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
HAL_Delay(20);
rtt_log(LOG_INFO,"%d",*i);
*i += 1;
/* USER CODE END WHILE */