-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
[2.0.x]STM32F4 L6470 error #12824
Comments
Please attach your platformio.ini and configuration files & I'll see if I can reproduce it. I've been playing with some L6470 drivers the last week. What hardware are you using? |
Im doesnt use platformio becouse im use Arduino_Core_STM32. Im compile in arduino |
What firmware are you using? The first one is ST's modified version of Marlin. The second one is the "official" Marlin. That's the one you'll find on this site. I'm 99.9% sure that the second one doesn't support the STEVAL-3DP001V1. Your ZIP has a pins_STEVAL.h file in it but that file isn't in the official Marlin. I'll take a look in more detail at your ZIP and see what else is different. |
Im using Marlin 2.0 files im wrote by my self. im try make port for this board. but stuck on motor drivers |
Now I understand. I've been doing basically the same thing the last two weeks but for a Due based system. The STEVAL-3DP001V1 schematics show that this board uses SPI daisy chaining. Neither Marlin nor the Arduino L6470 library support this. My software is mostly functional but is an UGLY RAT'S NEST. If you want I can modify it so you can spin steppers with your board. The wife wants me to do some things so it'll be a couple of hours before I can make the mods and post them. |
I canty change motor drivers so if you can help - its will be great! Then i can move to future |
Do you know how SPI daisy chaining works? |
Nope |
There's one slave select that's tied to the chip select on all the drivers. MOSI from the CPU is tied to SDI on the first driver. SDO on the first driver is tied to SDI on the second driver. SDO on the second driver is tied to SDI on the third driver. On the last driver in the chain the SDO is tied to MISO on the CPU. Since you have 6 drivers all SPI transfers will be 6 bytes long. When select is low (active), each device echoes what it saw on it's SDI on the NEXT byte.. The result is each byte is passed along the chain sort of like a bucket line. Data/commands for driver 6 (the one with it's SDO tied to MISO) is the first byte transmitted. The last byte transmitted is for the first device in the chain (the one with its SDI tied to MOSI). When select goes high each driver acts on the byte it last saw. Select stays low from start to finish. The Maxim app notehas a good diagram of the data movement. Just be aware that it's talking about 16 bit devices. The very first data transmitted by each device is the response to the command it received in the previous 6 byte transfer. After that it echoes the SDI input. The CPU always transmits commands. If the CPU has no command for a particular device then the NOOP command (data 0x00) is transmitted in that slot. |
I'm not so good at programming. I'm just learning. Can you help me with porting? My board is on the list, but it appears to be not tested as the developers have no board yet. So I decided to help. But stuck with the engines because there is not enough knowledge. If the fee is working, I will send my code to the developers. |
Shoot - I was hoping that you would clean up my mess. I'm in awe at how the big boys can make C++ sing. My code is like fingernails scraping on a chalkboard. I just got up from a nap. I should be able to post a copy in the hour. It'll take longer to write up what I've done. |
thank you very much |
My software isn't sophisticated enough to handle a 6 device chain of which only 4 are active. The work around is to assign the unused drivers to Y2 and Z2. I think that's better than assigning them to E1 7 E2 (lfewer configuration options to set). Here's your config added to my code. As feared, the STM environment/libraries are causing compile errors. That's been an ongoing headache for the Marlin community. I'll see what I can do after another nap. |
First some real top level items:
|
I've managed to confuse myself trying various platformio options. I've run into an older issue on the same topic (issue #10739 ). There's a comment towards the end that someone got it to compile but by then the person with the board had lost interest. I'll try that & see what happens. FYI - here's an updated pins file. I've added the E1 & E2 socket definitions. |
Sorry - I just realized that you were the initiator of the earlier issue. |
@xC0000005 - your help would be appreciated. |
I've tried compiling the example STM32F4 config with platformio and Arduino 1.9.0 beta with equally disappointing results. Time to wait until someone that knows the STM32 HAL joins the conversation. |
I’ll pull it local and see what I can see tomorrow.
… On Jan 5, 2019, at 10:03 PM, Bob Kuhn ***@***.***> wrote:
I've tried compiling the example STM32F4 config with platformio and Arduino 1.9.0 beta with equally disappointing results.
Time to wait until someone that knows the STM32 HAL joins the conversation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#12824 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/Aeppcfwls_lGWuAO-i91HIsz8FsvkIiAks5vAZHHgaJpZM4Zwrz7>.
|
Your explanation of how this works is perfect. I'll see if I can get it to compile on the ST hal tomorrow, since this is something I'd actually like to do for the lerdge boards now that Marlin is nearly running on them (they don't have individual SPI select pins, either). |
Thanks |
What do they have that is SPI daisy chained? |
@Bob-the-Kuhn dont use platformio. Install latest arduino.ua and Install on it Arduino_Core_STM32 library. Platformio use old broken library |
The latest Arduino 1.9 came with a virus. How Nice. When compiling the example I get: Looks like the tool chain is having problems. |
Here's my updated L6470 library. And here is my image that uses them, They are not tested. I'm hoping to get in new hardware Wednesday ot Thursday so it'll be the weekend before i can have them tested. This code will use an internal soft SPI or your external SPI, depending on how you initialize it. |
Here's what I'm seeing regarding @ffnull's error.
I think this error is sort of teling us the truth. Which should expand in the preprocessor to I renamed the driver class to L6470Driver and was able to successfully compile (though I don't know if it works). |
Nothing - I was thinking of SPI daisy chaining some drivers since the Lerdge-X can't use SPI due to not having a separate chip select. I had no idea daisy chaining existed, but the moment I saw it, I thought "Hmm. I could definitely use that to hook the pins up." |
That's strange. I can compile in PlatformIO for the Due as is. |
I could have sworn I gave him ZIP with that fixed. Please try this one. It's the one I'm doing all the L6470 development & testing with. I've added the pins & board definitions for his card. There's also a newer Arduino-L6470 library in it. You'll get compile errors without it. This code is based on a bugfix 2.snapshot taken about a month ago. |
On Platformio get error. |
i dont know why. but mcu hot. its get 150mA |
Mostly good news. The M43 commands showed all are correct except for SD_DETECT_PIN. That pin should be 25, not 66. That line should read: //#define SD_DETECT_PIN 25 // PA15 SD_CA Hot MCU probably means it is driving at least one pin it shouldn't which implies the pin map isn't correct. Please use the M42 and M43 commands to do some sanity checks. No motor movement - what does M122 and M906 report? Are the SPI chain bypass resistors for E2 and E3 (R16 & R17) installed? I've setup configuration.h and configuration_adv.h assuming they are not installed. Is power being applied to the steppers after issuing a movement command like G0 or G1. Do you have a logic analyzer? Looking at the SPI pins would be fantastic. |
The "Platformio get error" is being caused by using the released/default Arduino_L6470 library instead of the one I provided. |
Any updates on how much of the board is functional? If the only thing that isn't functional are the motors then try reversing the SPI chain positions in Configuration_adv.h. There's been a couple of times where I had made that mistake. Maybe I've done it again. I've been playing with a couple of things:
I can compile the following image using either Arduino or PlatformIO. Please compile & download this image. I think the easiest way to do this is to use the Auto Build menu in PlatformIO. If you use Arduino then you'll probably need to revert to the standard Arduino-L6470 library. This image works (responds to console commands) with a mega2560 and an LPC1768 but on a Due board goes into a WDT loop when a L6470 is enabled. |
FYI - I changed the board name to STEVAL_3DP001V1 in the new image. |
@Bob-the-Kuhn Hello BOB. Once again, many thanks for the help. I have a lot of work at the moment. I can check no earlier than Sunday. Logic analyzer i have |
Be nice to yourself. Eventually your fantasies about something being more important than your 3D printer will pass. 😉 |
I've finally been able to download Marlin to an STM32 based board!. I've verified that code runs on 2560, LPC1768 & STM32F103 but not on DUE. Please give the following a try. |
I now have a STEVAL_3DP001V1 board. Don't tell my wife. This image appears to be fully functional until any L6470 driver is enabled. When I enable a L6470 the J20 USB port dies. This image should allow you to check out everything except the stepper motors. Here's how I've been using the board
|
@Bob-the-Kuhn You are the best! As for me, by buying a board, you made me a New Year's gift. I’m sorry that I don’t answer, because on the nose of the new year and on the 31st day I have a wedding, and the work is sea. |
A wedding - WONDERFULL!!!!! I moved the pin map and Platformio stuff over to my newer L4xx code base. As best I can tell I have SPI communications. The L6474 has different register mapping and bit definitions than currently in my code base. Adding the L6474 as an option should be straight forward but tedious. |
I have movement! |
@Bob-the-Kuhn wow! but i can test only 29 in the evening |
Here's a mostly functional image. You'll need to modify the configuration files to match your system. https://www.dropbox.com/s/44sf8fr21hyydxw/Marlin-Bob-2_L6474_2019-12-20.zip?dl=0 There is something strange going on with the SPI system. I'm sort of hoping that my board has problems. Let me know how it works for you. What I'm seeing is the M906 command is reporting different information than in the configuration_adv.h file. What M906 is reporting is what my logic analyzer is showing was written to and received from the L6474 chips. The only thing I can test directly is the microstep settings. Stepper performance matches what M906 is reporting. I've had some success using the ST-LINK to watch program execution. I can see the correct data being handed off to the ST SPI library but what shows up on my logic analyzer is sometimes different. So far this has happened only to the last two chips in the chain. X, Y, Z & E1 are rock solid. E2 & E3 both have the issue. For example I'll set the microsteps to 4 which should result in a 0x9A being sent to the step register. What actually shows up on the SPI hardware bus is 9A for X, Y, Z & E1 but 9F for E2. 9F results in M906 reporting 128 microsteps. The L6474 can only go to 16 microsteps. 16 microsteps is what is actually happening. Let me know how it works for you. |
I've fixed my soft SPI "problem". Just needed to add some delay because the CPU was faster than what I had played with on other boards. I still have my "9F" problem with the last chip. Please use this image. https://www.dropbox.com/s/48ujcdqrdvyuqb5/Marlin-Bob-2_L6474_2019-12-31.zip?dl=0 |
Here's the latest image. If I remember correctly it's just polishing up M916, M917 & M918. https://www.dropbox.com/s/qatg0x6ldohvhih/Marlin-Bob-2%202020-01-03.zip?dl=0 I've managed (through great skill and perseverance ### 😉 ) to damage my board. I think I have 3 fully functional L6474 chips. |
Minor syntax update to library. https://www.dropbox.com/s/ikj0f46mh78tim3/Arduino-L6470%202020-01-03.zip?dl=0 |
FYI - code is now in PR #16452. |
@Bob-the-Kuhn I just got married) To be more precise, 12/31/2019)) Finally, there was free time. I start testing. Since in a couple of days I'm leaving for my honeymoon. Thank you very much for the work you have done. Happy New Year! |
Congratulations!! Talk to you in a month. |
Maybe im doing something wrong. Using your latest image and latest library. But, cant compile |
Strange - Z2_ENABLE_PIN should have been automatically created by the macros in pins.h Please post your configuration files and, if you've made any changes, your pins_STEVAL_3DP001V1.h file. |
only #define X_DRIVER_TYPE L6474 |
Please post the files. That way there is no doubt I'm accurately reproducing the issue. |
I was able to reproduce the problem. In configuration_adv.h, dual_Z_steppers was enabled but configuration.h didn't have Z2 defined as L6474. Another issue with configuration_adv.h was that the SPI chain didn't match your board. Here's a ZIP with the corrected configuration_adv.h along with the .ELF and .BIN files created when I compiled it. To use it you'll need to install jumpers at R16 & R17 to make the board functional. Here's another ZIP that doesn't require R16 & R17 to be installed. It also has the USB port enabled. |
The latest bugfix-2.0.x now fully supports this board. The WIFI interface isn't functional. I doubt it ever will. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Im write my own board variant for STEVAL-3DP001V1. All compiles fine. But in my board SPI drivers L6470.
When i use it in configuration - doesnt compile with errors.
The text was updated successfully, but these errors were encountered: