2 Commits

Author SHA1 Message Date
eeeck 33a2cc8fb4 Enable USART1 global interrupt 2026-06-18 15:02:19 +02:00
eeeck 41de3851f2 Implement better ciclical method for dummy CAN frame sent on debug 2026-06-18 14:06:00 +02:00
5 changed files with 30 additions and 1 deletions
+1
View File
@@ -52,6 +52,7 @@ void MemManage_Handler(void);
void BusFault_Handler(void); void BusFault_Handler(void);
void UsageFault_Handler(void); void UsageFault_Handler(void);
void DebugMon_Handler(void); void DebugMon_Handler(void);
void USART1_IRQHandler(void);
void SDIO_IRQHandler(void); void SDIO_IRQHandler(void);
void TIM6_DAC_IRQHandler(void); void TIM6_DAC_IRQHandler(void);
void DMA2_Stream3_IRQHandler(void); void DMA2_Stream3_IRQHandler(void);
+7 -1
View File
@@ -118,12 +118,18 @@ void vUARTLogger(void *argument)
{ {
DEBUG_PRINT("Waiting for CAN traffic...\r\n"); DEBUG_PRINT("Waiting for CAN traffic...\r\n");
#ifdef DEBUG_DUMMY_FRAME
#define uint32_t queue_timeout = 1000U;
#else
#define uint32_t queue_timeout = osWaitForever;
#endif
#ifdef DEBUG_DUMMY_FRAME #ifdef DEBUG_DUMMY_FRAME
osMessageQueuePut(xUARTQueue, &dummy_frame, 0U, 0U); osMessageQueuePut(xUARTQueue, &dummy_frame, 0U, 0U);
osDelay(1000); osDelay(1000);
#endif #endif
if (osMessageQueueGet(xUARTQueue, &message, NULL, osWaitForever) == osOK) if (osMessageQueueGet(xUARTQueue, &message, NULL, queue_timeout) == osOK)
{ {
osSemaphoreAcquire(xUARTDMASemaphore, osWaitForever); osSemaphoreAcquire(xUARTDMASemaphore, osWaitForever);
int len = format_can_message(tx_buffer, message.source, &message); int len = format_can_message(tx_buffer, message.source, &message);
+6
View File
@@ -392,6 +392,9 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
__HAL_LINKDMA(huart,hdmatx,hdma_usart1_tx); __HAL_LINKDMA(huart,hdmatx,hdma_usart1_tx);
/* USART1 interrupt Init */
HAL_NVIC_SetPriority(USART1_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(USART1_IRQn);
/* USER CODE BEGIN USART1_MspInit 1 */ /* USER CODE BEGIN USART1_MspInit 1 */
/* USER CODE END USART1_MspInit 1 */ /* USER CODE END USART1_MspInit 1 */
@@ -424,6 +427,9 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
/* USART1 DMA DeInit */ /* USART1 DMA DeInit */
HAL_DMA_DeInit(huart->hdmatx); HAL_DMA_DeInit(huart->hdmatx);
/* USART1 interrupt DeInit */
HAL_NVIC_DisableIRQ(USART1_IRQn);
/* USER CODE BEGIN USART1_MspDeInit 1 */ /* USER CODE BEGIN USART1_MspDeInit 1 */
/* USER CODE END USART1_MspDeInit 1 */ /* USER CODE END USART1_MspDeInit 1 */
+15
View File
@@ -59,6 +59,7 @@ extern DMA_HandleTypeDef hdma_sdio_rx;
extern DMA_HandleTypeDef hdma_sdio_tx; extern DMA_HandleTypeDef hdma_sdio_tx;
extern SD_HandleTypeDef hsd; extern SD_HandleTypeDef hsd;
extern DMA_HandleTypeDef hdma_usart1_tx; extern DMA_HandleTypeDef hdma_usart1_tx;
extern UART_HandleTypeDef huart1;
extern TIM_HandleTypeDef htim6; extern TIM_HandleTypeDef htim6;
/* USER CODE BEGIN EV */ /* USER CODE BEGIN EV */
@@ -163,6 +164,20 @@ void DebugMon_Handler(void)
/* please refer to the startup file (startup_stm32f4xx.s). */ /* please refer to the startup file (startup_stm32f4xx.s). */
/******************************************************************************/ /******************************************************************************/
/**
* @brief This function handles USART1 global interrupt.
*/
void USART1_IRQHandler(void)
{
/* USER CODE BEGIN USART1_IRQn 0 */
/* USER CODE END USART1_IRQn 0 */
HAL_UART_IRQHandler(&huart1);
/* USER CODE BEGIN USART1_IRQn 1 */
/* USER CODE END USART1_IRQn 1 */
}
/** /**
* @brief This function handles SDIO global interrupt. * @brief This function handles SDIO global interrupt.
*/ */
+1
View File
@@ -124,6 +124,7 @@ NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:true\:false
NVIC.TIM6_DAC_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true\:true NVIC.TIM6_DAC_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true\:true
NVIC.TimeBase=TIM6_DAC_IRQn NVIC.TimeBase=TIM6_DAC_IRQn
NVIC.TimeBaseIP=TIM6 NVIC.TimeBaseIP=TIM6
NVIC.USART1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
PA10.Mode=Asynchronous PA10.Mode=Asynchronous
PA10.Signal=USART1_RX PA10.Signal=USART1_RX