MKS SKIPR CAN Bus

If i look at the specs, the 407 has an ethernet interface, the 446 not.
The can bus is like a network.
Is this maybe the clue? @koconnor

So far I have not found the resistors on the board. Small SMD shit without PCB labeling.
What surprises me: I tried to find the resistance value of R263/264 by measuring between MCU and transceiver. The meter showed 10 Megaohm. That can’t be right.
Does the STM32F407 have open drain outputs? In this case pullups could still be involved.
I will check again tomorrow.

1 Like

I double check my results from yesterday now with my oszilloscope.
The results are the same - no traffic, no signals from MCU on PB12/13
I also found the resistors R263/264! The values are 100ohm each.
The wiring seems to be ok. It is like on the wiring diagram

Fun fact :grinning: I also checked the SHT36.
The resistors and the capacitor are at the right place. The wiring diagram is faulty :rofl:
There is a jumper to activate the termination - all seems to be fine.

Bottom side - direct connection to the transceiver. No series resistors:

Upper side: Jumper to activate the resistors between CAN-H and CAN-L

Another idea:
Due to the fact that there is no traffic on the CAN bus, I ask myself whether the MCU is correctly pre-configured!

There is a lot to set up with the STM32CubeIDE Device configuration tool to configure CAN correctly. Has Makerbase done this itself? Or were the MCUs delivered pre-configured? I don’t know.

Is there a possibility to read out or change the configuration afterwards? Similar to what can be done with Atmel-MCUs via the ISP header?

Addendum:
As far as I understood this tool can generate a code skeleton with the correct configuration for CAN-bus communication.

We can compare this code skeleton with the klipper sourccode to check whether the configuration has been done correctly by Klipper.

Hmmm, could be the right direction to solve this problem.
Bummer, until 2023-01-11 i can’t check this.
Maybe Ralf could check it

:grimacing: I’ll try my best.
But I am not familar in coding STM. I’am on the Atmel/Microchip side.
Maybe a klipper developer can help?

I think we can say now that the issue is on the software side. So IMHO it is up to the Klipper developers to help.

Planning to use skipr in my voron build.
Don’t know if you guys already use this, but maybe use canboot like here?

Hmmm, the Monster8 uses the stm32v407 too, but can bus in the i²c pins :thinking:

Cosmicos, can you check on which pins the can transceiver is soldered to?
Maybe the schematic is wrong?

On Monster8:

As before, I’m not really able to offer much advice. However, if you think Klipper is not assigning the pins correctly, you could try some simple tests. Compile the board in simple USB mode, setup a test printer.cfg file, and declare an [output_pin test_pin] using pin: PB13. Try setting different values and pwm cycle rates on that pin using the SET_PIN command. Use the scope to verify that the corresponding changes show up on the CANTx, CANRx, CANH, CANL, etc lines.

-Kevin

2 Likes

On SKIPR the transceiver is soldered to PB12/PB13!

No. But according to the STM32F407 datasheet the CAN bus on Monster is connected to CAN1 (PB8/9)!

On SKIPR it is connected to CAN2 (PB12/13)!

That’s really interesting :thinking:
We could change the configuration to CAN1 and put the oscilloscope to PB8/9. Maybe we’ll find a signal there…

1 Like

Hmm… unfortunately this is not possible.
PB8/9 on SKIPR is connected to an serial EEPROM (AT24C32D). So these ports are busy…

Yeah, but like kevin wrote, just flash a clean standard firmware, like the skipr original.
And let us use the can high and low pins for two aux fans declared in printer.cfg with different pwm frequencies.

These frequencies should show up on the osci

Ok, it is done…

  • USB-Image on MCU (status connected)
  • printer.cfg
[output_pin B12]
pin: PB12
pwm: TRUE
#pin: PB13
  • command:
SET_PIN PIN=B12 VALUE=0.5 
#SET_PIN PIN=B13 VALUE=0.5

I got one signal each per pin:

Klipper is assigning the pins correctly!

1 Like

What was the scope attached to in that picture?

In any case, you’ll want to test that Klipper can successfully use the CANTx line (PB13) - writing on the CANRx line (PB12) doesn’t indicate much.

-Kevin

The scope was attached successively on PB12 and PB13. Each port was then triggered by command and the signal measured. I could measure signals on PB12 as well as on PB13 with appropriate triggering.
When I install a CAN image no signals are measurable on the CAN bus (PB12/13). See my earlier posts…

1 Like

Did you have measured at the can connector too? Behind the transceiver

No, yesterday I have measured at the MCU pins only.
At my first measurement of the CAN communication I had also measured behind the transceiver. But nothing can be forwarded from the transceiver if there is no input signal…

Yeah, i know, it just to complete thenpath, so we know it’s a firmware only problem.

I was able to reproduce this problem on my stm32f446 dev board. It seems the original CAN2 support on stm32f4 was only ever “stubbed out”. Actually using the CAN2 hardware on stm32f4 requires the software to program a goofy mix of CAN1 and CAN2.

I put together a PR to support CAN2 at: stm32: Fix CAN2 handling in can.c by KevinOConnor · Pull Request #5988 · Klipper3d/klipper · GitHub

@bondus - FYI.

-Kevin

2 Likes