Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is TMC2209 enabled? #68

Open
mink007 opened this issue Apr 12, 2022 · 7 comments
Open

Is TMC2209 enabled? #68

mink007 opened this issue Apr 12, 2022 · 7 comments

Comments

@mink007
Copy link

mink007 commented Apr 12, 2022

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

@terjeio
Copy link
Contributor

terjeio commented Apr 12, 2022

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.

@mink007
Copy link
Author

mink007 commented Apr 13, 2022

Thank you for your response.

Is TMC2209 UART mode enabled for STM32F407 based boards?

@terjeio
Copy link
Contributor

terjeio commented Apr 13, 2022

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?

@mink007
Copy link
Author

mink007 commented Apr 13, 2022

I have mks eagle

@terjeio
Copy link
Contributor

terjeio commented Apr 14, 2022

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.

@mink007
Copy link
Author

mink007 commented Apr 14, 2022

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.

@terjeio
Copy link
Contributor

terjeio commented Apr 14, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants