STM32F4xx icon indicating copy to clipboard operation
STM32F4xx copied to clipboard

Is TMC2209 enabled?

Open mink007 opened this issue 2 years ago • 7 comments

I was going through the code and read somewhere (in my_machine.h) that it is work in progress. Also generic_map.h, i see that if TRINAMIC_ENABLE is present then error will be generated.

#if TRINAMIC_ENABLE #error "Trinamic plugin not supported!" #endif

I am trying to compile grbl with STM32CubeIDE for STM32F407. Since my board is using TMC2209 so i wanted to know if the code is ready for TMC2209 in UART mode?

I also wanted to know is there a pin configuration file (like generic_map.h) where I can see which pin/port is assigned to which name.

Thank you

mink007 avatar Apr 12 '22 16:04 mink007

I am trying to compile grbl with STM32CubeIDE for STM32F407. Since my board is using TMC2209 so i wanted to know if the code is ready for TMC2209 in UART mode?

It is but not for all boards supported.

I also wanted to know is there a pin configuration file (like generic_map.h) where I can see which pin/port is assigned to which name.

There are many in the Inc folder with names ending in _map.h, which to use is configured in my_machine.h.

terjeio avatar Apr 12 '22 17:04 terjeio

Thank you for your response.

Is TMC2209 UART mode enabled for STM32F407 based boards?

mink007 avatar Apr 13 '22 18:04 mink007

There is support in the driver for both soft and hard UART modes, if the board in question supports TMC2209 drivers either there is support or it may easily be added. Which board do you have?

terjeio avatar Apr 13 '22 20:04 terjeio

I have mks eagle

mink007 avatar Apr 13 '22 23:04 mink007

Ok, then a board map has to be created - you can do it? Easiest is to make a copy of btt_skr_pro_v1_1_map.h and name it my_machine_map.h, then modify that to match the board. Enabling the use of my_machine_map.h is done by uncommenting this line.

When you have a working board map it can then be added with a proper name (after a few additions to my_machine.h and driver.h), either via a PR or by posting the map file in a comment.

terjeio avatar Apr 14 '22 05:04 terjeio

Hi Terjeio, I am specifically looking to integrate TMC2209 into eagle board, that way I can drive the stepper motors. I don't know much about grbl though.

My initial goal is to get the code talk to TMC2209 driver chip though initialization and reading the registers & sending commands to it.

Once I reach that point, i will share the map file here. On a side note, is there some command(s) that I can use in "grbl_enter()" function that initiates TMC2209? Because I see that when I enter in debug mode (in STM32CubeIDE after compiling) the code enters protocol loop and from there I cannot call TMC2209. May be it is intended behavior of grbl code. I am asking just from the standalone testing of TMC2209 driver communication perspective.

Thank you.

mink007 avatar Apr 14 '22 05:04 mink007

Some info here. M122I can be used to reinitialize a/the driver(s), M122 to output driver status. Use the $338 setting to enable Trinamic mode, start by enabling one axis at a time when debugging.

If you want to interact with the drivers via your own code you have to call the driver API from a custom plugin - plugin examples can be found here.

terjeio avatar Apr 14 '22 07:04 terjeio