albertaloop / Firmware

0 stars 0 forks source link

CANbus on STM32MP1 #5

Closed Iyury1 closed 1 month ago

Iyury1 commented 3 months ago

Summary

Set up CAN communication between the STM32MP157f-DK2 and a Teensy dev board.

To achieve this, we need to run through some more tutorials on the STM32MP1. So far, we have only run the starter image. The next step is the go through the Develop on Cortex-A7 section of the getting started guide.

For good measure, we should complete the "Develop on Cortex M4" section as well.

After that, we need to create a CAN test program utilizing the CAN tutorials for the STM32MP1 https://wiki.st.com/stm32mpu/wiki/CAN_overview. This tutorial uses SocketCAN on the Cortex A7 with Linux.

I am not sure how we will use the Cortex M4 yet for the state machine, perhaps we would want to do CAN communication on the M4 instead of the A7, but for now using SocketCAN on the A7 seems like a good starting point.

Iyury1 commented 3 months ago

started tutorial on CAN bus for STM32 https://docs.google.com/document/d/1_0QLbN6RWvbW0IhxZVSfYxwLEGdXrxzwW-dWZHwOeXc/edit?usp=sharing

It looks like we have to use pins 3 and 5 of the the CN2 header, which are also used by one of the I2C buses on the board. We may have to disable the pull-up resistors for this I2C bus. We will also have to make a modification to the DTC.

Iyury1 commented 3 months ago

Updated the notes on google docs.

Added branch containing a dockerfile for building the stm32mp1 SDK and the developer package kernel.

The SDK and kernel sources cannot be downloaded from the container, because ST's website wants you to enter your log in credentials. Instead, you must download the archives from st.com and place them in the same folder as the dockerfile. These archives will be copied into the container using the COPY command.