Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Feature/175 can transmission #206

Merged
merged 50 commits into from
Oct 12, 2024
Merged

Feature/175 can transmission #206

merged 50 commits into from
Oct 12, 2024

Conversation

NicoOhR
Copy link
Member

@NicoOhR NicoOhR commented Aug 2, 2024

Summary

Communication from the STM32 to the Raspberry Pi (or any CAN connected device on the Communications line). Introduced a secondary queue as well as the Relay Thread, along with the necessary Mutex's. To debug the connection on the Pi there is this repository. It has been tested with an analog device and writes to a file accurate results.

Remarks

Before closing the branch I'm going to make some changes to the timing, trying to get as many data points to the Pi as possible.

Checks

  • Tested
  • Housekeeping

Copy link
Member

@crsz20 crsz20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! I would approve it once we are sure that these changes are not affecting the DataLogger

Comment on lines -87 to -88
#define USB_PowerSwitchOn_Pin GPIO_PIN_6
#define USB_PowerSwitchOn_GPIO_Port GPIOG
Copy link
Member

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

Copy link
Member Author

@NicoOhR NicoOhR Aug 17, 2024

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

Comment on lines 55 to 56
void CAN1_RX0_IRQHandler(void);
void CAN1_RX1_IRQHandler(void);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are interrupts for receiving CAN messages from the ECU now disabled?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They seem to be on this version, I think I might've misclicked or something on CubeMx, fixed

Comment on lines -41 to +46
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;
Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

@NicoOhR NicoOhR merged commit f20dfeb into develop Oct 12, 2024
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants