diff --git a/.gdb_history b/.gdb_history index 44b8905..c928f3d 100644 --- a/.gdb_history +++ b/.gdb_history @@ -1,4 +1,69 @@ q q q +b main +file build/motor_controller.hex +q +r +q +r +q +b main +r +n +n +n +n +n +n +n +n +n +n +n +n +n +n +b 129 +c +qq +q +b main +r +n +n +n +n +n +n +n +n +n +n +n +b 128 +n +n +n +n +b 129 +de +del +b 129 +r +c +n +s +s +s +q +q +q +b 129 +r +q +b Core/Src/main.c:380 +r +q +q q diff --git a/Core/Inc/stm32l4xx_it.h b/Core/Inc/stm32l4xx_it.h index 061ade3..c3e7d9e 100644 --- a/Core/Inc/stm32l4xx_it.h +++ b/Core/Inc/stm32l4xx_it.h @@ -56,6 +56,7 @@ void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); void USART2_IRQHandler(void); +void TIM6_DAC_IRQHandler(void); /* USER CODE BEGIN EFP */ /* USER CODE END EFP */ diff --git a/Core/Src/main.c b/Core/Src/main.c index ea7a75a..011fffa 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -25,6 +25,7 @@ #include "motor_controller.h" #include "stm32l4xx_hal_uart.h" #include +#include /* USER CODE END Includes */ @@ -43,11 +44,15 @@ /* USER CODE END PM */ /* Private variables ---------------------------------------------------------*/ -TIM_HandleTypeDef htim2; + TIM_HandleTypeDef htim2; +TIM_HandleTypeDef htim6; UART_HandleTypeDef huart2; /* USER CODE BEGIN PV */ +volatile uint8_t huart2_rxc; +static volatile uint32_t sys_time = 0; +static volatile bool b_timer_struck = false; /* USER CODE END PV */ @@ -56,6 +61,7 @@ void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_TIM2_Init(void); static void MX_USART2_UART_Init(void); +static void MX_TIM6_Init(void); /* USER CODE BEGIN PFP */ void setPWM(TIM_HandleTypeDef *timer, uint32_t channel, uint8_t dc_percent); @@ -67,42 +73,38 @@ void setPWM(TIM_HandleTypeDef *timer, uint32_t channel, uint8_t dc_percent); /* USER CODE END 0 */ /** - * @brief The application entry point. - * @retval int - */ + * @brief The application entry point. + * @retval int + */ int main(void) { - /* USER CODE BEGIN 1 */ + /* USER CODE BEGIN 1 */ - /* USER CODE END 1 */ + /* USER CODE END 1 */ - /* MCU Configuration--------------------------------------------------------*/ + /* MCU Configuration--------------------------------------------------------*/ - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); + /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + HAL_Init(); - /* USER CODE BEGIN Init */ + /* USER CODE BEGIN Init */ - /* USER CODE END Init */ + /* USER CODE END Init */ - /* Configure the system clock */ - SystemClock_Config(); + /* Configure the system clock */ + SystemClock_Config(); - /* USER CODE BEGIN SysInit */ + /* USER CODE BEGIN SysInit */ - /* USER CODE END SysInit */ + /* USER CODE END SysInit */ - /* Initialize all configured peripherals */ - MX_GPIO_Init(); - MX_TIM2_Init(); - MX_USART2_UART_Init(); - /* USER CODE BEGIN 2 */ + /* Initialize all configured peripherals */ + MX_GPIO_Init(); + MX_TIM2_Init(); + MX_USART2_UART_Init(); + MX_TIM6_Init(); + /* USER CODE BEGIN 2 */ p_uart_init(&huart2); - uint8_t buff[256] = {'\0'}; - sprintf(buff, "Hello Worldblahblahfjdslkfjlasdfj\r\n"); - HAL_UART_Transmit(&huart2, "...\r\n", sizeof("...\r\n"), 100); - HAL_UART_Transmit(&huart2, buff, sizeof(buff), 100); - PDEBUG("hello darkness my old friend\r\n"); // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); @@ -112,203 +114,264 @@ int main(void) HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); - PDEBUG("ablahablah\n"); - motor_controller_init(); - /* USER CODE END 2 */ + mc_init(); + HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + HAL_TIM_Base_Start_IT(&htim6); + /* USER CODE END 2 */ - /* Infinite loop */ - /* USER CODE BEGIN WHILE */ + /* Infinite loop */ + /* USER CODE BEGIN WHILE */ while (1) { - /* USER CODE END WHILE */ - - /* USER CODE BEGIN 3 */ + mc_service(); + if(b_timer_struck) + { + b_timer_struck = false; + PDEBUG("%d\n", sys_time); + } + /* USER CODE END WHILE */ + + /* USER CODE BEGIN 3 */ } - /* USER CODE END 3 */ + /* USER CODE END 3 */ } /** - * @brief System Clock Configuration - * @retval None - */ + * @brief System Clock Configuration + * @retval None + */ void SystemClock_Config(void) { - RCC_OscInitTypeDef RCC_OscInitStruct = {0}; - RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - - /** Configure the main internal regulator output voltage - */ - if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1) != HAL_OK) - { - Error_Handler(); - } + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; + + /** Configure the main internal regulator output voltage + */ + if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1) != HAL_OK) + { + Error_Handler(); + } + + /** Configure LSE Drive Capability + */ + HAL_PWR_EnableBkUpAccess(); + __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW); + + /** Initializes the RCC Oscillators according to the specified parameters + * in the RCC_OscInitTypeDef structure. + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE|RCC_OSCILLATORTYPE_MSI; + RCC_OscInitStruct.LSEState = RCC_LSE_ON; + RCC_OscInitStruct.MSIState = RCC_MSI_ON; + RCC_OscInitStruct.MSICalibrationValue = 0; + RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI; + RCC_OscInitStruct.PLL.PLLM = 1; + RCC_OscInitStruct.PLL.PLLN = 16; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV7; + RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; + RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) + { + Error_Handler(); + } + + /** Initializes the CPU, AHB and APB buses clocks + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK + |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) + { + Error_Handler(); + } + + /** Enable MSI Auto calibration + */ + HAL_RCCEx_EnableMSIPLLMode(); +} - /** Configure LSE Drive Capability - */ - HAL_PWR_EnableBkUpAccess(); - __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW); - - /** Initializes the RCC Oscillators according to the specified parameters - * in the RCC_OscInitTypeDef structure. - */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE | RCC_OSCILLATORTYPE_MSI; - RCC_OscInitStruct.LSEState = RCC_LSE_ON; - RCC_OscInitStruct.MSIState = RCC_MSI_ON; - RCC_OscInitStruct.MSICalibrationValue = 0; - RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI; - RCC_OscInitStruct.PLL.PLLM = 1; - RCC_OscInitStruct.PLL.PLLN = 16; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV7; - RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; - RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) - { - Error_Handler(); - } +/** + * @brief TIM2 Initialization Function + * @param None + * @retval None + */ +static void MX_TIM2_Init(void) +{ - /** Initializes the CPU, AHB and APB buses clocks - */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + /* USER CODE BEGIN TIM2_Init 0 */ + + /* USER CODE END TIM2_Init 0 */ + + TIM_MasterConfigTypeDef sMasterConfig = {0}; + TIM_OC_InitTypeDef sConfigOC = {0}; + + /* USER CODE BEGIN TIM2_Init 1 */ + + /* USER CODE END TIM2_Init 1 */ + htim2.Instance = TIM2; + htim2.Init.Prescaler = 127; + htim2.Init.CounterMode = TIM_COUNTERMODE_UP; + htim2.Init.Period = 499; + htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_PWM_Init(&htim2) != HAL_OK) + { + Error_Handler(); + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_PWM1; + sConfigOC.Pulse = 250; + sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; + sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; + if (HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_2) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.Pulse = 125; + if (HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_4) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM2_Init 2 */ + + /* USER CODE END TIM2_Init 2 */ + HAL_TIM_MspPostInit(&htim2); - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) - { - Error_Handler(); - } - - /** Enable MSI Auto calibration - */ - HAL_RCCEx_EnableMSIPLLMode(); } /** - * @brief TIM2 Initialization Function - * @param None - * @retval None - */ -static void MX_TIM2_Init(void) + * @brief TIM6 Initialization Function + * @param None + * @retval None + */ +static void MX_TIM6_Init(void) { - /* USER CODE BEGIN TIM2_Init 0 */ + /* USER CODE BEGIN TIM6_Init 0 */ - /* USER CODE END TIM2_Init 0 */ + /* USER CODE END TIM6_Init 0 */ - TIM_MasterConfigTypeDef sMasterConfig = {0}; - TIM_OC_InitTypeDef sConfigOC = {0}; + TIM_MasterConfigTypeDef sMasterConfig = {0}; - /* USER CODE BEGIN TIM2_Init 1 */ + /* USER CODE BEGIN TIM6_Init 1 */ - /* USER CODE END TIM2_Init 1 */ - htim2.Instance = TIM2; - htim2.Init.Prescaler = 127; - htim2.Init.CounterMode = TIM_COUNTERMODE_UP; - htim2.Init.Period = 499; - htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - if (HAL_TIM_PWM_Init(&htim2) != HAL_OK) - { - Error_Handler(); - } - sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; - sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; - if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_PWM1; - sConfigOC.Pulse = 250; - sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; - sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; - if (HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_2) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.Pulse = 125; - if (HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_4) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN TIM2_Init 2 */ + /* USER CODE END TIM6_Init 1 */ + htim6.Instance = TIM6; + htim6.Init.Prescaler = 127; + htim6.Init.CounterMode = TIM_COUNTERMODE_UP; + htim6.Init.Period = 999; + htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; + if (HAL_TIM_Base_Init(&htim6) != HAL_OK) + { + Error_Handler(); + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + if (HAL_TIMEx_MasterConfigSynchronization(&htim6, &sMasterConfig) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM6_Init 2 */ + + /* USER CODE END TIM6_Init 2 */ - /* USER CODE END TIM2_Init 2 */ - HAL_TIM_MspPostInit(&htim2); } /** - * @brief USART2 Initialization Function - * @param None - * @retval None - */ + * @brief USART2 Initialization Function + * @param None + * @retval None + */ static void MX_USART2_UART_Init(void) { - /* USER CODE BEGIN USART2_Init 0 */ + /* USER CODE BEGIN USART2_Init 0 */ - /* USER CODE END USART2_Init 0 */ + /* USER CODE END USART2_Init 0 */ - /* USER CODE BEGIN USART2_Init 1 */ + /* USER CODE BEGIN USART2_Init 1 */ - /* USER CODE END USART2_Init 1 */ - huart2.Instance = USART2; - huart2.Init.BaudRate = 115200; - huart2.Init.WordLength = UART_WORDLENGTH_8B; - huart2.Init.StopBits = UART_STOPBITS_1; - huart2.Init.Parity = UART_PARITY_NONE; - huart2.Init.Mode = UART_MODE_TX_RX; - huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; - huart2.Init.OverSampling = UART_OVERSAMPLING_16; - huart2.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; - huart2.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; - if (HAL_UART_Init(&huart2) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN USART2_Init 2 */ + /* USER CODE END USART2_Init 1 */ + huart2.Instance = USART2; + huart2.Init.BaudRate = 115200; + huart2.Init.WordLength = UART_WORDLENGTH_8B; + huart2.Init.StopBits = UART_STOPBITS_1; + huart2.Init.Parity = UART_PARITY_NONE; + huart2.Init.Mode = UART_MODE_TX_RX; + huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; + huart2.Init.OverSampling = UART_OVERSAMPLING_16; + huart2.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; + huart2.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; + if (HAL_UART_Init(&huart2) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN USART2_Init 2 */ + + /* USER CODE END USART2_Init 2 */ - /* USER CODE END USART2_Init 2 */ } /** - * @brief GPIO Initialization Function - * @param None - * @retval None - */ + * @brief GPIO Initialization Function + * @param None + * @retval None + */ static void MX_GPIO_Init(void) { - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOA, m1_dir_Pin | m2_dir_Pin | GPIO_PIN_8 | GPIO_PIN_9, GPIO_PIN_RESET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(LD3_GPIO_Port, LD3_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pins : m1_dir_Pin m2_dir_Pin PA8 PA9 */ - GPIO_InitStruct.Pin = m1_dir_Pin | m2_dir_Pin | GPIO_PIN_8 | GPIO_PIN_9; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /*Configure GPIO pin : LD3_Pin */ - GPIO_InitStruct.Pin = LD3_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LD3_GPIO_Port, &GPIO_InitStruct); + GPIO_InitTypeDef GPIO_InitStruct = {0}; + + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOA, m1_dir_Pin|m2_dir_Pin|GPIO_PIN_8|GPIO_PIN_9, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(LD3_GPIO_Port, LD3_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pins : m1_dir_Pin m2_dir_Pin PA8 PA9 */ + GPIO_InitStruct.Pin = m1_dir_Pin|m2_dir_Pin|GPIO_PIN_8|GPIO_PIN_9; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /*Configure GPIO pin : LD3_Pin */ + GPIO_InitStruct.Pin = LD3_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(LD3_GPIO_Port, &GPIO_InitStruct); + } /* USER CODE BEGIN 4 */ +void HAL_UART_RxCpltCallback(UART_HandleTypeDef* huart) +{ + HAL_UART_Transmit(&huart2, &huart2_rxc, 1, 100); + HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); +} + +void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef* htim) +{ + sys_time += 4; + b_timer_struck = true; +} + void setPWM(TIM_HandleTypeDef *timer, uint32_t channel, uint8_t dc_percent) { HAL_TIM_PWM_Stop(timer, channel); @@ -327,33 +390,33 @@ void setPWM(TIM_HandleTypeDef *timer, uint32_t channel, uint8_t dc_percent) /* USER CODE END 4 */ /** - * @brief This function is executed in case of error occurrence. - * @retval None - */ + * @brief This function is executed in case of error occurrence. + * @retval None + */ void Error_Handler(void) { - /* USER CODE BEGIN Error_Handler_Debug */ + /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while (1) { } - /* USER CODE END Error_Handler_Debug */ + /* USER CODE END Error_Handler_Debug */ } -#ifdef USE_FULL_ASSERT +#ifdef USE_FULL_ASSERT /** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ + * @brief Reports the name of the source file and the source line number + * where the assert_param error has occurred. + * @param file: pointer to the source file name + * @param line: assert_param error line source number + * @retval None + */ void assert_failed(uint8_t *file, uint32_t line) { - /* USER CODE BEGIN 6 */ + /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ + /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */ diff --git a/Core/Src/stm32l4xx_hal_msp.c b/Core/Src/stm32l4xx_hal_msp.c index 89cb1b2..c332fa4 100644 --- a/Core/Src/stm32l4xx_hal_msp.c +++ b/Core/Src/stm32l4xx_hal_msp.c @@ -100,6 +100,31 @@ void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef* htim_pwm) } +/** +* @brief TIM_Base MSP Initialization +* This function configures the hardware resources used in this example +* @param htim_base: TIM_Base handle pointer +* @retval None +*/ +void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base) +{ + if(htim_base->Instance==TIM6) + { + /* USER CODE BEGIN TIM6_MspInit 0 */ + + /* USER CODE END TIM6_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_TIM6_CLK_ENABLE(); + /* TIM6 interrupt Init */ + HAL_NVIC_SetPriority(TIM6_DAC_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn); + /* USER CODE BEGIN TIM6_MspInit 1 */ + + /* USER CODE END TIM6_MspInit 1 */ + } + +} + void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim) { GPIO_InitTypeDef GPIO_InitStruct = {0}; @@ -149,6 +174,31 @@ void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef* htim_pwm) } +/** +* @brief TIM_Base MSP De-Initialization +* This function freeze the hardware resources used in this example +* @param htim_base: TIM_Base handle pointer +* @retval None +*/ +void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base) +{ + if(htim_base->Instance==TIM6) + { + /* USER CODE BEGIN TIM6_MspDeInit 0 */ + + /* USER CODE END TIM6_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM6_CLK_DISABLE(); + + /* TIM6 interrupt DeInit */ + HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn); + /* USER CODE BEGIN TIM6_MspDeInit 1 */ + + /* USER CODE END TIM6_MspDeInit 1 */ + } + +} + /** * @brief UART MSP Initialization * This function configures the hardware resources used in this example diff --git a/Core/Src/stm32l4xx_it.c b/Core/Src/stm32l4xx_it.c index 90661e8..8c5c79d 100644 --- a/Core/Src/stm32l4xx_it.c +++ b/Core/Src/stm32l4xx_it.c @@ -55,6 +55,7 @@ /* USER CODE END 0 */ /* External variables --------------------------------------------------------*/ +extern TIM_HandleTypeDef htim6; extern UART_HandleTypeDef huart2; /* USER CODE BEGIN EV */ @@ -212,6 +213,20 @@ void USART2_IRQHandler(void) /* USER CODE END USART2_IRQn 1 */ } +/** + * @brief This function handles TIM6 global interrupt, DAC channel1 and channel2 underrun error interrupts. + */ +void TIM6_DAC_IRQHandler(void) +{ + /* USER CODE BEGIN TIM6_DAC_IRQn 0 */ + + /* USER CODE END TIM6_DAC_IRQn 0 */ + HAL_TIM_IRQHandler(&htim6); + /* USER CODE BEGIN TIM6_DAC_IRQn 1 */ + + /* USER CODE END TIM6_DAC_IRQn 1 */ +} + /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ diff --git a/Makefile b/Makefile index 89ac747..29e0ecc 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ ########################################################################################################################## -# File automatically-generated by tool: [projectgenerator] version: [3.16.0] date: [Thu Mar 31 16:32:43 CDT 2022] +# File automatically-generated by tool: [projectgenerator] version: [3.16.0] date: [Fri Apr 01 16:10:25 CDT 2022] ########################################################################################################################## # ------------------------------------------------ @@ -134,7 +134,7 @@ ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffuncti CFLAGS += $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections ifeq ($(DEBUG), 1) -CFLAGS += -g -gdwarf-2 -D_DEBUG +CFLAGS += -g3 -gdwarf-2 -D_DEBUG endif diff --git a/compile_commands.json b/compile_commands.json index 6efc2d2..2105a25 100644 --- a/compile_commands.json +++ b/compile_commands.json @@ -22,38 +22,9 @@ "-Wall", "-fdata-sections", "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_dma.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_dma.lst", - "-o", - "build/stm32l4xx_hal_dma.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", + "-g3", + "-gdwarf-2", + "-D_DEBUG", "-MFbuild/main.d", "-Wa,-a,-ad,-alms=build/main.lst", "-o", @@ -62,677 +33,5 @@ ], "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", "file": "Core/Src/main.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_uart_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_uart_ex.lst", - "-o", - "build/stm32l4xx_hal_uart_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_pwr.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_pwr.lst", - "-o", - "build/stm32l4xx_hal_pwr.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_tim_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_tim_ex.lst", - "-o", - "build/stm32l4xx_hal_tim_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_flash_ramfunc.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_flash_ramfunc.lst", - "-o", - "build/stm32l4xx_hal_flash_ramfunc.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_tim.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_tim.lst", - "-o", - "build/stm32l4xx_hal_tim.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/system_stm32l4xx.d", - "-Wa,-a,-ad,-alms=build/system_stm32l4xx.lst", - "-o", - "build/system_stm32l4xx.o", - "Core/Src/system_stm32l4xx.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Core/Src/system_stm32l4xx.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_exti.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_exti.lst", - "-o", - "build/stm32l4xx_hal_exti.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_dma_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_dma_ex.lst", - "-o", - "build/stm32l4xx_hal_dma_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_i2c.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_i2c.lst", - "-o", - "build/stm32l4xx_hal_i2c.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal.lst", - "-o", - "build/stm32l4xx_hal.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_i2c_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_i2c_ex.lst", - "-o", - "build/stm32l4xx_hal_i2c_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_msp.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_msp.lst", - "-o", - "build/stm32l4xx_hal_msp.o", - "Core/Src/stm32l4xx_hal_msp.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Core/Src/stm32l4xx_hal_msp.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_flash.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_flash.lst", - "-o", - "build/stm32l4xx_hal_flash.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_rcc.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_rcc.lst", - "-o", - "build/stm32l4xx_hal_rcc.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_flash_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_flash_ex.lst", - "-o", - "build/stm32l4xx_hal_flash_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_pwr_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_pwr_ex.lst", - "-o", - "build/stm32l4xx_hal_pwr_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_cortex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_cortex.lst", - "-o", - "build/stm32l4xx_hal_cortex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_rcc_ex.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_rcc_ex.lst", - "-o", - "build/stm32l4xx_hal_rcc_ex.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_gpio.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_gpio.lst", - "-o", - "build/stm32l4xx_hal_gpio.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_hal_uart.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_hal_uart.lst", - "-o", - "build/stm32l4xx_hal_uart.o", - "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c" - }, - { - "arguments": [ - "arm-none-eabi-gcc", - "-c", - "-mcpu=cortex-m4", - "-mthumb", - "-mfpu=fpv4-sp-d16", - "-mfloat-abi=hard", - "-DUSE_HAL_DRIVER", - "-DSTM32L432xx", - "-ICore/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc", - "-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy", - "-IDrivers/CMSIS/Device/ST/STM32L4xx/Include", - "-IDrivers/CMSIS/Include", - "-Ishared", - "-Ishared/devices", - "-Ishared/drivers", - "-Ishared/util", - "-Og", - "-Wall", - "-fdata-sections", - "-ffunction-sections", - "-MFbuild/stm32l4xx_it.d", - "-Wa,-a,-ad,-alms=build/stm32l4xx_it.lst", - "-o", - "build/stm32l4xx_it.o", - "Core/Src/stm32l4xx_it.c" - ], - "directory": "/storage/Shared/Projects/stm32_projects/motor_controller", - "file": "Core/Src/stm32l4xx_it.c" } ] \ No newline at end of file diff --git a/gdb.txt b/gdb.txt index 7ac1da1..4cd6bd1 100644 --- a/gdb.txt +++ b/gdb.txt @@ -821,3 +821,3622 @@ A debugging session is active. Quit anyway? (y or n) [answered Y; input not from terminal] [Inferior 1 (Remote target) detached] +0x080008d6 in ?? () +### Assembly ######################################################################################################## + 0x080008d6 ? b.n 0x80008d6 + 0x080008d8 ? lsls r0, r3, #3 + 0x080008da ? movs r0, #0 + 0x080008dc ? subs r0, #184 ; 0xb8 + 0x080008de ? lsrs r0, r0, #32 + 0x080008e0 ? subs r0, #220 ; 0xdc + 0x080008e2 ? lsrs r0, r0, #32 + 0x080008e4 ? subs r0, #228 ; 0xe4 + 0x080008e6 ? lsrs r0, r0, #32 + 0x080008e8 ? lsls r4, r1, #2 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x080038d8 r10 0x00000000 pc 0x080008d6 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00600090 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000020 r8 0x00000000 sp 0x2000fef8 msp 0x2000fef8 control 0x04 + r4 0x2000008c r9 0x00000000 lr 0x080008d7 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x080008d6 +### Threads ######################################################################################################### +[1] id 0 from 0x080008d6 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .sec1, size 0x3c80 lma 0x8000000 +Start address 0x08002fc4, load size 15488 +Transfer rate: 18 KB/sec, 15488 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +warning: No executable has been specified and target does not support +determining executable automatically. Try using the "file" command. +0x080008be in ?? () +### Assembly ############################################################################################################################################### + 0x080008be ? b.n 0x80008be + 0x080008c0 ? lsls r0, r3, #3 + 0x080008c2 ? movs r0, #0 + 0x080008c4 ? lsls r4, r1, #2 + 0x080008c6 ? movs r0, #0 + 0x080008c8 ? lsls r4, r3, #5 + 0x080008ca ? movs r0, #0 + 0x080008cc ? b.n 0x80008cc + 0x080008ce ? b.n 0x80008ce + 0x080008d0 ? b.n 0x80008d0 +### Breakpoints ############################################################################################################################################ +### Expressions ############################################################################################################################################ +### History ################################################################################################################################################ +### Memory ################################################################################################################################################# +### Registers ############################################################################################################################################## + r0 0x00000000 r4 0x200000d8 r8 0x00000000 r12 0x00001000 xPSR 0x61000000 primask 0x00 + r1 0x00000000 r5 0x2000008c r9 0x00000000 sp 0x2000fff8 fpscr 0x00000010 basepri 0x00 + r2 0x40004400 r6 0x00000000 r10 0x00000000 lr 0x08002f1d msp 0x2000fff8 faultmask 0x00 + r3 0x40000000 r7 0x00000000 r11 0x00000000 pc 0x080008be psp 0x00000000 control 0x04 +### Source ################################################################################################################################################# +### Stack ################################################################################################################################################## +[0] from 0x080008be +[1] from 0x08002f1c +### Threads ################################################################################################################################################ +[1] id 0 from 0x080008be +### Variables ############################################################################################################################################## +############################################################################################################################################################ +generic_push.gdb:7: Error in sourced command file: +No executable file specified. +Use the "file" or "exec-file" command. +Please answer y or n. +Detaching from program: , Remote target +[Inferior 1 (Remote target) detached] +warning: No executable has been specified and target does not support +determining executable automatically. Try using the "file" command. +0x080008be in ?? () +### Assembly ######################################################################################################## + 0x080008be ? b.n 0x80008be + 0x080008c0 ? lsls r0, r3, #3 + 0x080008c2 ? movs r0, #0 + 0x080008c4 ? lsls r4, r1, #2 + 0x080008c6 ? movs r0, #0 + 0x080008c8 ? lsls r4, r3, #5 + 0x080008ca ? movs r0, #0 + 0x080008cc ? b.n 0x80008cc + 0x080008ce ? b.n 0x80008ce + 0x080008d0 ? b.n 0x80008d0 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x2000008c r10 0x00000000 pc 0x080008be primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40004400 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x200000d8 r9 0x00000000 lr 0x08002f1d psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x080008be +[1] from 0x08002f1c +### Threads ######################################################################################################### +[1] id 0 from 0x080008be +### Variables ####################################################################################################### +##################################################################################################################### +generic_push.gdb:7: Error in sourced command file: +No executable file specified. +Use the "file" or "exec-file" command. +Detaching from program: , Remote target +Remote connection closed +generic_push.gdb:6: Error in sourced command file: +localhost:3333: Connection timed out. +0x080008be in ?? () +### Assembly ######################################################################################################## + 0x080008be ? b.n 0x80008be + 0x080008c0 ? lsls r0, r3, #3 + 0x080008c2 ? movs r0, #0 + 0x080008c4 ? lsls r4, r1, #2 + 0x080008c6 ? movs r0, #0 + 0x080008c8 ? lsls r4, r3, #5 + 0x080008ca ? movs r0, #0 + 0x080008cc ? b.n 0x80008cc + 0x080008ce ? b.n 0x80008ce + 0x080008d0 ? b.n 0x80008d0 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x2000008c r10 0x00000000 pc 0x080008be primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40004400 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x200000d8 r9 0x00000000 lr 0x08002f1d psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x080008be +[1] from 0x08002f1c +### Threads ######################################################################################################### +[1] id 0 from 0x080008be +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .sec1, size 0x40d0 lma 0x8000000 +Start address 0x08003414, load size 16592 +Transfer rate: 19 KB/sec, 8296 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +0x0800098e in ?? () +### Assembly ######################################################################################################## + 0x0800098e ? cmp r3, #0 + 0x08000990 ? beq.n 0x8000986 + 0x08000992 ? ldr r3, [pc, #28] ; (0x80009b0) + 0x08000994 ? movs r2, #0 + 0x08000996 ? strb r2, [r3, #0] + 0x08000998 ? ldr r3, [pc, #24] ; (0x80009b4) + 0x0800099a ? ldr r1, [r3, #0] + 0x0800099c ? ldr r0, [pc, #24] ; (0x80009b8) + 0x0800099e ? bl 0x800339c + 0x080009a2 ? b.n 0x8000986 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800098e primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40004400 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800098b psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x0800098e +[1] from 0x0800098a +### Threads ######################################################################################################### +[1] id 0 from 0x0800098e +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .sec1, size 0x4148 lma 0x8000000 +Start address 0x0800348c, load size 16712 +Transfer rate: 19 KB/sec, 8356 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +0x08000990 in ?? () +### Assembly ######################################################################################################## + 0x08000990 ? ldr r3, [pc, #40] ; (0x80009bc) + 0x08000992 ? ldrb r3, [r3, #0] + 0x08000994 ? cmp r3, #0 + 0x08000996 ? beq.n 0x800098c + 0x08000998 ? ldr r3, [pc, #32] ; (0x80009bc) + 0x0800099a ? movs r2, #0 + 0x0800099c ? strb r2, [r3, #0] + 0x0800099e ? ldr r3, [pc, #32] ; (0x80009c0) + 0x080009a0 ? ldr r1, [r3, #0] + 0x080009a2 ? ldr r0, [pc, #32] ; (0x80009c4) +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000990 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000991 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08000990 +### Threads ######################################################################################################### +[1] id 0 from 0x08000990 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .sec1, size 0x4148 lma 0x8000000 +Start address 0x0800348c, load size 16712 +Transfer rate: 19 KB/sec, 8356 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +0x0800098c in ?? () +### Assembly ######################################################################################################## + 0x0800098c ? bl 0x800348a + 0x08000990 ? ldr r3, [pc, #40] ; (0x80009bc) + 0x08000992 ? ldrb r3, [r3, #0] + 0x08000994 ? cmp r3, #0 + 0x08000996 ? beq.n 0x800098c + 0x08000998 ? ldr r3, [pc, #32] ; (0x80009bc) + 0x0800099a ? movs r2, #0 + 0x0800099c ? strb r2, [r3, #0] + 0x0800099e ? ldr r3, [pc, #32] ; (0x80009c0) + 0x080009a0 ? ldr r1, [r3, #0] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800098c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000991 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x0800098c +[1] from 0x08000990 +### Threads ######################################################################################################### +[1] id 0 from 0x0800098c +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .sec1, size 0x4148 lma 0x8000000 +Start address 0x0800348c, load size 16712 +Transfer rate: 19 KB/sec, 8356 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +0x08000996 in ?? () +### Assembly ######################################################################################################## + 0x08000996 ? beq.n 0x800098c + 0x08000998 ? ldr r3, [pc, #32] ; (0x80009bc) + 0x0800099a ? movs r2, #0 + 0x0800099c ? strb r2, [r3, #0] + 0x0800099e ? ldr r3, [pc, #32] ; (0x80009c0) + 0x080009a0 ? ldr r1, [r3, #0] + 0x080009a2 ? ldr r0, [pc, #32] ; (0x80009c4) + 0x080009a4 ? bl 0x8003414 + 0x080009a8 ? b.n 0x800098c + 0x080009aa ? nop +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000996 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000991 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08000996 +[1] from 0x08000990 +### Threads ######################################################################################################### +[1] id 0 from 0x08000996 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .sec1, size 0x4148 lma 0x8000000 +Start address 0x0800348c, load size 16712 +Transfer rate: 19 KB/sec, 8356 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +0x0800348a in ?? () +### Assembly ######################################################################################################## + 0x0800348a ? bx lr + 0x0800348c ? ldr.w sp, [pc, #52] ; 0x80034c4 + 0x08003490 ? bl 0x8003400 + 0x08003494 ? ldr r0, [pc, #48] ; (0x80034c8) + 0x08003496 ? ldr r1, [pc, #52] ; (0x80034cc) + 0x08003498 ? ldr r2, [pc, #52] ; (0x80034d0) + 0x0800349a ? movs r3, #0 + 0x0800349c ? b.n 0x80034a4 + 0x0800349e ? ldr r4, [r2, r3] + 0x080034a0 ? str r4, [r0, r3] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800348a primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000991 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x0800348a +[1] from 0x08000990 +### Threads ######################################################################################################### +[1] id 0 from 0x0800348a +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .sec1, size 0x4148 lma 0x8000000 +Start address 0x0800348c, load size 16712 +Transfer rate: 19 KB/sec, 8356 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +0x08000990 in ?? () +### Assembly ######################################################################################################## + 0x08000990 ? ldr r3, [pc, #40] ; (0x80009bc) + 0x08000992 ? ldrb r3, [r3, #0] + 0x08000994 ? cmp r3, #0 + 0x08000996 ? beq.n 0x800098c + 0x08000998 ? ldr r3, [pc, #32] ; (0x80009bc) + 0x0800099a ? movs r2, #0 + 0x0800099c ? strb r2, [r3, #0] + 0x0800099e ? ldr r3, [pc, #32] ; (0x80009c0) + 0x080009a0 ? ldr r1, [r3, #0] + 0x080009a2 ? ldr r0, [pc, #32] ; (0x80009c4) +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000990 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000991 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08000990 +### Threads ######################################################################################################### +[1] id 0 from 0x08000990 +### Variables ####################################################################################################### +##################################################################################################################### +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +target halted due to debug-request, current mode: Thread +xPSR: 0x01000000 pc: 0x0800348c msp: 0x20010000 +Loading section .sec1, size 0x4158 lma 0x8000000 +Start address 0x08003494, load size 16728 +Transfer rate: 19 KB/sec, 8364 bytes/write. +No symbol table is loaded. Use the "file" command. +Quit +Reading symbols from build/motor_controller.hex... +(No debugging symbols found in build/motor_controller.hex) +Detaching from program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.hex, Remote target +[Inferior 1 (Remote target) detached] +0x08003494 in ?? () +### Assembly ######################################################################################################## + 0x08003494 ? ldr.w sp, [pc, #52] ; 0x80034cc + 0x08003498 ? bl 0x8003400 + 0x0800349c ? ldr r0, [pc, #48] ; (0x80034d0) + 0x0800349e ? ldr r1, [pc, #52] ; (0x80034d4) + 0x080034a0 ? ldr r2, [pc, #52] ; (0x80034d8) + 0x080034a2 ? movs r3, #0 + 0x080034a4 ? b.n 0x80034ac + 0x080034a6 ? ldr r4, [r2, r3] + 0x080034a8 ? str r4, [r0, r3] + 0x080034aa ? adds r3, #4 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x08003494 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00000000 fpscr 0x00000000 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x20010000 msp 0x20010000 control 0x00 + r4 0x00000000 r9 0x00000000 lr 0xffffffff psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08003494 +[1] from 0xfffffffe +### Threads ######################################################################################################### +[1] id 0 from 0x08003494 +### Variables ####################################################################################################### +##################################################################################################################### +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +target halted due to debug-request, current mode: Thread +xPSR: 0x01000000 pc: 0x08003494 msp: 0x20010000 +Loading section .sec1, size 0x4158 lma 0x8000000 +Start address 0x08003494, load size 16728 +Transfer rate: 19 KB/sec, 8364 bytes/write. +Starting program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.hex +### Output/messages ################################################################################################# + +Program received signal SIGINT, Interrupt. +0x08003492 in ?? () +### Assembly ######################################################################################################## + 0x08003492 ? bx lr + 0x08003494 ? ldr.w sp, [pc, #52] ; 0x80034cc + 0x08003498 ? bl 0x8003400 + 0x0800349c ? ldr r0, [pc, #48] ; (0x80034d0) + 0x0800349e ? ldr r1, [pc, #52] ; (0x80034d4) + 0x080034a0 ? ldr r2, [pc, #52] ; (0x80034d8) + 0x080034a2 ? movs r3, #0 + 0x080034a4 ? b.n 0x80034ac + 0x080034a6 ? ldr r4, [r2, r3] + 0x080034a8 ? str r4, [r0, r3] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08003492 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000991 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08003492 +[1] from 0x08000990 +### Threads ######################################################################################################### +[1] id 0 from 0x08003492 +### Variables ####################################################################################################### +##################################################################################################################### +Detaching from program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.hex, Remote target +[Inferior 1 (Remote target) detached] +0x08003492 in ?? () +### Assembly ######################################################################################################## + 0x08003492 ? bx lr + 0x08003494 ? ldr.w sp, [pc, #52] ; 0x80034cc + 0x08003498 ? bl 0x8003400 + 0x0800349c ? ldr r0, [pc, #48] ; (0x80034d0) + 0x0800349e ? ldr r1, [pc, #52] ; (0x80034d4) + 0x080034a0 ? ldr r2, [pc, #52] ; (0x80034d8) + 0x080034a2 ? movs r3, #0 + 0x080034a4 ? b.n 0x80034ac + 0x080034a6 ? ldr r4, [r2, r3] + 0x080034a8 ? str r4, [r0, r3] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08003492 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000991 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08003492 +[1] from 0x08000990 +### Threads ######################################################################################################### +[1] id 0 from 0x08003492 +### Variables ####################################################################################################### +##################################################################################################################### +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +target halted due to debug-request, current mode: Thread +xPSR: 0x01000000 pc: 0x08003494 msp: 0x20010000 +Loading section .sec1, size 0x4158 lma 0x8000000 +Start address 0x08003494, load size 16728 +Transfer rate: 19 KB/sec, 8364 bytes/write. +Starting program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.hex +### Output/messages ################################################################################################# + +Program received signal SIGINT, Interrupt. +0x08000990 in ?? () +### Assembly ######################################################################################################## + 0x08000990 ? ldr r3, [pc, #40] ; (0x80009bc) + 0x08000992 ? ldrb r3, [r3, #0] + 0x08000994 ? cmp r3, #0 + 0x08000996 ? beq.n 0x800098c + 0x08000998 ? ldr r3, [pc, #32] ; (0x80009bc) + 0x0800099a ? movs r2, #0 + 0x0800099c ? strb r2, [r3, #0] + 0x0800099e ? ldr r3, [pc, #32] ; (0x80009c0) + 0x080009a0 ? ldr r1, [r3, #0] + 0x080009a2 ? ldr r0, [pc, #32] ; (0x80009c4) +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000990 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000991 psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x08000990 +### Threads ######################################################################################################### +[1] id 0 from 0x08000990 +### Variables ####################################################################################################### +##################################################################################################################### +Detaching from program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.hex, Remote target +[Inferior 1 (Remote target) detached] +main () at Core/Src/main.c:127 +127 if(b_timer_struck) +### Assembly ######################################################################################################## + 0x08000980 main+88 mov r0, r4 + 0x08000982 main+90 bl 0x80033a0 + 0x08000986 main+94 ldr r0, [pc, #48] ; (0x80009b8 ) + 0x08000988 main+96 bl 0x8000d94 + 0x0800098c main+100 bl 0x8003492 + 0x08000990 main+104 ldr r3, [pc, #40] ; (0x80009bc ) + 0x08000992 main+106 ldrb r3, [r3, #0] + 0x08000994 main+108 cmp r3, #0 + 0x08000996 main+110 beq.n 0x800098c + 0x08000998 main+112 ldr r3, [pc, #32] ; (0x80009bc ) +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000990 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000991 psp 0x00000000 +### Source ########################################################################################################## + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { + 129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } + 136 /* USER CODE END 3 */ +### Stack ########################################################################################################### +[0] from 0x08000990 in main+104 at Core/Src/main.c:127 +### Threads ######################################################################################################### +[1] id 0 from 0x08000990 in main+104 at Core/Src/main.c:127 +### Variables ####################################################################################################### +##################################################################################################################### +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +target halted due to debug-request, current mode: Thread +xPSR: 0x01000000 pc: 0x08003494 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x3e78 lma 0x8000190 +Loading section .rodata, size 0xc8 lma 0x8004008 +Loading section .ARM, size 0x8 lma 0x80040d0 +Loading section .init_array, size 0x8 lma 0x80040d8 +Loading section .fini_array, size 0x8 lma 0x80040e0 +Loading section .data, size 0x70 lma 0x80040e8 +Start address 0x08003494, load size 16728 +Transfer rate: 19 KB/sec, 2091 bytes/write. +Breakpoint 1 at 0x8000928: file Core/Src/main.c, line 80. +Note: automatically using hardware breakpoints for read-only addresses. +Starting program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Breakpoint 1, main () at Core/Src/main.c:80 +80 { +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ +!0x08000928 main+0 push {r3, lr} + 0x0800092a main+2 bl 0x800165c + 0x0800092e main+6 bl 0x800088c + 0x08000932 main+10 bl 0x80005dc + 0x08000936 main+14 bl 0x8000708 +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000070 r5 0x00000000 r10 0x00000000 pc 0x08000928 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x200001cc r7 0x00000000 r12 0x00000000 fpscr 0x00000000 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x20010000 msp 0x20010000 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x080034cb psp 0x00000000 +### Source ########################################################################################################## + 70 /* Private user code ---------------------------------------------------------*/ + 71 /* USER CODE BEGIN 0 */ + 72 + 73 /* USER CODE END 0 */ + 74 + 75 /** + 76 * @brief The application entry point. + 77 * @retval int + 78 */ + 79 int main(void) +!80 { + 81 /* USER CODE BEGIN 1 */ + 82 + 83 /* USER CODE END 1 */ + 84 + 85 /* MCU Configuration--------------------------------------------------------*/ + 86 + 87 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + 88 HAL_Init(); + 89 +### Stack ########################################################################################################### +[0] from 0x08000928 in main+0 at Core/Src/main.c:80 +### Threads ######################################################################################################### +[1] id 0 from 0x08000928 in main+0 at Core/Src/main.c:80 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800092a +88 HAL_Init(); +### Assembly ######################################################################################################## +~ +~ +~ +~ +!0x08000928 main+0 push {r3, lr} + 0x0800092a main+2 bl 0x800165c + 0x0800092e main+6 bl 0x800088c + 0x08000932 main+10 bl 0x80005dc + 0x08000936 main+14 bl 0x8000708 + 0x0800093a main+18 bl 0x800079c +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000070 r5 0x00000000 r10 0x00000000 pc 0x0800092a primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x200001cc r7 0x00000000 r12 0x00000000 fpscr 0x00000000 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x080034cb psp 0x00000000 +### Source ########################################################################################################## + 78 */ + 79 int main(void) +!80 { + 81 /* USER CODE BEGIN 1 */ + 82 + 83 /* USER CODE END 1 */ + 84 + 85 /* MCU Configuration--------------------------------------------------------*/ + 86 + 87 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + 88 HAL_Init(); + 89 + 90 /* USER CODE BEGIN Init */ + 91 + 92 /* USER CODE END Init */ + 93 + 94 /* Configure the system clock */ + 95 SystemClock_Config(); + 96 + 97 /* USER CODE BEGIN SysInit */ +### Stack ########################################################################################################### +[0] from 0x0800092a in main+2 at Core/Src/main.c:88 +### Threads ######################################################################################################### +[1] id 0 from 0x0800092a in main+2 at Core/Src/main.c:88 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800165c +95 SystemClock_Config(); +### Assembly ######################################################################################################## +~ +~ +~ +!0x08000928 main+0 push {r3, lr} + 0x0800092a main+2 bl 0x800165c + 0x0800092e main+6 bl 0x800088c + 0x08000932 main+10 bl 0x80005dc + 0x08000936 main+14 bl 0x8000708 + 0x0800093a main+18 bl 0x800079c + 0x0800093e main+22 bl 0x80007d4 +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x0800092e primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000000 basepri 0x00 + r2 0x10000400 r7 0x00000000 r12 0xfffffff0 fpscr 0x00000000 faultmask 0x00 + r3 0x10000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x08001679 psp 0x00000000 +### Source ########################################################################################################## + 85 /* MCU Configuration--------------------------------------------------------*/ + 86 + 87 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + 88 HAL_Init(); + 89 + 90 /* USER CODE BEGIN Init */ + 91 + 92 /* USER CODE END Init */ + 93 + 94 /* Configure the system clock */ + 95 SystemClock_Config(); + 96 + 97 /* USER CODE BEGIN SysInit */ + 98 + 99 /* USER CODE END SysInit */ + 100 + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); +### Stack ########################################################################################################### +[0] from 0x0800092e in main+6 at Core/Src/main.c:95 +### Threads ######################################################################################################### +[1] id 0 from 0x0800092e in main+6 at Core/Src/main.c:95 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800088c +102 MX_GPIO_Init(); +### Assembly ######################################################################################################## +~ +~ +!0x08000928 main+0 push {r3, lr} + 0x0800092a main+2 bl 0x800165c + 0x0800092e main+6 bl 0x800088c + 0x08000932 main+10 bl 0x80005dc + 0x08000936 main+14 bl 0x8000708 + 0x0800093a main+18 bl 0x800079c + 0x0800093e main+22 bl 0x80007d4 + 0x08000942 main+26 ldr r4, [pc, #104] ; (0x80009ac ) +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x08000932 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000000 basepri 0x00 + r2 0x40021000 r7 0x00000000 r12 0xfffffff0 fpscr 0x00000000 faultmask 0x00 + r3 0x0300006f r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x08000911 psp 0x00000000 +### Source ########################################################################################################## + 92 /* USER CODE END Init */ + 93 + 94 /* Configure the system clock */ + 95 SystemClock_Config(); + 96 + 97 /* USER CODE BEGIN SysInit */ + 98 + 99 /* USER CODE END SysInit */ + 100 + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); +### Stack ########################################################################################################### +[0] from 0x08000932 in main+10 at Core/Src/main.c:102 +### Threads ######################################################################################################### +[1] id 0 from 0x08000932 in main+10 at Core/Src/main.c:102 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080005dc +103 MX_TIM2_Init(); +### Assembly ######################################################################################################## +~ +!0x08000928 main+0 push {r3, lr} + 0x0800092a main+2 bl 0x800165c + 0x0800092e main+6 bl 0x800088c + 0x08000932 main+10 bl 0x80005dc + 0x08000936 main+14 bl 0x8000708 + 0x0800093a main+18 bl 0x800079c + 0x0800093e main+22 bl 0x80007d4 + 0x08000942 main+26 ldr r4, [pc, #104] ; (0x80009ac ) + 0x08000944 main+28 mov r0, r4 +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x48000400 r5 0x00000000 r10 0x00000000 pc 0x08000936 primask 0x00 + r1 0x2000ffd4 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000008 r7 0x00000000 r12 0xfffffe3f fpscr 0x00000000 faultmask 0x00 + r3 0x00000004 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x00000006 psp 0x00000000 +### Source ########################################################################################################## + 93 + 94 /* Configure the system clock */ + 95 SystemClock_Config(); + 96 + 97 /* USER CODE BEGIN SysInit */ + 98 + 99 /* USER CODE END SysInit */ + 100 + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); +### Stack ########################################################################################################### +[0] from 0x08000936 in main+14 at Core/Src/main.c:103 +### Threads ######################################################################################################### +[1] id 0 from 0x08000936 in main+14 at Core/Src/main.c:103 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08000708 +104 MX_USART2_UART_Init(); +### Assembly ######################################################################################################## +!0x08000928 main+0 push {r3, lr} + 0x0800092a main+2 bl 0x800165c + 0x0800092e main+6 bl 0x800088c + 0x08000932 main+10 bl 0x80005dc + 0x08000936 main+14 bl 0x8000708 + 0x0800093a main+18 bl 0x800079c + 0x0800093e main+22 bl 0x80007d4 + 0x08000942 main+26 ldr r4, [pc, #104] ; (0x80009ac ) + 0x08000944 main+28 mov r0, r4 + 0x08000946 main+30 bl 0x8003470 +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x48000000 r5 0x00000000 r10 0x00000000 pc 0x0800093a primask 0x00 + r1 0x2000ffac r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x0000000a r7 0x00000000 r12 0xabf5f53b fpscr 0x00000000 faultmask 0x00 + r3 0x00000004 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x00000006 psp 0x00000000 +### Source ########################################################################################################## + 94 /* Configure the system clock */ + 95 SystemClock_Config(); + 96 + 97 /* USER CODE BEGIN SysInit */ + 98 + 99 /* USER CODE END SysInit */ + 100 + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 +### Stack ########################################################################################################### +[0] from 0x0800093a in main+18 at Core/Src/main.c:104 +### Threads ######################################################################################################### +[1] id 0 from 0x0800093a in main+18 at Core/Src/main.c:104 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800079c +105 MX_TIM1_Init(); +### Assembly ######################################################################################################## + 0x0800092a main+2 bl 0x800165c + 0x0800092e main+6 bl 0x800088c + 0x08000932 main+10 bl 0x80005dc + 0x08000936 main+14 bl 0x8000708 + 0x0800093a main+18 bl 0x800079c + 0x0800093e main+22 bl 0x80007d4 + 0x08000942 main+26 ldr r4, [pc, #104] ; (0x80009ac ) + 0x08000944 main+28 mov r0, r4 + 0x08000946 main+30 bl 0x8003470 + 0x0800094a main+34 ldr r5, [pc, #100] ; (0x80009b0 ) +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x0800093e primask 0x00 + r1 0x00400000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0xfffffff0 fpscr 0x00000000 faultmask 0x00 + r3 0x00000004 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x0800325f psp 0x00000000 +### Source ########################################################################################################## + 95 SystemClock_Config(); + 96 + 97 /* USER CODE BEGIN SysInit */ + 98 + 99 /* USER CODE END SysInit */ + 100 + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); +### Stack ########################################################################################################### +[0] from 0x0800093e in main+22 at Core/Src/main.c:105 +### Threads ######################################################################################################### +[1] id 0 from 0x0800093e in main+22 at Core/Src/main.c:105 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080007d4 +107 p_uart_init(&huart2); +### Assembly ######################################################################################################## + 0x0800092e main+6 bl 0x800088c + 0x08000932 main+10 bl 0x80005dc + 0x08000936 main+14 bl 0x8000708 + 0x0800093a main+18 bl 0x800079c + 0x0800093e main+22 bl 0x80007d4 + 0x08000942 main+26 ldr r4, [pc, #104] ; (0x80009ac ) + 0x08000944 main+28 mov r0, r4 + 0x08000946 main+30 bl 0x8003470 + 0x0800094a main+34 ldr r5, [pc, #100] ; (0x80009b0 ) + 0x0800094c main+36 movs r2, #50 ; 0x32 +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x08000942 primask 0x00 + r1 0x02000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x20000090 r7 0x00000000 r12 0xfffffff0 fpscr 0x00000000 faultmask 0x00 + r3 0x02002000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x0800086f psp 0x00000000 +### Source ########################################################################################################## + 97 /* USER CODE BEGIN SysInit */ + 98 + 99 /* USER CODE END SysInit */ + 100 + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 +### Stack ########################################################################################################### +[0] from 0x08000942 in main+26 at Core/Src/main.c:107 +### Threads ######################################################################################################### +[1] id 0 from 0x08000942 in main+26 at Core/Src/main.c:107 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08000944 +halted: PC: 0x08000946 +halted: PC: 0x08003470 +111 setPWM(&htim2, TIM_CHANNEL_2, 50); +### Assembly ######################################################################################################## + 0x0800093a main+18 bl 0x800079c + 0x0800093e main+22 bl 0x80007d4 + 0x08000942 main+26 ldr r4, [pc, #104] ; (0x80009ac ) + 0x08000944 main+28 mov r0, r4 + 0x08000946 main+30 bl 0x8003470 + 0x0800094a main+34 ldr r5, [pc, #100] ; (0x80009b0 ) + 0x0800094c main+36 movs r2, #50 ; 0x32 + 0x0800094e main+38 movs r1, #4 + 0x08000950 main+40 mov r0, r5 + 0x08000952 main+42 bl 0x80006a8 +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x0800094a primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0xfffffff0 fpscr 0x00000000 faultmask 0x00 + r3 0x02002000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x20000128 r9 0x00000000 lr 0x08003483 psp 0x00000000 +### Source ########################################################################################################## + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ +### Stack ########################################################################################################### +[0] from 0x0800094a in main+34 at Core/Src/main.c:111 +### Threads ######################################################################################################### +[1] id 0 from 0x0800094a in main+34 at Core/Src/main.c:111 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800094c +halted: PC: 0x0800094e +halted: PC: 0x08000950 +halted: PC: 0x08000952 +halted: PC: 0x080006a8 +112 setPWM(&htim2, TIM_CHANNEL_4, 25); +### Assembly ######################################################################################################## + 0x0800094a main+34 ldr r5, [pc, #100] ; (0x80009b0 ) + 0x0800094c main+36 movs r2, #50 ; 0x32 + 0x0800094e main+38 movs r1, #4 + 0x08000950 main+40 mov r0, r5 + 0x08000952 main+42 bl 0x80006a8 + 0x08000956 main+46 movs r2, #25 + 0x08000958 main+48 movs r1, #12 + 0x0800095a main+50 mov r0, r5 + 0x0800095c main+52 bl 0x80006a8 + 0x08000960 main+56 movs r2, #1 +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000956 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00000010 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x080013bd psp 0x00000000 +### Source ########################################################################################################## + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 +### Stack ########################################################################################################### +[0] from 0x08000956 in main+46 at Core/Src/main.c:112 +### Threads ######################################################################################################### +[1] id 0 from 0x08000956 in main+46 at Core/Src/main.c:112 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08000958 +halted: PC: 0x0800095a +halted: PC: 0x0800095c +halted: PC: 0x080006a8 +114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); +### Assembly ######################################################################################################## + 0x08000952 main+42 bl 0x80006a8 + 0x08000956 main+46 movs r2, #25 + 0x08000958 main+48 movs r1, #12 + 0x0800095a main+50 mov r0, r5 + 0x0800095c main+52 bl 0x80006a8 + 0x08000960 main+56 movs r2, #1 + 0x08000962 main+58 movs r1, #16 + 0x08000964 main+60 mov.w r0, #1207959552 ; 0x48000000 + 0x08000968 main+64 bl 0x8002628 + 0x0800096c main+68 movs r2, #1 +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000960 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x080013bd psp 0x00000000 +### Source ########################################################################################################## + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ +### Stack ########################################################################################################### +[0] from 0x08000960 in main+56 at Core/Src/main.c:114 +### Threads ######################################################################################################### +[1] id 0 from 0x08000960 in main+56 at Core/Src/main.c:114 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08000962 +halted: PC: 0x08000964 +halted: PC: 0x08000968 +halted: PC: 0x08002628 +115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); +### Assembly ######################################################################################################## + 0x0800095c main+52 bl 0x80006a8 + 0x08000960 main+56 movs r2, #1 + 0x08000962 main+58 movs r1, #16 + 0x08000964 main+60 mov.w r0, #1207959552 ; 0x48000000 + 0x08000968 main+64 bl 0x8002628 + 0x0800096c main+68 movs r2, #1 + 0x0800096e main+70 movs r1, #32 + 0x08000970 main+72 mov.w r0, #1207959552 ; 0x48000000 + 0x08000974 main+76 bl 0x8002628 + 0x08000978 main+80 bl 0x8003490 +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x48000000 r5 0x200000dc r10 0x00000000 pc 0x0800096c primask 0x00 + r1 0x00000010 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800096d psp 0x00000000 +### Source ########################################################################################################## + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) +### Stack ########################################################################################################### +[0] from 0x0800096c in main+68 at Core/Src/main.c:115 +### Threads ######################################################################################################### +[1] id 0 from 0x0800096c in main+68 at Core/Src/main.c:115 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800096e +halted: PC: 0x08000970 +halted: PC: 0x08000974 +halted: PC: 0x08002628 +117 mc_init(); +### Assembly ######################################################################################################## + 0x08000968 main+64 bl 0x8002628 + 0x0800096c main+68 movs r2, #1 + 0x0800096e main+70 movs r1, #32 + 0x08000970 main+72 mov.w r0, #1207959552 ; 0x48000000 + 0x08000974 main+76 bl 0x8002628 + 0x08000978 main+80 bl 0x8003490 + 0x0800097c main+84 movs r2, #1 + 0x0800097e main+86 ldr r1, [pc, #52] ; (0x80009b4 ) + 0x08000980 main+88 mov r0, r4 + 0x08000982 main+90 bl 0x80033a0 +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x48000000 r5 0x200000dc r10 0x00000000 pc 0x08000978 primask 0x00 + r1 0x00000020 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000979 psp 0x00000000 +### Source ########################################################################################################## + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); +### Stack ########################################################################################################### +[0] from 0x08000978 in main+80 at Core/Src/main.c:117 +### Threads ######################################################################################################### +[1] id 0 from 0x08000978 in main+80 at Core/Src/main.c:117 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08003490 +118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); +### Assembly ######################################################################################################## + 0x0800096c main+68 movs r2, #1 + 0x0800096e main+70 movs r1, #32 + 0x08000970 main+72 mov.w r0, #1207959552 ; 0x48000000 + 0x08000974 main+76 bl 0x8002628 + 0x08000978 main+80 bl 0x8003490 + 0x0800097c main+84 movs r2, #1 + 0x0800097e main+86 ldr r1, [pc, #52] ; (0x80009b4 ) + 0x08000980 main+88 mov r0, r4 + 0x08000982 main+90 bl 0x80033a0 + 0x08000986 main+94 ldr r0, [pc, #48] ; (0x80009b8 ) +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x48000000 r5 0x200000dc r10 0x00000000 pc 0x0800097c primask 0x00 + r1 0x00000020 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800097d psp 0x00000000 +### Source ########################################################################################################## + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) +### Stack ########################################################################################################### +[0] from 0x0800097c in main+84 at Core/Src/main.c:118 +### Threads ######################################################################################################### +[1] id 0 from 0x0800097c in main+84 at Core/Src/main.c:118 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800097e +halted: PC: 0x08000980 +halted: PC: 0x08000982 +halted: PC: 0x080033a0 +119 HAL_TIM_Base_Start_IT(&htim1); +### Assembly ######################################################################################################## + 0x08000978 main+80 bl 0x8003490 + 0x0800097c main+84 movs r2, #1 + 0x0800097e main+86 ldr r1, [pc, #52] ; (0x80009b4 ) + 0x08000980 main+88 mov r0, r4 + 0x08000982 main+90 bl 0x80033a0 + 0x08000986 main+94 ldr r0, [pc, #48] ; (0x80009b8 ) + 0x08000988 main+96 bl 0x8000d94 + 0x0800098c main+100 bl 0x8003492 + 0x08000990 main+104 ldr r3, [pc, #40] ; (0x80009bc ) + 0x08000992 main+106 ldrb r3, [r3, #0] +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000986 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40004400 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x080033e5 psp 0x00000000 +### Source ########################################################################################################## + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { +### Stack ########################################################################################################### +[0] from 0x08000986 in main+94 at Core/Src/main.c:119 +### Threads ######################################################################################################### +[1] id 0 from 0x08000986 in main+94 at Core/Src/main.c:119 +### Variables ####################################################################################################### +##################################################################################################################### +Breakpoint 2 at 0x8000998: file Core/Src/main.c, line 129. +Continuing. +### Output/messages ################################################################################################# + +Program received signal SIGINT, Interrupt. +0x08000994 in main () at Core/Src/main.c:127 +127 if(b_timer_struck) +### Assembly ######################################################################################################## + 0x08000986 main+94 ldr r0, [pc, #48] ; (0x80009b8 ) + 0x08000988 main+96 bl 0x8000d94 + 0x0800098c main+100 bl 0x8003492 + 0x08000990 main+104 ldr r3, [pc, #40] ; (0x80009bc ) + 0x08000992 main+106 ldrb r3, [r3, #0] + 0x08000994 main+108 cmp r3, #0 + 0x08000996 main+110 beq.n 0x800098c +!0x08000998 main+112 ldr r3, [pc, #32] ; (0x80009bc ) + 0x0800099a main+114 movs r2, #0 + 0x0800099c main+116 strb r2, [r3, #0] +### Breakpoints ##################################################################################################### +[1] break at 0x08000928 in Core/Src/main.c:80 for main hit 1 time +[2] break at 0x08000998 in Core/Src/main.c:129 for /storage/Shared/Projects/stm32_projects/motor_controller/Core/Src/main.c:129 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000994 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000991 psp 0x00000000 +### Source ########################################################################################################## + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { +!129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } + 136 /* USER CODE END 3 */ +### Stack ########################################################################################################### +[0] from 0x08000994 in main+108 at Core/Src/main.c:127 +### Threads ######################################################################################################### +[1] id 0 from 0x08000994 in main+108 at Core/Src/main.c:127 +### Variables ####################################################################################################### +##################################################################################################################### +Quit +Quit +Undefined command: "qq". Try "help". +Detaching from program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x08000994 in USART2_IRQHandler () at Core/Src/stm32l4xx_it.c:213 +213 } +### Assembly ######################################################################################################## +~ +~ + 0x0800098c USART2_IRQHandler+0 bl 0x8003492 + 0x08000990 USART2_IRQHandler+4 ldr r3, [pc, #40] ; (0x80009bc ) + 0x08000992 USART2_IRQHandler+6 ldrb r3, [r3, #0] + 0x08000994 USART2_IRQHandler+8 cmp r3, #0 + 0x08000996 USART2_IRQHandler+10 beq.n 0x800098c + 0x08000998 USART2_IRQHandler+12 ldr r3, [pc, #32] ; (0x80009bc ) + 0x0800099a USART2_IRQHandler+14 movs r2, #0 +~ +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000994 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000991 psp 0x00000000 +### Source ########################################################################################################## + 203 */ + 204 void USART2_IRQHandler(void) + 205 { + 206 /* USER CODE BEGIN USART2_IRQn 0 */ + 207 + 208 /* USER CODE END USART2_IRQn 0 */ + 209 HAL_UART_IRQHandler(&huart2); + 210 /* USER CODE BEGIN USART2_IRQn 1 */ + 211 + 212 /* USER CODE END USART2_IRQn 1 */ + 213 } + 214 + 215 /* USER CODE BEGIN 1 */ + 216 + 217 /* USER CODE END 1 */ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x08000994 in USART2_IRQHandler+8 at Core/Src/stm32l4xx_it.c:213 +[1] from 0x080034ca in _vsnprintf_r +### Threads ######################################################################################################### +[1] id 0 from 0x08000994 in USART2_IRQHandler+8 at Core/Src/stm32l4xx_it.c:213 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x3cc8 lma 0x8000190 +Loading section .rodata, size 0xc8 lma 0x8003e58 +Loading section .ARM, size 0x8 lma 0x8003f20 +Loading section .init_array, size 0x8 lma 0x8003f28 +Loading section .fini_array, size 0x8 lma 0x8003f30 +Loading section .data, size 0x70 lma 0x8003f38 +Start address 0x080032e8, load size 16296 +Transfer rate: 19 KB/sec, 2328 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +mc_service () at shared/devices/motor_controller.c:11 +11 } +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ + 0x080032e6 mc_service+0 bx lr +~ +~ +~ +~ +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x080032e6 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800093d psp 0x00000000 +### Source ########################################################################################################## + 1 #include "motor_controller.h" + 2 + 3 void mc_init() + 4 { + 5 // + 6 } + 7 + 8 void mc_service() + 9 { + 10 + 11 } +~ +~ +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x080032e6 in mc_service+0 at shared/devices/motor_controller.c:11 +[1] from 0x0800093c in main+104 at Core/Src/main.c:126 +### Threads ######################################################################################################### +[1] id 0 from 0x080032e6 in mc_service+0 at shared/devices/motor_controller.c:11 +### Variables ####################################################################################################### +##################################################################################################################### +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +target halted due to debug-request, current mode: Thread +xPSR: 0x01000000 pc: 0x080032e8 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x3cc8 lma 0x8000190 +Loading section .rodata, size 0xc8 lma 0x8003e58 +Loading section .ARM, size 0x8 lma 0x8003f20 +Loading section .init_array, size 0x8 lma 0x8003f28 +Loading section .fini_array, size 0x8 lma 0x8003f30 +Loading section .data, size 0x70 lma 0x8003f38 +Start address 0x080032e8, load size 16296 +Transfer rate: 19 KB/sec, 2328 bytes/write. +Breakpoint 1 at 0x80008d4: file Core/Src/main.c, line 80. +Note: automatically using hardware breakpoints for read-only addresses. +Starting program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Breakpoint 1, main () at Core/Src/main.c:80 +80 { +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ +!0x080008d4 main+0 push {r3, lr} + 0x080008d6 main+2 bl 0x80014b0 + 0x080008da main+6 bl 0x8000838 + 0x080008de main+10 bl 0x80005dc + 0x080008e2 main+14 bl 0x80006fc +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000070 r5 0x00000000 r10 0x00000000 pc 0x080008d4 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x200001cc r7 0x00000000 r12 0x00000000 fpscr 0x00000000 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x20010000 msp 0x20010000 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x0800331f psp 0x00000000 +### Source ########################################################################################################## + 70 /* Private user code ---------------------------------------------------------*/ + 71 /* USER CODE BEGIN 0 */ + 72 + 73 /* USER CODE END 0 */ + 74 + 75 /** + 76 * @brief The application entry point. + 77 * @retval int + 78 */ + 79 int main(void) +!80 { + 81 /* USER CODE BEGIN 1 */ + 82 + 83 /* USER CODE END 1 */ + 84 + 85 /* MCU Configuration--------------------------------------------------------*/ + 86 + 87 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + 88 HAL_Init(); + 89 +### Stack ########################################################################################################### +[0] from 0x080008d4 in main+0 at Core/Src/main.c:80 +### Threads ######################################################################################################### +[1] id 0 from 0x080008d4 in main+0 at Core/Src/main.c:80 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080008d6 +88 HAL_Init(); +### Assembly ######################################################################################################## +~ +~ +~ +~ +!0x080008d4 main+0 push {r3, lr} + 0x080008d6 main+2 bl 0x80014b0 + 0x080008da main+6 bl 0x8000838 + 0x080008de main+10 bl 0x80005dc + 0x080008e2 main+14 bl 0x80006fc + 0x080008e6 main+18 bl 0x8000790 +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x20000070 r5 0x00000000 r10 0x00000000 pc 0x080008d6 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x200001cc r7 0x00000000 r12 0x00000000 fpscr 0x00000000 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x0800331f psp 0x00000000 +### Source ########################################################################################################## + 78 */ + 79 int main(void) +!80 { + 81 /* USER CODE BEGIN 1 */ + 82 + 83 /* USER CODE END 1 */ + 84 + 85 /* MCU Configuration--------------------------------------------------------*/ + 86 + 87 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + 88 HAL_Init(); + 89 + 90 /* USER CODE BEGIN Init */ + 91 + 92 /* USER CODE END Init */ + 93 + 94 /* Configure the system clock */ + 95 SystemClock_Config(); + 96 + 97 /* USER CODE BEGIN SysInit */ +### Stack ########################################################################################################### +[0] from 0x080008d6 in main+2 at Core/Src/main.c:88 +### Threads ######################################################################################################### +[1] id 0 from 0x080008d6 in main+2 at Core/Src/main.c:88 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080014b0 +95 SystemClock_Config(); +### Assembly ######################################################################################################## +~ +~ +~ +!0x080008d4 main+0 push {r3, lr} + 0x080008d6 main+2 bl 0x80014b0 + 0x080008da main+6 bl 0x8000838 + 0x080008de main+10 bl 0x80005dc + 0x080008e2 main+14 bl 0x80006fc + 0x080008e6 main+18 bl 0x8000790 + 0x080008ea main+22 bl 0x80007c8 +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x080008da primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000000 basepri 0x00 + r2 0x10000400 r7 0x00000000 r12 0xfffffff0 fpscr 0x00000000 faultmask 0x00 + r3 0x10000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x080014cd psp 0x00000000 +### Source ########################################################################################################## + 85 /* MCU Configuration--------------------------------------------------------*/ + 86 + 87 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + 88 HAL_Init(); + 89 + 90 /* USER CODE BEGIN Init */ + 91 + 92 /* USER CODE END Init */ + 93 + 94 /* Configure the system clock */ + 95 SystemClock_Config(); + 96 + 97 /* USER CODE BEGIN SysInit */ + 98 + 99 /* USER CODE END SysInit */ + 100 + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); +### Stack ########################################################################################################### +[0] from 0x080008da in main+6 at Core/Src/main.c:95 +### Threads ######################################################################################################### +[1] id 0 from 0x080008da in main+6 at Core/Src/main.c:95 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08000838 +102 MX_GPIO_Init(); +### Assembly ######################################################################################################## +~ +~ +!0x080008d4 main+0 push {r3, lr} + 0x080008d6 main+2 bl 0x80014b0 + 0x080008da main+6 bl 0x8000838 + 0x080008de main+10 bl 0x80005dc + 0x080008e2 main+14 bl 0x80006fc + 0x080008e6 main+18 bl 0x8000790 + 0x080008ea main+22 bl 0x80007c8 + 0x080008ee main+26 ldr r4, [pc, #104] ; (0x8000958 ) +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x080008de primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000000 basepri 0x00 + r2 0x40021000 r7 0x00000000 r12 0xfffffff0 fpscr 0x00000000 faultmask 0x00 + r3 0x0300006f r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x080008bd psp 0x00000000 +### Source ########################################################################################################## + 92 /* USER CODE END Init */ + 93 + 94 /* Configure the system clock */ + 95 SystemClock_Config(); + 96 + 97 /* USER CODE BEGIN SysInit */ + 98 + 99 /* USER CODE END SysInit */ + 100 + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); +### Stack ########################################################################################################### +[0] from 0x080008de in main+10 at Core/Src/main.c:102 +### Threads ######################################################################################################### +[1] id 0 from 0x080008de in main+10 at Core/Src/main.c:102 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080005dc +103 MX_TIM2_Init(); +### Assembly ######################################################################################################## +~ +!0x080008d4 main+0 push {r3, lr} + 0x080008d6 main+2 bl 0x80014b0 + 0x080008da main+6 bl 0x8000838 + 0x080008de main+10 bl 0x80005dc + 0x080008e2 main+14 bl 0x80006fc + 0x080008e6 main+18 bl 0x8000790 + 0x080008ea main+22 bl 0x80007c8 + 0x080008ee main+26 ldr r4, [pc, #104] ; (0x8000958 ) + 0x080008f0 main+28 mov r0, r4 +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x48000400 r5 0x00000000 r10 0x00000000 pc 0x080008e2 primask 0x00 + r1 0x2000ffd4 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000008 r7 0x00000000 r12 0xfffffe3f fpscr 0x00000000 faultmask 0x00 + r3 0x00000004 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x00000006 psp 0x00000000 +### Source ########################################################################################################## + 93 + 94 /* Configure the system clock */ + 95 SystemClock_Config(); + 96 + 97 /* USER CODE BEGIN SysInit */ + 98 + 99 /* USER CODE END SysInit */ + 100 + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); +### Stack ########################################################################################################### +[0] from 0x080008e2 in main+14 at Core/Src/main.c:103 +### Threads ######################################################################################################### +[1] id 0 from 0x080008e2 in main+14 at Core/Src/main.c:103 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080006fc +104 MX_USART2_UART_Init(); +### Assembly ######################################################################################################## +!0x080008d4 main+0 push {r3, lr} + 0x080008d6 main+2 bl 0x80014b0 + 0x080008da main+6 bl 0x8000838 + 0x080008de main+10 bl 0x80005dc + 0x080008e2 main+14 bl 0x80006fc + 0x080008e6 main+18 bl 0x8000790 + 0x080008ea main+22 bl 0x80007c8 + 0x080008ee main+26 ldr r4, [pc, #104] ; (0x8000958 ) + 0x080008f0 main+28 mov r0, r4 + 0x080008f2 main+30 bl 0x80032c4 +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x48000000 r5 0x00000000 r10 0x00000000 pc 0x080008e6 primask 0x00 + r1 0x2000ffac r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x0000000a r7 0x00000000 r12 0xabf5f53b fpscr 0x00000000 faultmask 0x00 + r3 0x00000004 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x00000006 psp 0x00000000 +### Source ########################################################################################################## + 94 /* Configure the system clock */ + 95 SystemClock_Config(); + 96 + 97 /* USER CODE BEGIN SysInit */ + 98 + 99 /* USER CODE END SysInit */ + 100 + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 +### Stack ########################################################################################################### +[0] from 0x080008e6 in main+18 at Core/Src/main.c:104 +### Threads ######################################################################################################### +[1] id 0 from 0x080008e6 in main+18 at Core/Src/main.c:104 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08000790 +105 MX_TIM1_Init(); +### Assembly ######################################################################################################## + 0x080008d6 main+2 bl 0x80014b0 + 0x080008da main+6 bl 0x8000838 + 0x080008de main+10 bl 0x80005dc + 0x080008e2 main+14 bl 0x80006fc + 0x080008e6 main+18 bl 0x8000790 + 0x080008ea main+22 bl 0x80007c8 + 0x080008ee main+26 ldr r4, [pc, #104] ; (0x8000958 ) + 0x080008f0 main+28 mov r0, r4 + 0x080008f2 main+30 bl 0x80032c4 + 0x080008f6 main+34 ldr r5, [pc, #100] ; (0x800095c ) +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x080008ea primask 0x00 + r1 0x00400000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0xfffffff0 fpscr 0x00000000 faultmask 0x00 + r3 0x00000004 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x080030b3 psp 0x00000000 +### Source ########################################################################################################## + 95 SystemClock_Config(); + 96 + 97 /* USER CODE BEGIN SysInit */ + 98 + 99 /* USER CODE END SysInit */ + 100 + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); +### Stack ########################################################################################################### +[0] from 0x080008ea in main+22 at Core/Src/main.c:105 +### Threads ######################################################################################################### +[1] id 0 from 0x080008ea in main+22 at Core/Src/main.c:105 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080007c8 +107 p_uart_init(&huart2); +### Assembly ######################################################################################################## + 0x080008da main+6 bl 0x8000838 + 0x080008de main+10 bl 0x80005dc + 0x080008e2 main+14 bl 0x80006fc + 0x080008e6 main+18 bl 0x8000790 + 0x080008ea main+22 bl 0x80007c8 + 0x080008ee main+26 ldr r4, [pc, #104] ; (0x8000958 ) + 0x080008f0 main+28 mov r0, r4 + 0x080008f2 main+30 bl 0x80032c4 + 0x080008f6 main+34 ldr r5, [pc, #100] ; (0x800095c ) + 0x080008f8 main+36 movs r2, #50 ; 0x32 +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x080008ee primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0xfffffff0 fpscr 0x00000000 faultmask 0x00 + r3 0x20000090 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x200001cc r9 0x00000000 lr 0x0800081b psp 0x00000000 +### Source ########################################################################################################## + 97 /* USER CODE BEGIN SysInit */ + 98 + 99 /* USER CODE END SysInit */ + 100 + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 +### Stack ########################################################################################################### +[0] from 0x080008ee in main+26 at Core/Src/main.c:107 +### Threads ######################################################################################################### +[1] id 0 from 0x080008ee in main+26 at Core/Src/main.c:107 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080008f0 +halted: PC: 0x080008f2 +halted: PC: 0x080032c4 +111 setPWM(&htim2, TIM_CHANNEL_2, 50); +### Assembly ######################################################################################################## + 0x080008e6 main+18 bl 0x8000790 + 0x080008ea main+22 bl 0x80007c8 + 0x080008ee main+26 ldr r4, [pc, #104] ; (0x8000958 ) + 0x080008f0 main+28 mov r0, r4 + 0x080008f2 main+30 bl 0x80032c4 + 0x080008f6 main+34 ldr r5, [pc, #100] ; (0x800095c ) + 0x080008f8 main+36 movs r2, #50 ; 0x32 + 0x080008fa main+38 movs r1, #4 + 0x080008fc main+40 mov r0, r5 + 0x080008fe main+42 bl 0x800069c +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x080008f6 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0xfffffff0 fpscr 0x00000000 faultmask 0x00 + r3 0x20000090 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x00 + r4 0x20000128 r9 0x00000000 lr 0x080032d7 psp 0x00000000 +### Source ########################################################################################################## + 101 /* Initialize all configured peripherals */ + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ +### Stack ########################################################################################################### +[0] from 0x080008f6 in main+34 at Core/Src/main.c:111 +### Threads ######################################################################################################### +[1] id 0 from 0x080008f6 in main+34 at Core/Src/main.c:111 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080008f8 +halted: PC: 0x080008fa +halted: PC: 0x080008fc +halted: PC: 0x080008fe +halted: PC: 0x0800069c +112 setPWM(&htim2, TIM_CHANNEL_4, 25); +### Assembly ######################################################################################################## + 0x080008f6 main+34 ldr r5, [pc, #100] ; (0x800095c ) + 0x080008f8 main+36 movs r2, #50 ; 0x32 + 0x080008fa main+38 movs r1, #4 + 0x080008fc main+40 mov r0, r5 + 0x080008fe main+42 bl 0x800069c + 0x08000902 main+46 movs r2, #25 + 0x08000904 main+48 movs r1, #12 + 0x08000906 main+50 mov r0, r5 + 0x08000908 main+52 bl 0x800069c + 0x0800090c main+56 movs r2, #1 +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000902 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00000010 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x080012a1 psp 0x00000000 +### Source ########################################################################################################## + 102 MX_GPIO_Init(); + 103 MX_TIM2_Init(); + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 +### Stack ########################################################################################################### +[0] from 0x08000902 in main+46 at Core/Src/main.c:112 +### Threads ######################################################################################################### +[1] id 0 from 0x08000902 in main+46 at Core/Src/main.c:112 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08000904 +halted: PC: 0x08000906 +halted: PC: 0x08000908 +halted: PC: 0x0800069c +114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); +### Assembly ######################################################################################################## + 0x080008fe main+42 bl 0x800069c + 0x08000902 main+46 movs r2, #25 + 0x08000904 main+48 movs r1, #12 + 0x08000906 main+50 mov r0, r5 + 0x08000908 main+52 bl 0x800069c + 0x0800090c main+56 movs r2, #1 + 0x0800090e main+58 movs r1, #16 + 0x08000910 main+60 mov.w r0, #1207959552 ; 0x48000000 + 0x08000914 main+64 bl 0x800247c + 0x08000918 main+68 movs r2, #1 +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800090c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x080012a1 psp 0x00000000 +### Source ########################################################################################################## + 104 MX_USART2_UART_Init(); + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ +### Stack ########################################################################################################### +[0] from 0x0800090c in main+56 at Core/Src/main.c:114 +### Threads ######################################################################################################### +[1] id 0 from 0x0800090c in main+56 at Core/Src/main.c:114 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800090e +halted: PC: 0x08000910 +halted: PC: 0x08000914 +halted: PC: 0x0800247c +115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); +### Assembly ######################################################################################################## + 0x08000908 main+52 bl 0x800069c + 0x0800090c main+56 movs r2, #1 + 0x0800090e main+58 movs r1, #16 + 0x08000910 main+60 mov.w r0, #1207959552 ; 0x48000000 + 0x08000914 main+64 bl 0x800247c + 0x08000918 main+68 movs r2, #1 + 0x0800091a main+70 movs r1, #32 + 0x0800091c main+72 mov.w r0, #1207959552 ; 0x48000000 + 0x08000920 main+76 bl 0x800247c + 0x08000924 main+80 bl 0x80032e4 +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x48000000 r5 0x200000dc r10 0x00000000 pc 0x08000918 primask 0x00 + r1 0x00000010 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000919 psp 0x00000000 +### Source ########################################################################################################## + 105 MX_TIM1_Init(); + 106 /* USER CODE BEGIN 2 */ + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) +### Stack ########################################################################################################### +[0] from 0x08000918 in main+68 at Core/Src/main.c:115 +### Threads ######################################################################################################### +[1] id 0 from 0x08000918 in main+68 at Core/Src/main.c:115 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800091a +halted: PC: 0x0800091c +halted: PC: 0x08000920 +halted: PC: 0x0800247c +117 mc_init(); +### Assembly ######################################################################################################## + 0x08000914 main+64 bl 0x800247c + 0x08000918 main+68 movs r2, #1 + 0x0800091a main+70 movs r1, #32 + 0x0800091c main+72 mov.w r0, #1207959552 ; 0x48000000 + 0x08000920 main+76 bl 0x800247c + 0x08000924 main+80 bl 0x80032e4 + 0x08000928 main+84 movs r2, #1 + 0x0800092a main+86 ldr r1, [pc, #52] ; (0x8000960 ) + 0x0800092c main+88 mov r0, r4 + 0x0800092e main+90 bl 0x80031f4 +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x48000000 r5 0x200000dc r10 0x00000000 pc 0x08000924 primask 0x00 + r1 0x00000020 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000925 psp 0x00000000 +### Source ########################################################################################################## + 107 p_uart_init(&huart2); + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); +### Stack ########################################################################################################### +[0] from 0x08000924 in main+80 at Core/Src/main.c:117 +### Threads ######################################################################################################### +[1] id 0 from 0x08000924 in main+80 at Core/Src/main.c:117 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080032e4 +118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); +### Assembly ######################################################################################################## + 0x08000918 main+68 movs r2, #1 + 0x0800091a main+70 movs r1, #32 + 0x0800091c main+72 mov.w r0, #1207959552 ; 0x48000000 + 0x08000920 main+76 bl 0x800247c + 0x08000924 main+80 bl 0x80032e4 + 0x08000928 main+84 movs r2, #1 + 0x0800092a main+86 ldr r1, [pc, #52] ; (0x8000960 ) + 0x0800092c main+88 mov r0, r4 + 0x0800092e main+90 bl 0x80031f4 + 0x08000932 main+94 ldr r0, [pc, #48] ; (0x8000964 ) +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x48000000 r5 0x200000dc r10 0x00000000 pc 0x08000928 primask 0x00 + r1 0x00000020 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000929 psp 0x00000000 +### Source ########################################################################################################## + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) +### Stack ########################################################################################################### +[0] from 0x08000928 in main+84 at Core/Src/main.c:118 +### Threads ######################################################################################################### +[1] id 0 from 0x08000928 in main+84 at Core/Src/main.c:118 +### Variables ####################################################################################################### +##################################################################################################################### +Breakpoint 2 at 0x8000944: file Core/Src/main.c, line 129. +### Output/messages ################################################################################################# +halted: PC: 0x0800092a +halted: PC: 0x0800092c +halted: PC: 0x0800092e +halted: PC: 0x080031f4 +119 HAL_TIM_Base_Start_IT(&htim1); +### Assembly ######################################################################################################## + 0x08000924 main+80 bl 0x80032e4 + 0x08000928 main+84 movs r2, #1 + 0x0800092a main+86 ldr r1, [pc, #52] ; (0x8000960 ) + 0x0800092c main+88 mov r0, r4 + 0x0800092e main+90 bl 0x80031f4 + 0x08000932 main+94 ldr r0, [pc, #48] ; (0x8000964 ) + 0x08000934 main+96 bl 0x8000d7c + 0x08000938 main+100 bl 0x80032e6 + 0x0800093c main+104 ldr r3, [pc, #40] ; (0x8000968 ) + 0x0800093e main+106 ldrb r3, [r3, #0] +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +[2] break at 0x08000944 in Core/Src/main.c:129 for /storage/Shared/Projects/stm32_projects/motor_controller/Core/Src/main.c:128 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000932 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x40004400 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08003239 psp 0x00000000 +### Source ########################################################################################################## + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { +### Stack ########################################################################################################### +[0] from 0x08000932 in main+94 at Core/Src/main.c:119 +### Threads ######################################################################################################### +[1] id 0 from 0x08000932 in main+94 at Core/Src/main.c:119 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x08000934 +halted: PC: 0x08000d7c +126 mc_service(); +### Assembly ######################################################################################################## + 0x0800092a main+86 ldr r1, [pc, #52] ; (0x8000960 ) + 0x0800092c main+88 mov r0, r4 + 0x0800092e main+90 bl 0x80031f4 + 0x08000932 main+94 ldr r0, [pc, #48] ; (0x8000964 ) + 0x08000934 main+96 bl 0x8000d7c + 0x08000938 main+100 bl 0x80032e6 + 0x0800093c main+104 ldr r3, [pc, #40] ; (0x8000968 ) + 0x0800093e main+106 ldrb r3, [r3, #0] + 0x08000940 main+108 cmp r3, #0 + 0x08000942 main+110 beq.n 0x8000938 +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +[2] break at 0x08000944 in Core/Src/main.c:129 for /storage/Shared/Projects/stm32_projects/motor_controller/Core/Src/main.c:128 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000938 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40012c00 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000939 psp 0x00000000 +### Source ########################################################################################################## + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { +!129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } +### Stack ########################################################################################################### +[0] from 0x08000938 in main+100 at Core/Src/main.c:126 +### Threads ######################################################################################################### +[1] id 0 from 0x08000938 in main+100 at Core/Src/main.c:126 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080032e6 +127 if(b_timer_struck) +### Assembly ######################################################################################################## + 0x0800092c main+88 mov r0, r4 + 0x0800092e main+90 bl 0x80031f4 + 0x08000932 main+94 ldr r0, [pc, #48] ; (0x8000964 ) + 0x08000934 main+96 bl 0x8000d7c + 0x08000938 main+100 bl 0x80032e6 + 0x0800093c main+104 ldr r3, [pc, #40] ; (0x8000968 ) + 0x0800093e main+106 ldrb r3, [r3, #0] + 0x08000940 main+108 cmp r3, #0 + 0x08000942 main+110 beq.n 0x8000938 +!0x08000944 main+112 ldr r3, [pc, #32] ; (0x8000968 ) +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +[2] break at 0x08000944 in Core/Src/main.c:129 for /storage/Shared/Projects/stm32_projects/motor_controller/Core/Src/main.c:128 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800093c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x41000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x40012c00 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800093d psp 0x00000000 +### Source ########################################################################################################## + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { +!129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } + 136 /* USER CODE END 3 */ +### Stack ########################################################################################################### +[0] from 0x0800093c in main+104 at Core/Src/main.c:127 +### Threads ######################################################################################################### +[1] id 0 from 0x0800093c in main+104 at Core/Src/main.c:127 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800093e +halted: PC: 0x08000940 +halted: PC: 0x08000942 +halted: PC: 0x08000938 +126 mc_service(); +### Assembly ######################################################################################################## + 0x0800092a main+86 ldr r1, [pc, #52] ; (0x8000960 ) + 0x0800092c main+88 mov r0, r4 + 0x0800092e main+90 bl 0x80031f4 + 0x08000932 main+94 ldr r0, [pc, #48] ; (0x8000964 ) + 0x08000934 main+96 bl 0x8000d7c + 0x08000938 main+100 bl 0x80032e6 + 0x0800093c main+104 ldr r3, [pc, #40] ; (0x8000968 ) + 0x0800093e main+106 ldrb r3, [r3, #0] + 0x08000940 main+108 cmp r3, #0 + 0x08000942 main+110 beq.n 0x8000938 +### Breakpoints ##################################################################################################### +[1] break at 0x080008d4 in Core/Src/main.c:80 for main hit 1 time +[2] break at 0x08000944 in Core/Src/main.c:129 for /storage/Shared/Projects/stm32_projects/motor_controller/Core/Src/main.c:128 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000938 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800093d psp 0x00000000 +### Source ########################################################################################################## + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { +!129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } +### Stack ########################################################################################################### +[0] from 0x08000938 in main+100 at Core/Src/main.c:126 +### Threads ######################################################################################################### +[1] id 0 from 0x08000938 in main+100 at Core/Src/main.c:126 +### Variables ####################################################################################################### +##################################################################################################################### +Note: breakpoint 2 also set at pc 0x8000944. +Breakpoint 3 at 0x8000944: file Core/Src/main.c, line 129. +Ambiguous command "de": define, define-prefix, del, delete, demangle, detach. +Breakpoint 4 at 0x8000944: file Core/Src/main.c, line 129. +Program not restarted. +Continuing. +### Output/messages ################################################################################################# + +Program received signal SIGINT, Interrupt. +mc_service () at shared/devices/motor_controller.c:11 +11 } +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ + 0x080032e6 mc_service+0 bx lr +~ +~ +~ +~ +### Breakpoints ##################################################################################################### +[4] break at 0x08000944 in Core/Src/main.c:129 for /storage/Shared/Projects/stm32_projects/motor_controller/Core/Src/main.c:129 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x080032e6 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800093d psp 0x00000000 +### Source ########################################################################################################## + 1 #include "motor_controller.h" + 2 + 3 void mc_init() + 4 { + 5 // + 6 } + 7 + 8 void mc_service() + 9 { + 10 + 11 } +~ +~ +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x080032e6 in mc_service+0 at shared/devices/motor_controller.c:11 +[1] from 0x0800093c in main+104 at Core/Src/main.c:126 +### Threads ######################################################################################################### +[1] id 0 from 0x080032e6 in mc_service+0 at shared/devices/motor_controller.c:11 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800093c +main () at Core/Src/main.c:127 +127 if(b_timer_struck) +### Assembly ######################################################################################################## + 0x0800092c main+88 mov r0, r4 + 0x0800092e main+90 bl 0x80031f4 + 0x08000932 main+94 ldr r0, [pc, #48] ; (0x8000964 ) + 0x08000934 main+96 bl 0x8000d7c + 0x08000938 main+100 bl 0x80032e6 + 0x0800093c main+104 ldr r3, [pc, #40] ; (0x8000968 ) + 0x0800093e main+106 ldrb r3, [r3, #0] + 0x08000940 main+108 cmp r3, #0 + 0x08000942 main+110 beq.n 0x8000938 +!0x08000944 main+112 ldr r3, [pc, #32] ; (0x8000968 ) +### Breakpoints ##################################################################################################### +[4] break at 0x08000944 in Core/Src/main.c:129 for /storage/Shared/Projects/stm32_projects/motor_controller/Core/Src/main.c:129 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800093c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800093d psp 0x00000000 +### Source ########################################################################################################## + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { +!129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } + 136 /* USER CODE END 3 */ +### Stack ########################################################################################################### +[0] from 0x0800093c in main+104 at Core/Src/main.c:127 +### Threads ######################################################################################################### +[1] id 0 from 0x0800093c in main+104 at Core/Src/main.c:127 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800093e +halted: PC: 0x08000940 +halted: PC: 0x08000942 +halted: PC: 0x08000938 +126 mc_service(); +### Assembly ######################################################################################################## + 0x0800092a main+86 ldr r1, [pc, #52] ; (0x8000960 ) + 0x0800092c main+88 mov r0, r4 + 0x0800092e main+90 bl 0x80031f4 + 0x08000932 main+94 ldr r0, [pc, #48] ; (0x8000964 ) + 0x08000934 main+96 bl 0x8000d7c + 0x08000938 main+100 bl 0x80032e6 + 0x0800093c main+104 ldr r3, [pc, #40] ; (0x8000968 ) + 0x0800093e main+106 ldrb r3, [r3, #0] + 0x08000940 main+108 cmp r3, #0 + 0x08000942 main+110 beq.n 0x8000938 +### Breakpoints ##################################################################################################### +[4] break at 0x08000944 in Core/Src/main.c:129 for /storage/Shared/Projects/stm32_projects/motor_controller/Core/Src/main.c:129 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000938 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800093d psp 0x00000000 +### Source ########################################################################################################## + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { +!129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } +### Stack ########################################################################################################### +[0] from 0x08000938 in main+100 at Core/Src/main.c:126 +### Threads ######################################################################################################### +[1] id 0 from 0x08000938 in main+100 at Core/Src/main.c:126 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x080032e6 +mc_service () at shared/devices/motor_controller.c:11 +11 } +### Assembly ######################################################################################################## +~ +~ +~ +~ +~ + 0x080032e6 mc_service+0 bx lr +~ +~ +~ +~ +### Breakpoints ##################################################################################################### +[4] break at 0x08000944 in Core/Src/main.c:129 for /storage/Shared/Projects/stm32_projects/motor_controller/Core/Src/main.c:129 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x080032e6 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800093d psp 0x00000000 +### Source ########################################################################################################## + 1 #include "motor_controller.h" + 2 + 3 void mc_init() + 4 { + 5 // + 6 } + 7 + 8 void mc_service() + 9 { + 10 + 11 } +~ +~ +~ +~ +~ +~ +~ +~ +~ +### Stack ########################################################################################################### +[0] from 0x080032e6 in mc_service+0 at shared/devices/motor_controller.c:11 +[1] from 0x0800093c in main+104 at Core/Src/main.c:126 +### Threads ######################################################################################################### +[1] id 0 from 0x080032e6 in mc_service+0 at shared/devices/motor_controller.c:11 +### Variables ####################################################################################################### +##################################################################################################################### +### Output/messages ################################################################################################# +halted: PC: 0x0800093c +main () at Core/Src/main.c:127 +127 if(b_timer_struck) +### Assembly ######################################################################################################## + 0x0800092c main+88 mov r0, r4 + 0x0800092e main+90 bl 0x80031f4 + 0x08000932 main+94 ldr r0, [pc, #48] ; (0x8000964 ) + 0x08000934 main+96 bl 0x8000d7c + 0x08000938 main+100 bl 0x80032e6 + 0x0800093c main+104 ldr r3, [pc, #40] ; (0x8000968 ) + 0x0800093e main+106 ldrb r3, [r3, #0] + 0x08000940 main+108 cmp r3, #0 + 0x08000942 main+110 beq.n 0x8000938 +!0x08000944 main+112 ldr r3, [pc, #32] ; (0x8000968 ) +### Breakpoints ##################################################################################################### +[4] break at 0x08000944 in Core/Src/main.c:129 for /storage/Shared/Projects/stm32_projects/motor_controller/Core/Src/main.c:129 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800093c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800093d psp 0x00000000 +### Source ########################################################################################################## + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { +!129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } + 136 /* USER CODE END 3 */ +### Stack ########################################################################################################### +[0] from 0x0800093c in main+104 at Core/Src/main.c:127 +### Threads ######################################################################################################### +[1] id 0 from 0x0800093c in main+104 at Core/Src/main.c:127 +### Variables ####################################################################################################### +##################################################################################################################### +Detaching from program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +warning: No executable has been specified and target does not support +determining executable automatically. Try using the "file" command. +0x0800093c in ?? () +### Assembly ######################################################################################################## + 0x0800093c ? ldr r3, [pc, #40] ; (0x8000968) + 0x0800093e ? ldrb r3, [r3, #0] + 0x08000940 ? cmp r3, #0 + 0x08000942 ? beq.n 0x8000938 + 0x08000944 ? ldr r3, [pc, #32] ; (0x8000968) + 0x08000946 ? movs r2, #0 + 0x08000948 ? strb r2, [r3, #0] + 0x0800094a ? ldr r3, [pc, #32] ; (0x800096c) + 0x0800094c ? ldr r1, [r3, #0] + 0x0800094e ? ldr r0, [pc, #32] ; (0x8000970) +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800093c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800093d psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x0800093c +### Threads ######################################################################################################### +[1] id 0 from 0x0800093c +### Variables ####################################################################################################### +##################################################################################################################### +generic_push.gdb:7: Error in sourced command file: +No executable file specified. +Use the "file" or "exec-file" command. +Detaching from program: , Remote target +[Inferior 1 (Remote target) detached] +warning: No executable has been specified and target does not support +determining executable automatically. Try using the "file" command. +0x0800093c in ?? () +### Assembly ######################################################################################################## + 0x0800093c ? ldr r3, [pc, #40] ; (0x8000968) + 0x0800093e ? ldrb r3, [r3, #0] + 0x08000940 ? cmp r3, #0 + 0x08000942 ? beq.n 0x8000938 + 0x08000944 ? ldr r3, [pc, #32] ; (0x8000968) + 0x08000946 ? movs r2, #0 + 0x08000948 ? strb r2, [r3, #0] + 0x0800094a ? ldr r3, [pc, #32] ; (0x800096c) + 0x0800094c ? ldr r1, [r3, #0] + 0x0800094e ? ldr r0, [pc, #32] ; (0x8000970) +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800093c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800093d psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x0800093c +### Threads ######################################################################################################### +[1] id 0 from 0x0800093c +### Variables ####################################################################################################### +##################################################################################################################### +generic_push.gdb:7: Error in sourced command file: +No executable file specified. +Use the "file" or "exec-file" command. +Detaching from program: , Remote target +[Inferior 1 (Remote target) detached] +0x0800093c in ?? () +### Assembly ######################################################################################################## + 0x0800093c ? ldr r3, [pc, #40] ; (0x8000968) + 0x0800093e ? ldrb r3, [r3, #0] + 0x08000940 ? cmp r3, #0 + 0x08000942 ? beq.n 0x8000938 + 0x08000944 ? ldr r3, [pc, #32] ; (0x8000968) + 0x08000946 ? movs r2, #0 + 0x08000948 ? strb r2, [r3, #0] + 0x0800094a ? ldr r3, [pc, #32] ; (0x800096c) + 0x0800094c ? ldr r1, [r3, #0] + 0x0800094e ? ldr r0, [pc, #32] ; (0x8000970) +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800093c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x0800093d psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x0800093c +### Threads ######################################################################################################### +[1] id 0 from 0x0800093c +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .sec1, size 0x4188 lma 0x8000000 +Start address 0x080034c4, load size 16776 +Transfer rate: 19 KB/sec, 8388 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +main () at Core/Src/main.c:126 +126 mc_service(); +### Assembly ######################################################################################################## + 0x08000936 main+86 ldr r1, [pc, #52] ; (0x800096c ) + 0x08000938 main+88 mov r0, r4 + 0x0800093a main+90 bl 0x80033d0 + 0x0800093e main+94 ldr r0, [pc, #48] ; (0x8000970 ) + 0x08000940 main+96 bl 0x8000dac + 0x08000944 main+100 bl 0x80034c2 + 0x08000948 main+104 ldr r3, [pc, #40] ; (0x8000974 ) + 0x0800094a main+106 ldrb r3, [r3, #0] + 0x0800094c main+108 cmp r3, #0 + 0x0800094e main+110 beq.n 0x8000944 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000944 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000949 psp 0x00000000 +### Source ########################################################################################################## + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { + 129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } +### Stack ########################################################################################################### +[0] from 0x08000944 in main+100 at Core/Src/main.c:126 +### Threads ######################################################################################################### +[1] id 0 from 0x08000944 in main+100 at Core/Src/main.c:126 +### Variables ####################################################################################################### +##################################################################################################################### +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +target halted due to debug-request, current mode: Thread +xPSR: 0x01000000 pc: 0x080034c4 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x3ea8 lma 0x8000190 +Loading section .rodata, size 0xc8 lma 0x8004038 +Loading section .ARM, size 0x8 lma 0x8004100 +Loading section .init_array, size 0x8 lma 0x8004108 +Loading section .fini_array, size 0x8 lma 0x8004110 +Loading section .data, size 0x70 lma 0x8004118 +Start address 0x080034c4, load size 16776 +Transfer rate: 19 KB/sec, 2097 bytes/write. +Breakpoint 1 at 0x8000950: file Core/Src/main.c, line 129. +Note: automatically using hardware breakpoints for read-only addresses. +Starting program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Program received signal SIGINT, Interrupt. +0x0800094c in main () at Core/Src/main.c:127 +127 if(b_timer_struck) +### Assembly ######################################################################################################## + 0x0800093e main+94 ldr r0, [pc, #48] ; (0x8000970 ) + 0x08000940 main+96 bl 0x8000dac + 0x08000944 main+100 bl 0x80034c2 + 0x08000948 main+104 ldr r3, [pc, #40] ; (0x8000974 ) + 0x0800094a main+106 ldrb r3, [r3, #0] + 0x0800094c main+108 cmp r3, #0 + 0x0800094e main+110 beq.n 0x8000944 +!0x08000950 main+112 ldr r3, [pc, #32] ; (0x8000974 ) + 0x08000952 main+114 movs r2, #0 + 0x08000954 main+116 strb r2, [r3, #0] +### Breakpoints ##################################################################################################### +[1] break at 0x08000950 in Core/Src/main.c:129 for /storage/Shared/Projects/stm32_projects/motor_controller/Core/Src/main.c:129 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800094c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000949 psp 0x00000000 +### Source ########################################################################################################## + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { +!129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } + 136 /* USER CODE END 3 */ +### Stack ########################################################################################################### +[0] from 0x0800094c in main+108 at Core/Src/main.c:127 +### Threads ######################################################################################################### +[1] id 0 from 0x0800094c in main+108 at Core/Src/main.c:127 +### Variables ####################################################################################################### +##################################################################################################################### +Detaching from program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x0800094c in main () at Core/Src/main.c:127 +127 if(b_timer_struck) +### Assembly ######################################################################################################## + 0x0800093e main+94 ldr r0, [pc, #48] ; (0x8000970 ) + 0x08000940 main+96 bl 0x8000dac + 0x08000944 main+100 bl 0x80034c2 + 0x08000948 main+104 ldr r3, [pc, #40] ; (0x8000974 ) + 0x0800094a main+106 ldrb r3, [r3, #0] + 0x0800094c main+108 cmp r3, #0 + 0x0800094e main+110 beq.n 0x8000944 + 0x08000950 main+112 ldr r3, [pc, #32] ; (0x8000974 ) + 0x08000952 main+114 movs r2, #0 + 0x08000954 main+116 strb r2, [r3, #0] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800094c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000949 psp 0x00000000 +### Source ########################################################################################################## + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { + 129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } + 136 /* USER CODE END 3 */ +### Stack ########################################################################################################### +[0] from 0x0800094c in main+108 at Core/Src/main.c:127 +### Threads ######################################################################################################### +[1] id 0 from 0x0800094c in main+108 at Core/Src/main.c:127 +### Variables ####################################################################################################### +##################################################################################################################### +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +target halted due to debug-request, current mode: Thread +xPSR: 0x01000000 pc: 0x080034c4 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x3ea8 lma 0x8000190 +Loading section .rodata, size 0xc8 lma 0x8004038 +Loading section .ARM, size 0x8 lma 0x8004100 +Loading section .init_array, size 0x8 lma 0x8004108 +Loading section .fini_array, size 0x8 lma 0x8004110 +Loading section .data, size 0x70 lma 0x8004118 +Start address 0x080034c4, load size 16776 +Transfer rate: 19 KB/sec, 2097 bytes/write. +Breakpoint 1 at 0x800069c: file Core/Src/main.c, line 380. +Note: automatically using hardware breakpoints for read-only addresses. +Starting program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.elf +### Output/messages ################################################################################################# + +Program received signal SIGINT, Interrupt. +0x0800094c in main () at Core/Src/main.c:127 +127 if(b_timer_struck) +### Assembly ######################################################################################################## + 0x0800093e main+94 ldr r0, [pc, #48] ; (0x8000970 ) + 0x08000940 main+96 bl 0x8000dac + 0x08000944 main+100 bl 0x80034c2 + 0x08000948 main+104 ldr r3, [pc, #40] ; (0x8000974 ) + 0x0800094a main+106 ldrb r3, [r3, #0] + 0x0800094c main+108 cmp r3, #0 + 0x0800094e main+110 beq.n 0x8000944 + 0x08000950 main+112 ldr r3, [pc, #32] ; (0x8000974 ) + 0x08000952 main+114 movs r2, #0 + 0x08000954 main+116 strb r2, [r3, #0] +### Breakpoints ##################################################################################################### +[1] break at 0x0800069c in Core/Src/main.c:380 for Core/Src/main.c:380 +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800094c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000949 psp 0x00000000 +### Source ########################################################################################################## + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { + 129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } + 136 /* USER CODE END 3 */ +### Stack ########################################################################################################### +[0] from 0x0800094c in main+108 at Core/Src/main.c:127 +### Threads ######################################################################################################### +[1] id 0 from 0x0800094c in main+108 at Core/Src/main.c:127 +### Variables ####################################################################################################### +##################################################################################################################### +Detaching from program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +0x0800094c in main () at Core/Src/main.c:127 +127 if(b_timer_struck) +### Assembly ######################################################################################################## + 0x0800093e main+94 ldr r0, [pc, #48] ; (0x8000970 ) + 0x08000940 main+96 bl 0x8000dac + 0x08000944 main+100 bl 0x80034c2 + 0x08000948 main+104 ldr r3, [pc, #40] ; (0x8000974 ) + 0x0800094a main+106 ldrb r3, [r3, #0] + 0x0800094c main+108 cmp r3, #0 + 0x0800094e main+110 beq.n 0x8000944 + 0x08000950 main+112 ldr r3, [pc, #32] ; (0x8000974 ) + 0x08000952 main+114 movs r2, #0 + 0x08000954 main+116 strb r2, [r3, #0] +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800094c primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000001 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000949 psp 0x00000000 +### Source ########################################################################################################## + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { + 129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } + 136 /* USER CODE END 3 */ +### Stack ########################################################################################################### +[0] from 0x0800094c in main+108 at Core/Src/main.c:127 +### Threads ######################################################################################################### +[1] id 0 from 0x0800094c in main+108 at Core/Src/main.c:127 +### Variables ####################################################################################################### +##################################################################################################################### +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +target halted due to debug-request, current mode: Thread +xPSR: 0x01000000 pc: 0x080034c4 msp: 0x20010000 +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x3ea8 lma 0x8000190 +Loading section .rodata, size 0xc8 lma 0x8004038 +Loading section .ARM, size 0x8 lma 0x8004100 +Loading section .init_array, size 0x8 lma 0x8004108 +Loading section .fini_array, size 0x8 lma 0x8004110 +Loading section .data, size 0x70 lma 0x8004118 +Start address 0x080034c4, load size 16776 +Transfer rate: 19 KB/sec, 2097 bytes/write. +Detaching from program: /storage/Shared/Projects/stm32_projects/motor_controller/build/motor_controller.elf, Remote target +[Inferior 1 (Remote target) detached] +warning: No executable has been specified and target does not support +determining executable automatically. Try using the "file" command. +0x080034c4 in ?? () +### Assembly ######################################################################################################## + 0x080034c4 ? ldr.w sp, [pc, #52] ; 0x80034fc + 0x080034c8 ? bl 0x8003430 + 0x080034cc ? ldr r0, [pc, #48] ; (0x8003500) + 0x080034ce ? ldr r1, [pc, #52] ; (0x8003504) + 0x080034d0 ? ldr r2, [pc, #52] ; (0x8003508) + 0x080034d2 ? movs r3, #0 + 0x080034d4 ? b.n 0x80034dc + 0x080034d6 ? ldr r4, [r2, r3] + 0x080034d8 ? str r4, [r0, r3] + 0x080034da ? adds r3, #4 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x080034c4 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00000000 fpscr 0x00000000 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x20010000 msp 0x20010000 control 0x00 + r4 0x00000000 r9 0x00000000 lr 0xffffffff psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x080034c4 +[1] from 0xfffffffe +### Threads ######################################################################################################### +[1] id 0 from 0x080034c4 +### Variables ####################################################################################################### +##################################################################################################################### +generic_push.gdb:7: Error in sourced command file: +No executable file specified. +Use the "file" or "exec-file" command. +Detaching from program: , Remote target +[Inferior 1 (Remote target) detached] +0x080034c4 in ?? () +### Assembly ######################################################################################################## + 0x080034c4 ? ldr.w sp, [pc, #52] ; 0x80034fc + 0x080034c8 ? bl 0x8003430 + 0x080034cc ? ldr r0, [pc, #48] ; (0x8003500) + 0x080034ce ? ldr r1, [pc, #52] ; (0x8003504) + 0x080034d0 ? ldr r2, [pc, #52] ; (0x8003508) + 0x080034d2 ? movs r3, #0 + 0x080034d4 ? b.n 0x80034dc + 0x080034d6 ? ldr r4, [r2, r3] + 0x080034d8 ? str r4, [r0, r3] + 0x080034da ? adds r3, #4 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x00000000 r10 0x00000000 pc 0x080034c4 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x01000000 basepri 0x00 + r2 0x00000000 r7 0x00000000 r12 0x00000000 fpscr 0x00000000 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x20010000 msp 0x20010000 control 0x00 + r4 0x00000000 r9 0x00000000 lr 0xffffffff psp 0x00000000 +### Source ########################################################################################################## +### Stack ########################################################################################################### +[0] from 0x080034c4 +[1] from 0xfffffffe +### Threads ######################################################################################################### +[1] id 0 from 0x080034c4 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .sec1, size 0x4188 lma 0x8000000 +Start address 0x080034c4, load size 16776 +Transfer rate: 19 KB/sec, 8388 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +0x0800094a in main () at Core/Src/main.c:127 +127 if(b_timer_struck) +### Assembly ######################################################################################################## + 0x0800093a main+90 bl 0x80033d0 + 0x0800093e main+94 ldr r0, [pc, #48] ; (0x8000970 ) + 0x08000940 main+96 bl 0x8000dac + 0x08000944 main+100 bl 0x80034c2 + 0x08000948 main+104 ldr r3, [pc, #40] ; (0x8000974 ) + 0x0800094a main+106 ldrb r3, [r3, #0] + 0x0800094c main+108 cmp r3, #0 + 0x0800094e main+110 beq.n 0x8000944 + 0x08000950 main+112 ldr r3, [pc, #32] ; (0x8000974 ) + 0x08000952 main+114 movs r2, #0 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x0800094a primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x2000008c r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000949 psp 0x00000000 +### Source ########################################################################################################## + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim1); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { + 129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } + 136 /* USER CODE END 3 */ +### Stack ########################################################################################################### +[0] from 0x0800094a in main+106 at Core/Src/main.c:127 +### Threads ######################################################################################################### +[1] id 0 from 0x0800094a in main+106 at Core/Src/main.c:127 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x3ea8 lma 0x8000190 +Loading section .rodata, size 0xc8 lma 0x8004038 +Loading section .ARM, size 0x8 lma 0x8004100 +Loading section .init_array, size 0x8 lma 0x8004108 +Loading section .fini_array, size 0x8 lma 0x8004110 +Loading section .data, size 0x70 lma 0x8004118 +Start address 0x080034c4, load size 16776 +Transfer rate: 19 KB/sec, 2097 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +0x08000944 in main () at Core/Src/main.c:130 +130 PDEBUG("%d\n", sys_time); +### Assembly ######################################################################################################## + 0x08000936 main+118 ldr r1, [pc, #52] ; (0x800096c ) + 0x08000938 main+120 mov r0, r4 + 0x0800093a main+122 bl 0x80033d0 + 0x0800093e main+126 ldr r0, [pc, #48] ; (0x8000970 ) + 0x08000940 main+128 bl 0x8000dac + 0x08000944 main+132 bl 0x80034c2 <_kill_r+26> + 0x08000948 main+136 ldr r3, [pc, #40] ; (0x8000974 ) + 0x0800094a main+138 ldrb r3, [r3, #0] + 0x0800094c main+140 cmp r3, #0 + 0x0800094e main+142 beq.n 0x8000944 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x200000dc r10 0x00000000 pc 0x08000944 primask 0x00 + r1 0x00000000 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x00000081 r7 0x00000000 r12 0x00001000 fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000949 psp 0x00000000 +### Source ########################################################################################################## + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { + 129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } + 136 /* USER CODE END 3 */ + 137 } + 138 + 139 /** +### Stack ########################################################################################################### +[0] from 0x08000944 in main+132 at Core/Src/main.c:130 +### Threads ######################################################################################################### +[1] id 0 from 0x08000944 in main+132 at Core/Src/main.c:130 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x3d08 lma 0x8000190 +Loading section .rodata, size 0xc8 lma 0x8003e98 +Loading section .ARM, size 0x8 lma 0x8003f60 +Loading section .init_array, size 0x8 lma 0x8003f68 +Loading section .fini_array, size 0x8 lma 0x8003f70 +Loading section .data, size 0x70 lma 0x8003f78 +Start address 0x08003328, load size 16360 +Transfer rate: 19 KB/sec, 2337 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +0x08000924 in main () at Core/Src/main.c:118 +118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); +### Assembly ######################################################################################################## + 0x08000916 main+74 ldr r1, [pc, #52] ; (0x800094c ) + 0x08000918 main+76 mov r0, r4 + 0x0800091a main+78 bl 0x8003234 + 0x0800091e main+82 ldr r0, [pc, #48] ; (0x8000950 ) + 0x08000920 main+84 bl 0x8000d2c + 0x08000924 main+88 bl 0x8003326 + 0x08000928 main+92 ldr r3, [pc, #40] ; (0x8000954 ) + 0x0800092a main+94 ldrb r3, [r3, #0] + 0x0800092c main+96 cmp r3, #0 + 0x0800092e main+98 beq.n 0x8000924 +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x20000090 r10 0x00000000 pc 0x08000924 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x0000000a fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000929 psp 0x00000000 +### Source ########################################################################################################## + 108 + 109 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2); + 110 // HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); + 111 setPWM(&htim2, TIM_CHANNEL_2, 50); + 112 setPWM(&htim2, TIM_CHANNEL_4, 25); + 113 + 114 HAL_GPIO_WritePin(m1_dir_GPIO_Port, m1_dir_Pin, 1); + 115 HAL_GPIO_WritePin(m2_dir_GPIO_Port, m2_dir_Pin, 1); + 116 + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim6); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) +### Stack ########################################################################################################### +[0] from 0x08000924 in main+88 at Core/Src/main.c:118 +### Threads ######################################################################################################### +[1] id 0 from 0x08000924 in main+88 at Core/Src/main.c:118 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x3d18 lma 0x8000190 +Loading section .rodata, size 0xc8 lma 0x8003ea8 +Loading section .ARM, size 0x8 lma 0x8003f70 +Loading section .init_array, size 0x8 lma 0x8003f78 +Loading section .fini_array, size 0x8 lma 0x8003f80 +Loading section .data, size 0x70 lma 0x8003f88 +Start address 0x08003334, load size 16376 +Transfer rate: 19 KB/sec, 2339 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] +main () at Core/Src/main.c:127 +127 if(b_timer_struck) +### Assembly ######################################################################################################## + 0x08000924 main+88 mov r0, r4 + 0x08000926 main+90 bl 0x8003240 + 0x0800092a main+94 ldr r0, [pc, #48] ; (0x800095c ) + 0x0800092c main+96 bl 0x8000d38 + 0x08000930 main+100 bl 0x8003332 + 0x08000934 main+104 ldr r3, [pc, #40] ; (0x8000960 ) + 0x08000936 main+106 ldrb r3, [r3, #0] + 0x08000938 main+108 cmp r3, #0 + 0x0800093a main+110 beq.n 0x8000930 + 0x0800093c main+112 ldr r3, [pc, #32] ; (0x8000960 ) +### Breakpoints ##################################################################################################### +### Expressions ##################################################################################################### +### History ######################################################################################################### +### Memory ########################################################################################################## +### Registers ####################################################################################################### + r0 0x00000000 r5 0x20000090 r10 0x00000000 pc 0x08000934 primask 0x00 + r1 0x00000040 r6 0x00000000 r11 0x00000000 xPSR 0x61000000 basepri 0x00 + r2 0x006000d0 r7 0x00000000 r12 0x0000000a fpscr 0x00000010 faultmask 0x00 + r3 0x00000000 r8 0x00000000 sp 0x2000fff8 msp 0x2000fff8 control 0x04 + r4 0x20000128 r9 0x00000000 lr 0x08000935 psp 0x00000000 +### Source ########################################################################################################## + 117 mc_init(); + 118 HAL_UART_Receive_IT(&huart2, &huart2_rxc, 1); + 119 HAL_TIM_Base_Start_IT(&htim6); + 120 /* USER CODE END 2 */ + 121 + 122 /* Infinite loop */ + 123 /* USER CODE BEGIN WHILE */ + 124 while (1) + 125 { + 126 mc_service(); + 127 if(b_timer_struck) + 128 { + 129 b_timer_struck = false; + 130 PDEBUG("%d\n", sys_time); + 131 } + 132 /* USER CODE END WHILE */ + 133 + 134 /* USER CODE BEGIN 3 */ + 135 } + 136 /* USER CODE END 3 */ +### Stack ########################################################################################################### +[0] from 0x08000934 in main+104 at Core/Src/main.c:127 +### Threads ######################################################################################################### +[1] id 0 from 0x08000934 in main+104 at Core/Src/main.c:127 +### Variables ####################################################################################################### +##################################################################################################################### +Loading section .isr_vector, size 0x190 lma 0x8000000 +Loading section .text, size 0x3d18 lma 0x8000190 +Loading section .rodata, size 0xc8 lma 0x8003ea8 +Loading section .ARM, size 0x8 lma 0x8003f70 +Loading section .init_array, size 0x8 lma 0x8003f78 +Loading section .fini_array, size 0x8 lma 0x8003f80 +Loading section .data, size 0x70 lma 0x8003f88 +Start address 0x08003334, load size 16376 +Transfer rate: 19 KB/sec, 2339 bytes/write. +Unable to match requested speed 500 kHz, using 480 kHz +Unable to match requested speed 500 kHz, using 480 kHz +A debugging session is active. + + Inferior 1 [Remote target] will be detached. + +Quit anyway? (y or n) [answered Y; input not from terminal] +[Inferior 1 (Remote target) detached] diff --git a/generic_debug.gdb b/generic_debug.gdb new file mode 100644 index 0000000..909796e --- /dev/null +++ b/generic_debug.gdb @@ -0,0 +1,7 @@ +set pagination off +set logging file gdb.txt +set logging on +set mem inaccessible-by-default off +target extended-remote localhost:3333 +monitor reset halt +load diff --git a/motor_controller.ioc b/motor_controller.ioc index 929b293..082d26f 100644 --- a/motor_controller.ioc +++ b/motor_controller.ioc @@ -7,8 +7,9 @@ Mcu.IP0=NVIC Mcu.IP1=RCC Mcu.IP2=SYS Mcu.IP3=TIM2 -Mcu.IP4=USART2 -Mcu.IPNb=5 +Mcu.IP4=TIM6 +Mcu.IP5=USART2 +Mcu.IPNb=6 Mcu.Name=STM32L432K(B-C)Ux Mcu.Package=UFQFPN32 Mcu.Pin0=PC14-OSC32_IN (PC14) @@ -18,6 +19,7 @@ Mcu.Pin11=PA14 (JTCK-SWCLK) Mcu.Pin12=PA15 (JTDI) Mcu.Pin13=PB3 (JTDO-TRACESWO) Mcu.Pin14=VP_SYS_VS_Systick +Mcu.Pin15=VP_TIM6_VS_ClockSourceINT Mcu.Pin2=PA0 Mcu.Pin3=PA1 Mcu.Pin4=PA2 @@ -26,7 +28,7 @@ Mcu.Pin6=PA4 Mcu.Pin7=PA5 Mcu.Pin8=PA8 Mcu.Pin9=PA9 -Mcu.PinsNb=15 +Mcu.PinsNb=16 Mcu.ThirdPartyNb=0 Mcu.UserConstants= Mcu.UserName=STM32L432KCUx @@ -42,6 +44,7 @@ NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true NVIC.SysTick_IRQn=true\:0\:0\:true\:false\:true\:true\:true\:true +NVIC.TIM6_DAC_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true NVIC.USART2_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true PA0.GPIOParameters=GPIO_Label @@ -121,7 +124,7 @@ ProjectManager.StackSize=0x400 ProjectManager.TargetToolchain=Makefile ProjectManager.ToolChainLocation= ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_TIM2_Init-TIM2-false-HAL-true,4-MX_USART2_UART_Init-USART2-false-HAL-true +ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_TIM2_Init-TIM2-false-HAL-true,4-MX_USART2_UART_Init-USART2-false-HAL-true,5-MX_TIM1_Init-TIM1-false-HAL-true RCC.48CLKFreq_Value=24000000 RCC.AHBFreq_Value=32000000 RCC.APB1Freq_Value=32000000 @@ -188,9 +191,15 @@ TIM2.Period=499 TIM2.Prescaler=127 TIM2.Pulse-PWM\ Generation2\ CH2=250 TIM2.Pulse-PWM\ Generation4\ CH4=125 +TIM6.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE +TIM6.IPParameters=Prescaler,AutoReloadPreload,Period +TIM6.Period=999 +TIM6.Prescaler=127 USART2.IPParameters=VirtualMode-Asynchronous USART2.VirtualMode-Asynchronous=VM_ASYNC VP_SYS_VS_Systick.Mode=SysTick VP_SYS_VS_Systick.Signal=SYS_VS_Systick +VP_TIM6_VS_ClockSourceINT.Mode=Enable_Timer +VP_TIM6_VS_ClockSourceINT.Signal=TIM6_VS_ClockSourceINT board=NUCLEO-L432KC boardIOC=true diff --git a/shared/devices/motor_controller.c b/shared/devices/motor_controller.c index 4f546e7..5cffd4c 100644 --- a/shared/devices/motor_controller.c +++ b/shared/devices/motor_controller.c @@ -1,6 +1,11 @@ #include "motor_controller.h" -void motor_controller_init() +void mc_init() { // } + +void mc_service() +{ + +} diff --git a/shared/devices/motor_controller.h b/shared/devices/motor_controller.h index 1287ef1..c0700e7 100644 --- a/shared/devices/motor_controller.h +++ b/shared/devices/motor_controller.h @@ -3,6 +3,8 @@ #include "main.h" -void motor_controller_init(void); +void mc_init(void); + +void mc_service(void); #endif diff --git a/shared/util/putil.c b/shared/util/putil.c index 3dedef9..67983f5 100644 --- a/shared/util/putil.c +++ b/shared/util/putil.c @@ -28,4 +28,6 @@ int p_printf(const char* fmt, ...) void p_uart_init(UART_HandleTypeDef* huart) { huart_inst = huart; + PDEBUG("...\n"); + PDEBUG("UART2 Initialized\n"); }