Closed ffnull closed 5 years ago
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?
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 Im attach my board variant for Arduino_Core_STM32 and project itself steval.zip ST3DP_EVAL.zip
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?
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 notifications@github.com 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 https://github.com/MarlinFirmware/Marlin/issues/12824#issuecomment-451718038, 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: panic: interface conversion: error is exec.Error, not exec.ExitError
Looks like the tool chain is having problems.
Here's my updated L6470 library. L6470.zip
And here is my image that uses them, Marlin.zip
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.
In file included from /var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_388469/sketch/src/inc/MarlinConfigPre.h:37:0,
from /var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_388469/sketch/src/inc/MarlinConfig.h:28,
from /var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_388469/sketch/src/Marlin.h:24,
from /var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_388469/sketch/src/Marlin.cpp:31:
/var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_388469/sketch/src/inc/../core/drivers.h:30:29: error: expected identifier before numeric constant
#define L6470 0x105
^
/var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_388469/sketch/src/module/L6470.h:241:7: note: in expansion of macro 'L6470'
class L6470 {
^~~~~
I think this error is sort of teling us the truth. In drivers.h, we have the line:
In l6740.h we have: class L6470 {
Which should expand in the preprocessor to class 0x105 {
I renamed the driver class to L6470Driver and was able to successfully compile (though I don't know if it works).
What do they have that is SPI daisy chained?
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.
Sorry for delay. Still cant compile. Im stuck(( Here paste https://pastebin.com/D24J4RCE
I'm at the same point as you. False linker errors. I've tried moving things around but nothing helped.
Here's my latest L6470 software modified for your system.
Since you physically have a 6 device chain, my software demands that 6 steppers be defined. I added Y2 & Z2 to your configuration. That shouldn't affect anything.
'You'll also need to replace your L6470 library files with these.
Already found a problem. I defined the chain wrong. Chain positions start at 1, not 0.
Time to call it a night
I’m trying to compile this and hitting errors like: var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_121505/sketch/src/HAL/shared/HAL_spi_L6470.cpp: In function 'void L6470_SPI_init()': /var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_121505/sketch/src/HAL/shared/HAL_spi_L6470.cpp:142:13: error: 'L6470_BUSY_PIN' was not declared in this scope pinMode(L6470_BUSY_PIN, INPUT);
On Jan 9, 2019, at 10:54 PM, Bob Kuhn notifications@github.com wrote:
Already found a problem. I defined the chain wrong. Chain positions start at 1, not 0.
Time to call it a night
Configuration_adv.zip https://github.com/MarlinFirmware/Marlin/files/2743983/Configuration_adv.zip — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/12824#issuecomment-452990063, or mute the thread https://github.com/notifications/unsubscribe-auth/AeppcVlsvEG_r5Wu-2hVU0EHJSjJYTlBks5vBuOxgaJpZM4Zwrz7.
And yet another file I screwed up. HAL_spi_L6470.zip
Was it just the path, or are there other changes I need?
On Jan 9, 2019, at 11:08 PM, Bob Kuhn notifications@github.com wrote:
And yet another file I screwed up. HAL_spi_L6470.zip https://github.com/MarlinFirmware/Marlin/files/2744025/HAL_spi_L6470.zip — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/12824#issuecomment-452992689, or mute the thread https://github.com/notifications/unsubscribe-auth/Aeppcc8vG6gNSFmzP9NW711jfXTcrljlks5vBubpgaJpZM4Zwrz7.
Here's the file with that pin made optional.
I'm sure there are bugs in the software but I think these changes should eliminate the compile errors.
Progress. I’m up to:
var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_977927/sketch/src/gcode/feature/L6470/M916-918.cpp: In static member function 'static void GcodeSuite::M916()':
/var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_977927/sketch/src/gcode/feature/L6470/M916-918.cpp:112:11: error: 'class GcodeSuite' has no member named 'process_subcommands_now_P'; did you mean 'process_next_command'?
gcode.process_subcommands_now_P(gcode_string);
^~~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_977927/sketch/src/gcode/feature/L6470/M916-918.cpp:115:11: error: 'class GcodeSuite' has no member named 'process_subcommands_now_P'; did you mean 'process_next_command'?
gcode.process_subcommands_now_P(gcode_string);
^~~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_977927/sketch/src/gcode/feature/L6470/M916-918.cpp: In static member function 'static void GcodeSuite::M917()':
/var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_977927/sketch/src/gcode/feature/L6470/M916-918.cpp:249:11: error: 'class GcodeSuite' has no member named 'process_subcommands_now_P'; did you mean 'process_next_command'?
gcode.process_subcommands_now_P(gcode_string);
^~~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_977927/sketch/src/gcode/feature/L6470/M916-918.cpp:252:11: error: 'class GcodeSuite' has no member named 'process_subcommands_now_P'; did you mean 'process_next_command'?
gcode.process_subcommands_now_P(gcode_string);
^~~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_977927/sketch/src/gcode/feature/L6470/M916-918.cpp: In static member function 'static void GcodeSuite::M918()':
/var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_977927/sketch/src/gcode/feature/L6470/M916-918.cpp:540:11: error: 'class GcodeSuite' has no member named 'process_subcommands_now_P'; did you mean 'process_next_command'?
gcode.process_subcommands_now_P(gcode_string);
^~~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_977927/sketch/src/gcode/feature/L6470/M916-918.cpp:543:11: error: 'class GcodeSuite' has no member named 'process_subcommands_now_P'; did you mean 'process_next_command'?
gcode.process_subcommands_now_P(gcode_string);
^~~~~~~~~~~~~~~~~~~~~~~~~
So I’m probably missing one changed file.
> On Jan 9, 2019, at 11:18 PM, Bob Kuhn <notifications@github.com> wrote:
>
> Here's the file with that pin made optional.
>
> HAL_spi_L6470 (2).zip <https://github.com/MarlinFirmware/Marlin/files/2744059/HAL_spi_L6470.2.zip>
> I'm sure there are bugs in the software but I think these changes should eliminate the compile errors.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub <https://github.com/MarlinFirmware/Marlin/issues/12824#issuecomment-452994730>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AeppcZd93LugQaXgP5tnUP8GmrqLMPifks5vBulUgaJpZM4Zwrz7>.
>
Ok, after commenting out the missing method calls, I was able to link a binary. I do not know that it works, but it definitely compiles. However: My environment, I’ve updated the ST core package to work from my git repo for it. There may be fixes in that that are not in the PIO version. If you download the ST core repo and replace the entire contents of the pIO package, see if it still fails to link.
On Jan 5, 2019, at 9:18 PM, Bob Kuhn notifications@github.com wrote:
@xC0000005 https://github.com/xC0000005 - your help would be appreciated.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/12824#issuecomment-451716271, or mute the thread https://github.com/notifications/unsubscribe-auth/AeppcZPHdND0iy18_5WouZIIKVIZNGOXks5vAYcZgaJpZM4Zwrz7.
You're talking about replacing something in my platformio directory?
I can't find any directory structures similar to what I just downloaded.
Found it in Arduino
Different errors. Now it's complaining about syntax errors that I don't see a problem with.
In file included from C:\Users\bobku\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.4.0\cores\arduino\stm32\PinConfigured.c:30:0:
C:\Users\bobku\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.4.0\cores\arduino\stm32\PinConfigured.c:32:45: error: expected ')' before '*' token
bool is_pin_configured(PinName pin, uint32_t* map) {
^
C:\Users\bobku\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.4.0\cores\arduino\stm32\PinConfigured.h:45:31: note: in definition of macro 'PINCONF_VAL'
#define PINCONF_VAL(X, Y) ((Y >> PINCONF_SHIFT(X)) & PINCONF_MASK)
^
C:\Users\bobku\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.4.0\cores\arduino\stm32\PinConfigured.c:32:6: note: in expansion of macro 'is_pin_configured'
bool is_pin_configured(PinName pin, uint32_t* map) {
^~~~~~~~~~~~~~~~~
How are you building? I’ll see if I can set up another build machine to mimic what you’re seeing.
On Jan 10, 2019, at 12:36 AM, Bob Kuhn notifications@github.com wrote:
Different errors. Now it's complaining about syntax errors that I don't see a problem with.
In file included from C:\Users\bobku\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.4.0\cores\arduino\stm32\PinConfigured.c:30:0:
C:\Users\bobku\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.4.0\cores\arduino\stm32\PinConfigured.c:32:45: error: expected ')' before '*' token
bool is_pin_configured(PinName pin, uint32_t* map) {
^
C:\Users\bobku\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.4.0\cores\arduino\stm32\PinConfigured.h:45:31: note: in definition of macro 'PINCONF_VAL'
define PINCONF_VAL(X, Y) ((Y >> PINCONF_SHIFT(X)) & PINCONF_MASK)
^
C:\Users\bobku\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.4.0\cores\arduino\stm32\PinConfigured.c:32:6: note: in expansion of macro 'is_pin_configured'
bool is_pin_configured(PinName pin, uint32_t* map) {
^~~~~~~~~~~~~~~~~
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/12824#issuecomment-453012752, or mute the thread https://github.com/notifications/unsubscribe-auth/AeppcbT7t1TNl3tdORiaq_Zk_AleilJkks5vBvuLgaJpZM4Zwrz7.
I get the same results with 1.9 beta (from 7 JAN) and 1.8.9 (hourly build 3 JAN). Board: Generic STM32F4 series Board Part number: Black F407VE Optimize: Smallest OS Runtime C: Newlib Nano STduino library - copied over last night's image from github L6470 library - manually installed the last one attached to this thread
Ok. Are you building from PlatformIO or Arduino IDE? And when you say STduino, do you mean this one: https://github.com/stm32duino/Arduino_Core_STM32?
On Jan 10, 2019, at 1:27 PM, Bob Kuhn notifications@github.com wrote:
I get the same results with 1.9 beta (from 7 JAN) and 1.8.9 (hourly build 3 JAN). Board: Generic STM32F4 series Board Part number: Black F407VE Optimize: Smallest OS Runtime C: Newlib Nano STduino library - copied over last night's image from github L6470 library - manually installed the last one attached to this thread
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/12824#issuecomment-453260292, or mute the thread https://github.com/notifications/unsubscribe-auth/AeppcdVcEGnhXuRaGMSKmuSPOgfYvKtbks5vB7BagaJpZM4Zwrz7.
A4rduino IDE
All right. Let me see what I can do here. For board, I have selected the ST3DP Eval, and @ffnull’s variant is in my variants folder.
On Jan 10, 2019, at 1:31 PM, Bob Kuhn notifications@github.com wrote:
A4rduino IDE
Yes - https://github.com/stm32duino/Arduino_Core_STM32 https://github.com/stm32duino/Arduino_Core_STM32 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/12824#issuecomment-453261508, or mute the thread https://github.com/notifications/unsubscribe-auth/AeppcTzXlrLrLqZ5ba8IaYg0QMUjiX0bks5vB7FFgaJpZM4Zwrz7.
I also made the following mods but they didn't seem to make a difference variant - add pins PC14 & PC15 ?? - uncommented flag GENERIC_STM32F401xx? don't remember the details
I'll add his variant.
How did you get ST3DP Eval, as an option? Did it popup after adding the variant?
The easiest way to get it (and it’s sort of a hack) is to copy MY ST core in on top of your existing one (I know, I’m destroying everything). https://github.com/xC0000005/Arduino_Core_STM32/tree/ST_3DPEVALVariant https://github.com/xC0000005/Arduino_Core_STM32/tree/ST_3DPEVALVariant
This updates boards.txt, which is how the arduino IDE finds boards. Eventually, I’ll do a PR back to add in the Lerdge boards that are actually in this poorly named branch. Once you do that, copy @ffnul’s variant in on top of the ST3DP_EVAL variant files (I have no idea what he changed from mine, but if that’s what he’s trying to compile with, I’m fine with it). Once you restart the Arduino IDE, you’ll see a bunch of new boards - A couple of Malyan ones, a couple of Lerdge ones, and ST’s eval board. Choose it.
On Jan 10, 2019, at 1:35 PM, Bob Kuhn notifications@github.com wrote:
I also made the following mods but they didn't seem to make a difference variant - add pins PC14 & PC15 ?? - uncommented flag GENERIC_STM32F401xx? don't remember the details
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/12824#issuecomment-453262812, or mute the thread https://github.com/notifications/unsubscribe-auth/AeppcT7rrDNl9huMYk2Nl2s4xGaFBKt4ks5vB7I6gaJpZM4Zwrz7.
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.