dresco / STM32H7xx

grblHAL driver for STM32H7xx processors
Other
11 stars 12 forks source link

SKR3 EZ - USB port not working. #1

Closed Demitrius closed 1 year ago

Demitrius commented 1 year ago

Hello Jon!

I build today latest version. Board flashed thru SD card with new firmware.

Windows not found device (board) when I connect board USB to PC.

PS: I setup TMC 2209 (X axis) and TMC 5160 EZ Pro (Y axis). Marlin 2 can drive both motors.

dresco commented 1 year ago

Hi, I suspect it's related to using the Marlin bootloader. If you are happy to flash over USB (which will overwrite the Marlin SD card bootloader), then I would try that first?

Entering the USB bootloader mode should just be question of holding down the boot button while you press & release reset, and then release the boot button. You should see the DFU device appear instead of USB serial.. Must admit I don't know whether that needs a driver on Windows.

btw, I'm not sure whether having different TMC drivers on different axis is supported in grblHAL? I know I've never tested it, probably a question for Terje..

Demitrius commented 1 year ago

I attach board over USB in DFU mode and connect thru STM Cube Programmer. My next steps? image

Demitrius commented 1 year ago

I read 128K of current bootloader and save to file, now I need upload other bootloader?

Or can flash firmware.bin file direclty?

dresco commented 1 year ago

You can flash the grblHAL firmware file directly, as the DFU bootloader is hard coded into these chips.

The STM2CubeProgrammer can program the elf file directly. Once built - it will be in your STM32CubeIDE project workspace, either Debug BTT SKR 3/grblHAL Driver STM32H7xx.elf or Release BTT SKR 3/grblHAL Driver STM32H7xx.elf

The 2nd green icon on the left is "Erasing and Programming", click on that, browse to the firmware file, & start programming..

image

Demitrius commented 1 year ago

Hi

Flashed and now USB works. I do not found Debug version of .elf, only release firmware.elf file avail.

I connect TMC2209 driver and on stepper motor (X slot). Trying to use Universal Gcode Platform to connect to GRBL and move single motor (X) but have ALARM message.

Something not enought?

image

dresco commented 1 year ago

That's progress :)

I would maybe connect from a terminal client like PuTTY to check the cause of the alarm. The real time report command ? should help there. Quite often is just something simple like the expected normally closed inputs not being wired up..

This page is useful for the commands to interact with the TMC drivers (M122 etc). If it is driver problems, then can be useful to change the axis mask ($338) to enable just the single X axis for testing.

Demitrius commented 1 year ago

Putty show message - can't communicate with drivers. I connect 3 tmc2209 and problem solved.

Another case - no messages on console, but errors on several commands.

image

$I - show information G90 - return Error 9 // Status_SystemGClock, "G-code commands are locked out during alarm or jog state." $X - return Error 18 // Status_Reset, "Reset asserted"

Have you idea what is wrong?

dresco commented 1 year ago

Have you idea what is wrong?

Yep, error 18 is because it thinks e-stop is pressed.. Have a look at the first run settings page. You'll need to invert the logic for the missing inputs - as they are expected to be normally closed. Try $14=7 for starters

Demitrius commented 1 year ago

Yes, this works. I can drive motors (X100, Y100 commands)

Jon, question. Wifi module attached, can I use it? Also, how to use SD card?

dresco commented 1 year ago

Yes, this works. I can drive motors (X100, Y100 commands)

Good news!

Not sure what the support is for ESP WiFi over serial port, it was discussed here for the F4. Would be a question for Terje I think, but if it's supposed to work then I can certainly make sure that serial port is accessible..

SDcard usage is covered here. Without networking, you can mount it, and run g-code from it. With networking, it gets much more interesting with WebUI / WebDAV etc..

Demitrius commented 1 year ago

Yes, I want inspect this part of project. Networking (over WiFi) will very useful.

Jon, does it enough enable PPI_ENABLE to use RGBL in laser mode?

dresco commented 1 year ago

Jon, does it enough enable PPI_ENABLE to use RGBL in laser mode?

Is not something I've looked at yet. Please let me know how you get on..

Demitrius commented 1 year ago

Please let me know how you get on.

What do you mean?

dresco commented 1 year ago

What do you mean?

I was assuming you wanted to test the laser plugin by defining PPI_ENABLE and rebuilding?

Fwiw - I've never built that plugin, and don't know whether it's even been tested in the upstream F7 driver (that the H7 driver is based on) - so you are quite probably on the bleeding edge! ;)

Edit: you can put grblHAL into laser mode without the PPI plugin, I have done that for speed testing before $32=1

Demitrius commented 1 year ago

Read networking and WiFi discussion. As I understand, WebUI have dependency with grbl and network. Need to split logic before use in different configurations.

SD card works and I think its enough for me now

Demitrius commented 1 year ago

Jon, will we test TMC5160 drivers?

dresco commented 1 year ago

Jon, will we test TMC5160 drivers?

Yes sure. I don't have the EZ modules to test with my SKR 3, but I've used a 5160 breakout with my dev board, so I think it should work fine - as long as all the drivers are the same type - I don't think you can mix & match axis..

If you open Properties from the Project menu, then select either the Debug or Release build for the SKR3. Then following this screenshot, you'll want to change the TRINAMIC_ENABLE value to 5160 and rebuild/flash.

image

Demitrius commented 1 year ago

Works!

image

Demitrius commented 1 year ago

Jon, how about speed ? I see some videos with same motors/steppers and it looks a more faster.

dresco commented 1 year ago

Jon, how about speed ? I see some videos with same motors/steppers and it looks a more faster.

Probably just default (conservative) max speed and acceleration settings? You can list all the settings with $$

On a bare board for testing, you can crank them up no problem, this is what I normally set mine to for bench tests. (Obviously when you're building a machine, then you need to work up and see what's achievable / reliable).

$110=3500   X-axis max rate (mm/min)
$111=3500   Y-axis max rate (mm/min)
$112=3500   Z-axis max rate (mm/min)

$120=300.0  X-axis accel (mm/sec^2)
$121=300.0  Y-axis accel (mm/sec^2)
$122=300.0  Z-axis accel (mm/sec^2)
Demitrius commented 1 year ago

You are right! Set 3500 and looks better.

Demitrius commented 1 year ago

Now I need solve laser question and can start build laser cutter

Main question about commands, as I see, some peoples use commands like M3, M4 to set laser static/dynamic mode. How about other like laser power? (thru PWM?)

Simplify, connect 24V (2A), GND to laser - nothnig power if PWM=0 Right?

And how about GCode? I see S* used for control PWM

dresco commented 1 year ago

Now I need solve laser question and can start build laser cutter

I think these are questions for the other thread, are you okay to close this issue now the board is up & running?

Demitrius commented 1 year ago

Yes Jon, you did a great job! Thank you for your attention and help with GRLB, SKR3EZ and drivers.

Avalonnw commented 1 year ago

Sorry for jumping in to the old closed thread. I'm moving from grbl-mega and struggling. Nothing I do seem to move any motors for some reason. They don't even feel energized. I'm using SKR 3 EZ with 5160EZ drivers, powering all from 24v supply. I've inverted limit switches and all safety signals, ioSender allows me to jog, but no movement happens. I'm not that stupid usually, I promise...

dresco commented 1 year ago

Off the top of my head, I would check you're compiling with TRINAMIC_ENABLE set to 5160, and that you have the $338 axis mask set correctly..

Might be further useful info on this page. Does the M122 debug output from the drivers look sane?

Avalonnw commented 1 year ago

M122 [MSG:Warning: Could not communicate with stepper driver!]

Maybe that's why...

On Sat, 21 Jan 2023 at 23:36, Jon Escombe @.***> wrote:

Off the top of my head, I would check you're compiling with TRINAMIC_ENABLE set to 5160, and that you have the $338 axis mask set correctly..

Might be further useful info on this https://github.com/grblHAL/Plugins_motor page. Does the M122 debug output from the drivers look sane?

— Reply to this email directly, view it on GitHub https://github.com/dresco/STM32H7xx/issues/1#issuecomment-1399248362, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXKDUJLXGGSLBZUREUR63LWTPNLVANCNFSM6AAAAAAQF4IOV4 . You are receiving this because you commented.Message ID: @.***>

-- Best Regards, Anton Khrapov

Avalonnw commented 1 year ago

Victory! Had to re-pull the code and re-configure it. Web builder does not activate the comms with TMC drivers. Also could not configure in CUBE, so had to run it in Platformio.

dresco commented 1 year ago

Victory! Had to re-pull the code and re-configure it. Web builder does not activate the comms with TMC drivers. Also could not configure in CUBE, so had to run it in Platformio.

Thanks for the update, I'll check the Web Builder configuration.

STMCubeIDE should work though, what happens there? Worth noting that I set TRINAMIC_ENABLE=2209 inside the project properties for the SKR board, so would need to be changed to 5160 there.. image

Avalonnw commented 1 year ago

Changed to 5160 in cube and there was no difference for some reason.

On Sun, 22 Jan 2023, 20:18 Jon Escombe, @.***> wrote:

Victory! Had to re-pull the code and re-configure it. Web builder does not activate the comms with TMC drivers. Also could not configure in CUBE, so had to run it in Platformio.

Thanks for the update, I'll check the Web Builder configuration.

STMCubeIDE should work though, what happens there? Worth noting that I set TRINAMIC_ENABLE=2209 inside the project properties for the SKR board, so would need to be changed to 5160 there.. [image: image] https://user-images.githubusercontent.com/996823/213909497-1d92a012-2a6e-4a5b-8a73-0d3268bf4df9.png

— Reply to this email directly, view it on GitHub https://github.com/dresco/STM32H7xx/issues/1#issuecomment-1399441966, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXKDUMMNBCRYZMIZBRLT5DWTT65XANCNFSM6AAAAAAQF4IOV4 . You are receiving this because you commented.Message ID: @.***>