This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/175 can transmission #206
Merged
Merged
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
3994c20
added transmit :3
NicoOhR 5f395c0
updating to submodules
NicoOhR 4837825
update merge
NicoOhR 815864e
changing submodule
NicoOhR 32cae9c
update paths
NicoOhR 7f76dc1
matched cproject with develop, updated libs
NicoOhR 7a84d23
update libs
NicoOhR 491bcae
Merge branch 'develop' into feature/175_CAN-transmission
NicoOhR c5ff122
changed app to match new data logger
NicoOhR e06930e
submodule update
NicoOhR 7b35ec6
added relay to app
NicoOhR e35aa1a
update submodules
NicoOhR 0a6d371
pulling remote
NicoOhR cdfc331
see submodule ;P
NicoOhR 302d088
submodule things
NicoOhR 2529154
added step to workflow
NicoOhR b2d0aa6
test submodule in CI build
NicoOhR a9e97e9
changed submodule branch
NicoOhR 58ceeae
changed submodule branch now without qoutes
NicoOhR 3f0a192
changed action from push to PR
NicoOhR 9400715
changing priority
NicoOhR 5221052
nart excplicitly disabled, debugging in app, relay thread
NicoOhR 2311dfa
message transmits fine in main, confirming it's a circuit problem
NicoOhR b26807a
minor restructuring in app, transmission works
NicoOhR 9702b4f
transmits and fails as expected
NicoOhR e54bc5e
updated transmission code
NicoOhR b46295f
changed thread prio, minor cleanup
NicoOhR 5ec7aea
minor changes to app and lib update
NicoOhR 1346d60
changed nomenclature and added write only can bus
NicoOhR edb185a
can2 baud rate set correctly
NicoOhR b1c7f12
testing transmission with linpot hooked up
NicoOhR 98b7241
restoring code to deployable version
NicoOhR 1869b04
missed some testing changes, TODO: move relay to own queue
NicoOhR c82518d
added relay queue, decoupling from datalogger
NicoOhR 4e08548
signaling end of transmission
NicoOhR d68da6b
1Mhz CAN buad rate
NicoOhR 8bcde0f
interrupts added back in, not sure why they were deleted
NicoOhR edabc65
rx pin pull up
NicoOhR 962dc51
sneaking by 10hz sample rate
NicoOhR d7d0019
switched back to 0.5hz
NicoOhR ff317d3
debugging changes
NicoOhR 8a2cf9a
linpot + ECU 10hz
NicoOhR 2334bfe
arb ids
NicoOhR ed5bcdb
breaking changes to IOC b/c stuck pin on devboard
NicoOhR a35db8f
rx pullup enabled, 100hz
NicoOhR 1759725
working setup for autocross
NicoOhR 2071762
autocross, removed printf
NicoOhR 87b3545
autocross, removed printf
NicoOhR 5281e9e
fixed typo
NicoOhR a93ae5a
Merge branch 'develop' into feature/175_CAN-transmission
NicoOhR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "Project/DAQ_System/Program/DFR_Libraries"] | ||
path = Project/DAQ_System/Program/DFR_Libraries | ||
url = https://github.com/DallasFormulaRacing/DAQ-Firmware-Libraries.git | ||
url = https://github.com/DallasFormulaRacing/DAQ-Firmware-Libraries.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
sfrviewstate={"fFavorites"\:{"fLists"\:{}},"fProperties"\:{"fNodeProperties"\:{}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
sfrviewstate={"fFavorites"\:{"fLists"\:{}},"fProperties"\:{"fNodeProperties"\:{}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
/* USER CODE END 0 */ | ||
|
||
CAN_HandleTypeDef hcan1; | ||
CAN_HandleTypeDef hcan2; | ||
|
||
/* CAN1 init function */ | ||
void MX_CAN1_Init(void) | ||
|
@@ -38,11 +39,11 @@ void MX_CAN1_Init(void) | |
|
||
/* USER CODE END CAN1_Init 1 */ | ||
hcan1.Instance = CAN1; | ||
hcan1.Init.Prescaler = 24; | ||
hcan1.Init.Prescaler = 12; | ||
hcan1.Init.Mode = CAN_MODE_NORMAL; | ||
hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ; | ||
hcan1.Init.TimeSeg1 = CAN_BS1_3TQ; | ||
hcan1.Init.TimeSeg2 = CAN_BS2_3TQ; | ||
hcan1.Init.TimeSeg1 = CAN_BS1_11TQ; | ||
hcan1.Init.TimeSeg2 = CAN_BS2_2TQ; | ||
Comment on lines
-41
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sure to document how you selected these parameters on the CubeMX settings There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will do |
||
hcan1.Init.TimeTriggeredMode = DISABLE; | ||
hcan1.Init.AutoBusOff = DISABLE; | ||
hcan1.Init.AutoWakeUp = DISABLE; | ||
|
@@ -57,8 +58,42 @@ void MX_CAN1_Init(void) | |
|
||
/* USER CODE END CAN1_Init 2 */ | ||
|
||
} | ||
/* CAN2 init function */ | ||
void MX_CAN2_Init(void) | ||
{ | ||
|
||
/* USER CODE BEGIN CAN2_Init 0 */ | ||
|
||
/* USER CODE END CAN2_Init 0 */ | ||
|
||
/* USER CODE BEGIN CAN2_Init 1 */ | ||
|
||
/* USER CODE END CAN2_Init 1 */ | ||
hcan2.Instance = CAN2; | ||
hcan2.Init.Prescaler = 12; | ||
hcan2.Init.Mode = CAN_MODE_NORMAL; | ||
hcan2.Init.SyncJumpWidth = CAN_SJW_1TQ; | ||
hcan2.Init.TimeSeg1 = CAN_BS1_11TQ; | ||
hcan2.Init.TimeSeg2 = CAN_BS2_2TQ; | ||
hcan2.Init.TimeTriggeredMode = DISABLE; | ||
hcan2.Init.AutoBusOff = DISABLE; | ||
hcan2.Init.AutoWakeUp = DISABLE; | ||
hcan2.Init.AutoRetransmission = DISABLE; | ||
hcan2.Init.ReceiveFifoLocked = DISABLE; | ||
hcan2.Init.TransmitFifoPriority = DISABLE; | ||
if (HAL_CAN_Init(&hcan2) != HAL_OK) | ||
{ | ||
Error_Handler(); | ||
} | ||
/* USER CODE BEGIN CAN2_Init 2 */ | ||
|
||
/* USER CODE END CAN2_Init 2 */ | ||
|
||
} | ||
|
||
static uint32_t HAL_RCC_CAN1_CLK_ENABLED=0; | ||
|
||
void HAL_CAN_MspInit(CAN_HandleTypeDef* canHandle) | ||
{ | ||
|
||
|
@@ -69,14 +104,24 @@ void HAL_CAN_MspInit(CAN_HandleTypeDef* canHandle) | |
|
||
/* USER CODE END CAN1_MspInit 0 */ | ||
/* CAN1 clock enable */ | ||
__HAL_RCC_CAN1_CLK_ENABLE(); | ||
HAL_RCC_CAN1_CLK_ENABLED++; | ||
if(HAL_RCC_CAN1_CLK_ENABLED==1){ | ||
__HAL_RCC_CAN1_CLK_ENABLE(); | ||
} | ||
|
||
__HAL_RCC_GPIOD_CLK_ENABLE(); | ||
/**CAN1 GPIO Configuration | ||
PD0 ------> CAN1_RX | ||
PD1 ------> CAN1_TX | ||
*/ | ||
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1; | ||
GPIO_InitStruct.Pin = GPIO_PIN_0; | ||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | ||
GPIO_InitStruct.Pull = GPIO_PULLUP; | ||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | ||
GPIO_InitStruct.Alternate = GPIO_AF9_CAN1; | ||
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); | ||
|
||
GPIO_InitStruct.Pin = GPIO_PIN_1; | ||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | ||
GPIO_InitStruct.Pull = GPIO_NOPULL; | ||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | ||
|
@@ -92,6 +137,46 @@ void HAL_CAN_MspInit(CAN_HandleTypeDef* canHandle) | |
|
||
/* USER CODE END CAN1_MspInit 1 */ | ||
} | ||
else if(canHandle->Instance==CAN2) | ||
{ | ||
/* USER CODE BEGIN CAN2_MspInit 0 */ | ||
|
||
/* USER CODE END CAN2_MspInit 0 */ | ||
/* CAN2 clock enable */ | ||
__HAL_RCC_CAN2_CLK_ENABLE(); | ||
HAL_RCC_CAN1_CLK_ENABLED++; | ||
if(HAL_RCC_CAN1_CLK_ENABLED==1){ | ||
__HAL_RCC_CAN1_CLK_ENABLE(); | ||
} | ||
|
||
__HAL_RCC_GPIOB_CLK_ENABLE(); | ||
/**CAN2 GPIO Configuration | ||
PB5 ------> CAN2_RX | ||
PB6 ------> CAN2_TX | ||
*/ | ||
GPIO_InitStruct.Pin = GPIO_PIN_5; | ||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | ||
GPIO_InitStruct.Pull = GPIO_PULLUP; | ||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | ||
GPIO_InitStruct.Alternate = GPIO_AF9_CAN2; | ||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); | ||
|
||
GPIO_InitStruct.Pin = GPIO_PIN_6; | ||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | ||
GPIO_InitStruct.Pull = GPIO_NOPULL; | ||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | ||
GPIO_InitStruct.Alternate = GPIO_AF9_CAN2; | ||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); | ||
|
||
/* CAN2 interrupt Init */ | ||
HAL_NVIC_SetPriority(CAN2_RX0_IRQn, 5, 0); | ||
HAL_NVIC_EnableIRQ(CAN2_RX0_IRQn); | ||
HAL_NVIC_SetPriority(CAN2_RX1_IRQn, 5, 0); | ||
HAL_NVIC_EnableIRQ(CAN2_RX1_IRQn); | ||
/* USER CODE BEGIN CAN2_MspInit 1 */ | ||
|
||
/* USER CODE END CAN2_MspInit 1 */ | ||
} | ||
} | ||
|
||
void HAL_CAN_MspDeInit(CAN_HandleTypeDef* canHandle) | ||
|
@@ -103,7 +188,10 @@ void HAL_CAN_MspDeInit(CAN_HandleTypeDef* canHandle) | |
|
||
/* USER CODE END CAN1_MspDeInit 0 */ | ||
/* Peripheral clock disable */ | ||
__HAL_RCC_CAN1_CLK_DISABLE(); | ||
HAL_RCC_CAN1_CLK_ENABLED--; | ||
if(HAL_RCC_CAN1_CLK_ENABLED==0){ | ||
__HAL_RCC_CAN1_CLK_DISABLE(); | ||
} | ||
|
||
/**CAN1 GPIO Configuration | ||
PD0 ------> CAN1_RX | ||
|
@@ -118,6 +206,31 @@ void HAL_CAN_MspDeInit(CAN_HandleTypeDef* canHandle) | |
|
||
/* USER CODE END CAN1_MspDeInit 1 */ | ||
} | ||
else if(canHandle->Instance==CAN2) | ||
{ | ||
/* USER CODE BEGIN CAN2_MspDeInit 0 */ | ||
|
||
/* USER CODE END CAN2_MspDeInit 0 */ | ||
/* Peripheral clock disable */ | ||
__HAL_RCC_CAN2_CLK_DISABLE(); | ||
HAL_RCC_CAN1_CLK_ENABLED--; | ||
if(HAL_RCC_CAN1_CLK_ENABLED==0){ | ||
__HAL_RCC_CAN1_CLK_DISABLE(); | ||
} | ||
|
||
/**CAN2 GPIO Configuration | ||
PB5 ------> CAN2_RX | ||
PB6 ------> CAN2_TX | ||
*/ | ||
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_5|GPIO_PIN_6); | ||
|
||
/* CAN2 interrupt Deinit */ | ||
HAL_NVIC_DisableIRQ(CAN2_RX0_IRQn); | ||
HAL_NVIC_DisableIRQ(CAN2_RX1_IRQn); | ||
/* USER CODE BEGIN CAN2_MspDeInit 1 */ | ||
|
||
/* USER CODE END CAN2_MspDeInit 1 */ | ||
} | ||
} | ||
|
||
/* USER CODE BEGIN 1 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
/* USER CODE BEGIN Header */ | ||
/** | ||
****************************************************************************** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the USB data logger still working properly?
It has happened to me once or twice that a pin is removed or no longer initialized after messing with CubeMX a bit. I may have accidentally toggled something that I did not mean to, but I did have to set the CubeMX settings again. In my case, the GPIO pin for the timestamp timer interrupt was not working properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check on that next time im in the shop, I'm pretty sure it is. The same thing as what happened in
Project/DAQ_System/Core/Inc/stm32f4xx_it.h
might've happened here