diff --git a/Core/Inc/stm32f4xx_it.h b/Core/Inc/stm32f4xx_it.h index 53e0c55..232bacd 100644 --- a/Core/Inc/stm32f4xx_it.h +++ b/Core/Inc/stm32f4xx_it.h @@ -52,7 +52,6 @@ void MemManage_Handler(void); void BusFault_Handler(void); void UsageFault_Handler(void); void DebugMon_Handler(void); -void CAN1_RX0_IRQHandler(void); void TIM5_IRQHandler(void); void DMA2_Stream0_IRQHandler(void); /* USER CODE BEGIN EFP */ diff --git a/Core/Src/main.c b/Core/Src/main.c index 1d053c3..b2d69b2 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -398,7 +398,7 @@ static void MX_CAN1_Init(void) /* USER CODE END CAN1_Init 1 */ hcan1.Instance = CAN1; - hcan1.Init.Prescaler = 1; + hcan1.Init.Prescaler = 2; hcan1.Init.Mode = CAN_MODE_NORMAL; hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ; hcan1.Init.TimeSeg1 = CAN_BS1_13TQ; @@ -414,7 +414,6 @@ static void MX_CAN1_Init(void) Error_Handler(); } /* USER CODE BEGIN CAN1_Init 2 */ - can1_init(&hcan1); /* USER CODE END CAN1_Init 2 */ diff --git a/Core/Src/stm32f4xx_hal_msp.c b/Core/Src/stm32f4xx_hal_msp.c index 682805d..2fd16dd 100644 --- a/Core/Src/stm32f4xx_hal_msp.c +++ b/Core/Src/stm32f4xx_hal_msp.c @@ -195,9 +195,6 @@ void HAL_CAN_MspInit(CAN_HandleTypeDef* hcan) GPIO_InitStruct.Alternate = GPIO_AF9_CAN1; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - /* CAN1 interrupt Init */ - HAL_NVIC_SetPriority(CAN1_RX0_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(CAN1_RX0_IRQn); /* USER CODE BEGIN CAN1_MspInit 1 */ /* USER CODE END CAN1_MspInit 1 */ @@ -227,8 +224,6 @@ void HAL_CAN_MspDeInit(CAN_HandleTypeDef* hcan) */ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11|GPIO_PIN_12); - /* CAN1 interrupt DeInit */ - HAL_NVIC_DisableIRQ(CAN1_RX0_IRQn); /* USER CODE BEGIN CAN1_MspDeInit 1 */ /* USER CODE END CAN1_MspDeInit 1 */ diff --git a/Core/Src/stm32f4xx_it.c b/Core/Src/stm32f4xx_it.c index 55a2bd2..f3baa99 100644 --- a/Core/Src/stm32f4xx_it.c +++ b/Core/Src/stm32f4xx_it.c @@ -56,7 +56,6 @@ /* External variables --------------------------------------------------------*/ extern DMA_HandleTypeDef hdma_adc1; -extern CAN_HandleTypeDef hcan1; extern TIM_HandleTypeDef htim5; /* USER CODE BEGIN EV */ @@ -161,20 +160,6 @@ void DebugMon_Handler(void) /* please refer to the startup file (startup_stm32f4xx.s). */ /******************************************************************************/ -/** - * @brief This function handles CAN1 RX0 interrupts. - */ -void CAN1_RX0_IRQHandler(void) -{ - /* USER CODE BEGIN CAN1_RX0_IRQn 0 */ - - /* USER CODE END CAN1_RX0_IRQn 0 */ - HAL_CAN_IRQHandler(&hcan1); - /* USER CODE BEGIN CAN1_RX0_IRQn 1 */ - - /* USER CODE END CAN1_RX0_IRQn 1 */ -} - /** * @brief This function handles TIM5 global interrupt. */ diff --git a/Drivers/Embedded-Base b/Drivers/Embedded-Base index e3359df..fe86adc 160000 --- a/Drivers/Embedded-Base +++ b/Drivers/Embedded-Base @@ -1 +1 @@ -Subproject commit e3359dff1d54a7abdb0890911828ce2fc4f86513 +Subproject commit fe86adccf26edb23b0d80366a99426d177ed824d diff --git a/MSB-FW.ioc b/MSB-FW.ioc index 948a737..ecc3d94 100644 --- a/MSB-FW.ioc +++ b/MSB-FW.ioc @@ -24,12 +24,12 @@ CAD.provider= CAN1.ABOM=ENABLE CAN1.BS1=CAN_BS1_13TQ CAN1.BS2=CAN_BS2_2TQ -CAN1.CalculateBaudRate=1000000 -CAN1.CalculateTimeBit=1000 -CAN1.CalculateTimeQuantum=62.5 +CAN1.CalculateBaudRate=500000 +CAN1.CalculateTimeBit=2000 +CAN1.CalculateTimeQuantum=125.0 CAN1.IPParameters=CalculateTimeQuantum,CalculateTimeBit,CalculateBaudRate,Prescaler,BS1,BS2,ABOM,NART CAN1.NART=DISABLE -CAN1.Prescaler=1 +CAN1.Prescaler=2 Dma.ADC1.0.Direction=DMA_PERIPH_TO_MEMORY Dma.ADC1.0.FIFOMode=DMA_FIFOMODE_DISABLE Dma.ADC1.0.Instance=DMA2_Stream0 @@ -104,7 +104,6 @@ Mcu.UserName=STM32F405RGTx MxCube.Version=6.11.1 MxDb.Version=DB.6.0.111 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false -NVIC.CAN1_RX0_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true NVIC.DMA2_Stream0_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false NVIC.ForceEnableDMAVector=true diff --git a/Makefile b/Makefile index c63d47e..f8f8c0e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ ########################################################################################################################## -# File automatically-generated by tool: [projectgenerator] version: [4.3.0-B58] date: [Mon Sep 30 23:00:37 GMT 2024] +# File automatically-generated by tool: [projectgenerator] version: [4.3.0-B58] date: [Fri Oct 18 02:28:33 GMT 2024] ########################################################################################################################## # ------------------------------------------------ diff --git a/compose.yml b/compose.yml index 14ef1a2..a9bd242 100644 --- a/compose.yml +++ b/compose.yml @@ -4,8 +4,9 @@ services: ner-gcc-arm: image: ghcr.io/northeastern-electric-racing/embedded-base:main build: . - # network_mode: host + network_mode: host privileged: true + volumes: - type: bind source: . diff --git a/flash.cfg b/flash.cfg index a5a00f1..23aacea 100644 --- a/flash.cfg +++ b/flash.cfg @@ -7,8 +7,3 @@ source [find target/${STM_TARGET_NAME}x.cfg] # Set the adapter speed adapter speed 5000 -# find elf -set elf_file "build/MSB-FW.elf" - -# Program the ELF file -program $elf_file verify reset exit \ No newline at end of file