MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.03k stars 19.13k forks source link

Need dev's / mod's approval for use of logo... #8254

Closed Spawn32 closed 6 years ago

Spawn32 commented 6 years ago

Will delete this "Issue" as soon as i get a answer, or would it be ok to have it open ?, will need help with HAL etc..

Board going to PCB Fab on Monday, is the use of the Marlin logo ok ?

The board is OSH and will be published on github as soon as i am finished and have cleaned up the files.

Board will be black but haven't decided on white or yellow logo / text yet.

front back
Roxy-3D commented 6 years ago

I would feel more comfortable if the board was tested and working well before the Marlin logo was put on it.

But with that said... That does look like a nice board. I like the Aux Stepper Motor connector. A person can do Dual Z motors or a 3rd extruder.

Tannoo commented 6 years ago

No provision for dual Z motors without using the Aux?

Tannoo commented 6 years ago

I would feel more comfortable if the board was tested and working well before the Marlin logo was put on it.

I agree.

Roxy-3D commented 6 years ago

No provision for dual Z motors without using the Aux?

Would it make sense to put a second connector on the Z motor? If a person has multiple Z motors and wants to drive them from the same chip, that would make it easier.

Spawn32 commented 6 years ago

Yes, i thought about that, but had to decide not to do it this time, the PCB footprint around a TMC2660 is pretty big, and i actually have run out of space for a thing like that on only 4 layers :/ Only way of doing that would be to make the pcb a bit bigger or more layers, will consider that on a new revision :)

You could use a simple splitter, but i always prefer running a a second Z motor from it own stepper driver, the TMC2660 will probably be running pretty hot with 2, and we do have 6 stepper drivers :)

Regarding the logo, i will just order a few pcb this time and they will only end up with people helping me getting a HAL working, probably one of you guy's or girl's ;)

I am just a private person, not a company, i started this just because i am so tired of all wires going to all extra boards (and i have fun doing it) , wanted something with everything included and the MCU power that will be very fast for several years to come.

When i get this working and if people wants the board i could produce them, but the price of the quality steppers and the STM32F765ZGT6 (1MB x8 flash, 512x8 kb ram, 216mhz, 462 DMIPS/2.14 DMIPS/MHz and a FPU) makes this a high cost board. (can almost run linux on this puppy).

http://www.st.com/en/microcontrollers/stm32f765bg.html

It's only a short time before someone else brings out a STM32F7 board so a HAL would be very nice 😄 I have ST's HAL for it, have no idea how much work it would be to adapt it to Marlin ?

High end version of the STM32F4 (144pin) is now about the same price as the STMF7, so there is no reason to keep using the the F4 over the F7...

Tannoo commented 6 years ago

Is the RGB power 5V or 12V? Selectable?

Spawn32 commented 6 years ago

@Tannoo yes, it has a dedicated buck DC-DC board for the RGB that can be adjusted from 5-28V (3amp's) 😄

Spawn32 commented 6 years ago

Sendt the gerber files to the PCB fab 5 hours ago, got a messaged now that it passed the tests and was in production, efficient people those Chinese, 72hour service 😄

RowanMeara commented 6 years ago

I have been following your posts about the board and I think it looks awesome! I can't wait to see how it works. Does this board support 3pin endstops and both max and min endstops?

Spawn32 commented 6 years ago

20171123_232407

On the test bench 😄

stigjoergensen commented 6 years ago

looks awsome...

aby idea about what the pricetag on one of these will be, if... ;)

2017-11-25 18:18 GMT+01:00 Morten notifications@github.com:

[image: 20171123_232407] https://user-images.githubusercontent.com/5589175/33232814-09a6f7b2-d20d-11e7-9d05-1fde9f3701c2.jpg

On the test bench 😄

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/8254#issuecomment-346953695, or mute the thread https://github.com/notifications/unsubscribe-auth/AWHXK5j5M4XVHk08te_K-StPincdQqLjks5s6EwAgaJpZM4QSHyt .

Spawn32 commented 6 years ago

Need som debug help.. Most stuff is now working, usb, temp sensors, fans, hotends, bed. cs to TMC2660 is ok and spi to TMC2660 seems to be working (looks like it on the scope) set the spi clk to 3.2mhz, 4mhz is max for TMC2660..

I can lock/ unlock stepper motor (enable / disable) but i can not make it move, i have come to a point where i cant do anything more if i cant get the debug stuff in TMC26XStepperSTM32.cpp to print to the host usb or some other serial, have tried every trick in the book, can t get i to pint the debug info in Marlin. HAL_STM32F7.zip

The STM32F7 is about 100% faster than a F4, so might also be a speed problem in Marlin ? Some NOP's needed ? 😄

At one point i managed to compile it directing debug to the main usb host port, but it crashed the usb port at startup :/

Also tested with @tcm0116 multihost branch to use the second serial for debug, but it seems that it cant be compiled with arduino yet ?

So would love if someone can fix it so i can get some debug info, have included the stm32f7 hal, this hal is mostly work done by Chris Barr (for the F4) but i adapted it to the F7...

Please someone, need help :) @Roxy-3D with friends :) @teemuatlut

Ohh.. i also would love a pinsdebug for it if someone feels the urge 👀

Roxy-3D commented 6 years ago

How are you locking and unlocking the stepper motors? You are not doing that with PronterFace, right?

At one point i managed to compile it directing it to the main usb host port, but it crashed the usb port at startup :/

This is the path I would explore. Because if this can be made to work... Then a host program can be used to talk to the board. The USB port work for Serial on the F4 boards ? If so... It probably isn't that much to get it to work on the F7 boards. (But of course, that is just uninformed opinion!)

Spawn32 commented 6 years ago

Not pronterface but simplify3d (disable motors / enable motors) :) The hal uses the STM32Generic library so serial should work even if i haven't really tested it, will make a small prog and test..

@tcm0116 can you confirm that the multihost can't be compiled yet with arduino ? typical that i didn't save the compile errors, but if you now it should work i can have another go at it ?

Spawn32 commented 6 years ago

stigjoergensen, thanks for those nice words ;) Have no ider yet, this first one is hand build, you typical have max 3 hours to place the components before you get in trouble whit the solder past, i used 3.5 hours, 402 parts, 0.7mm :)

I started this for fun and because wanted one, but it looks nice and i have all bit's and pieces for a pick and place machine on the way to me :)

It probably going to be a enthusiast board in the higher ends of duet and smoothie board regarding price.. expensive components :/ but to early to say exact.

Roxy-3D commented 6 years ago

Not pronto but simplify3d :) The hal uses STM32Generic library so serial should work even if i haven't really tested it, will make a smal prog and test..

OK! If you can talk to the board at all.... We can kludge up some debug stuff for you. And seriously... I use MAX7219 8x8 LED matrix's to debug things. That support is merged in with basic sample examples that show you the depth of the Read and Write command queues.

https://www.ebay.com/itm/MAX7219-Dot-Matrix-8x8-Led-Display-Module-MCU-Control-For-Arduino-TB-PL/222719373894?epid=9009430186&hash=item33db1bf246:g:rQEAAOSwOtdYTge9

You should order a couple of those because you can tell it to output what ever you want on the matrix.

stigjoergensen commented 6 years ago

A pick'n'place machine?

Converting a 3d printer to do that?... i had that thought... and might do at some point...

Yeaa - i got it would be on the high side... but would rather support an individual than some knockoff or commercial business... it means more development... and most likely a direct access to developer if i might have ideas for improvement/expansion

2017-11-25 19:09 GMT+01:00 Morten notifications@github.com:

stigjoergensen, thanks for those nice words ;) Have no ider yet, this first one is hand build, you typical hav max 3 hours to place the components before you get in trouble whit the solder past, i used 3.5 hours, 402 parts, 0.7mm :)

I started this for fun and because wanted one, but it looks nice and i have all bit's and pieces for a pick and place machine on the way to me :)

It probably going to be a enthusiast board in the higher ends of duet and smoothie board regarding price.. expensive components :/ but to early to say exact.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/8254#issuecomment-346956499, or mute the thread https://github.com/notifications/unsubscribe-auth/AWHXK3pCCO_uQn-Q5M1GoPsvEjPG9-tCks5s6FfFgaJpZM4QSHyt .

Spawn32 commented 6 years ago

Nice, order'd 2 now from UK, faster shipping to me :)

Yes, Marlin is working and communicating like it should over USB, so if i could only stick another serial port output in there i would be fine, on the AUX port you can see in the picture i have UART5 available, but Marlin is being noty and want allow me to use it :)

Spawn32 commented 6 years ago

A 3d printer would work, but the problem is space, you need room for it to pick components so i am building a cross between this 2 projects :) http://openpnp.org/hardware/ https://www.liteplacer.com/

Nice, small and cheap toolhead :) https://www.aliexpress.com/item/SMT-DIY-mountor-connector-Nema8-hollow-shaft-stepper-for-pick-place-head/32807025833.html?spm=a2g0s.9042311.0.0.Zg7Vdz

Will look like the LitePlacer but with the 2 toolheads from the other project, that way i want need to change tools and the heads take up less space...

And it will run Marlin not Smoothie ;)

Will be using my MKS Sbase for that and the The Borg for my 3d printer 😄

Roxy-3D commented 6 years ago

This is a super cool project!

Can this solder the parts have it picks them up and places them?

Spawn32 commented 6 years ago

yes it's cool, it cant solder the parts, but does all the hard work:

  1. Order a solder past stencil when you order your pcb, about 16usd extra
  2. apply soler paste using the stencil to the pcb.
  3. use a pick an place file generated by your pcb cad, load it in openpnp (running marlin or smoothie on controller)
  4. watch your machine do the dirty work.
  5. cook it in an ir oven an you are done :) , a cheap T-962 with this modified firmware is a great oven.

https://github.com/UnifiedEngineering/T-962-improvements/wiki

found a video of one very similar to the one i am building, same toolheads..

https://www.youtube.com/watch?v=p_AxNq4XtE0

Spawn32 commented 6 years ago

btw, when i try to stepp in simplify3d, marlin starts / locks the motor an goes in to a READ: echo:busy: processing busy: processing loop.. Would love to pick it's brain and see what it's doing 😄

teemuatlut commented 6 years ago

I'm getting my TMC2660 drivers on Monday from Panucatt so I can start doing testing them on the AVR platform at first. The drivers or the upcoming library only need a functional SPI library.

The reason you can't drive the motors is likely because you haven't configured the off time (TOFF) value.

Spawn32 commented 6 years ago

TOFF ? will look in to that, thanks :) really looking forward to a driver from you @teemuatlut , thanks 👍

tcm0116 commented 6 years ago

can you confirm that the multihost can't be compiled yet with arduino ?

@Spawn32 With the default configuration, it compiles just fine on my MacBook. I'll need to know more info on your configuration in order to look into your issue.

teemuatlut commented 6 years ago

Look at the TMC2660 datasheet on page 21. Chopconf register bits 0..3. A setting of 0b0000 means "Driver disable, all bridges off". This is basically the only setting that is mandatory to run the TMC steppers outside of standalone mode.

The library will not be a priority for me as I have quite a lot of other things I need to do but I'll try to get something basic so that they at least spin a stepper.

Spawn32 commented 6 years ago

Ok, i was sure it had turned the bridges on since it locks / holds the stepper motor.

I volunteer to be a guinea pig when you find time to write it 😄

The TMC2660 is a great driver, super quiet (compared to a DRV8825) , up to 256 steps and can do 4amp steppers with a good pcb design and cooling fins.. :) only down part is the price...

Spawn32 commented 6 years ago

@tcm0116 i will clean up my files an transfer my latest changes from the branch i am using over to multihost and do another test compile later to night, will send you the compile errors when done :)

teemuatlut commented 6 years ago

It's actually a good sign that they lock up. We will see if there's more that they need when I get to working with the chip.

Spawn32 commented 6 years ago

the TOFF looks to be ok, starts off / init's at 0 but is changed when you issue a move, think i need the debug info to figure this one out...

teemuatlut commented 6 years ago

The TOFF value is changed only when you change it specifically. It won't automatically change when you start a stepping pulse.

Spawn32 commented 6 years ago

it's set to 0 in init, changed in the start rutine and changed again in the un-start :) actually a lot of code to get this thing running, probably want start if it get's the resistor part wrong so it can't calculate the current draw.. :)

resistor value is set to 50mohms in configuration_adv.h, but who knows, it might not even get that right...

Spawn32 commented 6 years ago

@tcm0116 Before i test again, the physical serialport i need on my board is UART5, i would then use:

define SERIAL_PORT_2 5 ? (0 is usb)

and what exactly would i use insted of: Serial.println("TMC26X stepper library"); and Serial.print("CS pin: ");

and do i need to include something extra in the cpp and h file ?

Spawn32 commented 6 years ago

@tcm0116 The Marlin-bugfix-2.0.x branch i use for testing was downloaded on the 15-Nov and compiles fine.

In multihost i set:

define SERIAL_PORT 0

define SERIAL_PORT_2 5

and i applied the same patches to you multihost branch as i did to Marlin-bugfix-2.0.x branch and end up with this errors, haven't enabled debug in the TMC26x.cpp yet, included my pins config :

`in file included from c:\users\familien\appdata\local\temp\arduino_build_859897\sketch\src\module\planner.h:35:0,

             from c:\users\familien\appdata\local\temp\arduino_build_859897\sketch\src\module\stepper.h:53,

             from C:\Users\Familien\AppData\Local\Temp\arduino_build_859897\sketch\src\gcode\host\M114.cpp:27:

c:\users\familien\appdata\local\temp\arduino_build_859897\sketch\src\marlin.h:219:29: error: 'pin_t' does not name a type

bool pin_is_protected(const pin_t pin);

                         ^~~~~

In file included from C:\Users\Familien\AppData\Local\Temp\arduino_build_859897\sketch\src\gcode\host\M114.cpp:27:0:

c:\users\familien\appdata\local\temp\arduino_build_859897\sketch\src\module\stepper.h:115:12: error: 'hal_timer_t' does not name a type

 static hal_timer_t acc_step_rate; // needed for deceleration start point

        ^~~~~~~~~~~

c:\users\familien\appdata\local\temp\arduino_build_859897\sketch\src\module\stepper.h:117:12: error: 'hal_timer_t' does not name a type

 static hal_timer_t OCR1A_nominal;

        ^~~~~~~~~~~

In file included from C:\Users\Familien\AppData\Local\Temp\arduino_build_859897\sketch\src\gcode\host\M114.cpp:27:0:

c:\users\familien\appdata\local\temp\arduino_build_859897\sketch\src\module\stepper.h:280:25: error: 'hal_timer_t' does not name a type

 static FORCE_INLINE hal_timer_t calc_timer(hal_timer_t step_rate) {

                     ^~~~~~~~~~~

c:\users\familien\appdata\local\temp\arduino_build_859897\sketch\src\module\stepper.h: In static member function 'static void Stepper::trapezoid_generator_reset()':

c:\users\familien\appdata\local\temp\arduino_build_859897\sketch\src\module\stepper.h:361:7: error: 'OCR1A_nominal' was not declared in this scope

   OCR1A_nominal = calc_timer(current_block->nominal_rate);

   ^~~~~~~~~~~~~

c:\users\familien\appdata\local\temp\arduino_build_859897\sketch\src\module\stepper.h:361:61: error: 'calc_timer' was not declared in this scope

   OCR1A_nominal = calc_timer(current_block->nominal_rate);

                                                         ^

c:\users\familien\appdata\local\temp\arduino_build_859897\sketch\src\module\stepper.h:364:7: error: 'acc_step_rate' was not declared in this scope

   acc_step_rate = current_block->initial_rate;`

pins_THE_BORG.zip

tcm0116 commented 6 years ago

@Spawn32 there have probably been updates to the HAL you're using since I last re-based my multi host branch. I'd suggest checking out my multi host branch and then merging in the latest bugfix-2.0.x branch.

Spawn32 commented 6 years ago

the hal i am using from the stm32F4 witch i adapted to F7 have not been updated for a long time, but i think it even compiles in the very lates Marlin-bugfix-2.0.x branch, will test that now.

You multihost branch i tested here is the latest you have on you github.. might there be som pin scheme difference in you multihost that is not merged with the current Marlin-bugfix-2.0.x branch that messes this up ? if you look in my borg pin def, it's not exactly marlin standard, lol

tcm0116 commented 6 years ago

@Spawn32 I just re-based by branch to the latest bugfix-2.0.x, so you'll need to pull it back down. If you want to get the multi-host working with your HAL, you'll need to duplicate the code from the LPC1768 HAL.h file that defines MYSERIAL0 and MYSERIAL1 in your HAL. If you have both set and NUM_SERIAL defined as 2, then, the multi-host code should work.

Spawn32 commented 6 years ago

Nice, thanks :) Almost finished patching the latest bugfix-2.0.x, will test compile that first and do the same to you new multihost after, we should get multihost merged, that function is really needed in so many ways :)

Spawn32 commented 6 years ago

arg.. SET_BIT messes up compiling my hal again, i used to have to do this to make it compile. in macros.h:

define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (_BV(b))

//#define SEB(n,b,value) (n) ^= ((-value)^(n)) & (_BV(b))

now that dosen work anymore, i know something was merged concerning SET_BIT a few days back that probably did this, but don't know how to fix it :/

Cant find the merge, do i remember correctly that it was you that did something @Roxy-3D ? 😸

All my endstop inverts are set "true" so marlin sees them as open so i can move steppers :)

the compiler error looks the same before and after my fix now:

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:441:48: error: macro "SET_BIT" passed 3 arguments, but takes just 2

           if (X_MIN_TEST) UPDATE_ENDSTOP(X, MIN);

                                                ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:456:48: error: macro "SET_BIT" passed 3 arguments, but takes just 2

           if (X_MIN_TEST) UPDATE_ENDSTOP(X, MAX);

                                                ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:475:32: error: macro "SET_BIT" passed 3 arguments, but takes just 2

           UPDATE_ENDSTOP(Y, MIN);

                                ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:490:32: error: macro "SET_BIT" passed 3 arguments, but takes just 2

           UPDATE_ENDSTOP(Y, MAX);

                                ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:511:34: error: macro "SET_BIT" passed 3 arguments, but takes just 2

             UPDATE_ENDSTOP(Z, MIN);

                                  ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:519:38: error: macro "SET_BIT" passed 3 arguments, but takes just 2

           UPDATE_ENDSTOP(Z, MIN_PROBE);

                                      ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:538:32: error: macro "SET_BIT" passed 3 arguments, but takes just 2

           UPDATE_ENDSTOP(Z, MAX);

                                ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp: In static member function 'static void Endstops::update()':

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:321:44: error: 'SET_BIT' was not declared in this scope

   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))

                                            ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:326:7: note: in expansion of macro 'UPDATE_ENDSTOP_BIT'

       UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \

       ^~~~~~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:441:27: note: in expansion of macro 'UPDATE_ENDSTOP'

           if (X_MIN_TEST) UPDATE_ENDSTOP(X, MIN);

                           ^~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:321:44: error: 'SET_BIT' was not declared in this scope

   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))

                                            ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:326:7: note: in expansion of macro 'UPDATE_ENDSTOP_BIT'

       UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \

       ^~~~~~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:456:27: note: in expansion of macro 'UPDATE_ENDSTOP'

           if (X_MIN_TEST) UPDATE_ENDSTOP(X, MAX);

                           ^~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:321:44: error: 'SET_BIT' was not declared in this scope

   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))

                                            ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:326:7: note: in expansion of macro 'UPDATE_ENDSTOP_BIT'

       UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \

       ^~~~~~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:475:11: note: in expansion of macro 'UPDATE_ENDSTOP'

           UPDATE_ENDSTOP(Y, MIN);

           ^~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:321:44: error: 'SET_BIT' was not declared in this scope

   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))

                                            ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:326:7: note: in expansion of macro 'UPDATE_ENDSTOP_BIT'

       UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \

       ^~~~~~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:490:11: note: in expansion of macro 'UPDATE_ENDSTOP'

           UPDATE_ENDSTOP(Y, MAX);

           ^~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:321:44: error: 'SET_BIT' was not declared in this scope

   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))

                                            ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:326:7: note: in expansion of macro 'UPDATE_ENDSTOP_BIT'

       UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \

       ^~~~~~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:511:13: note: in expansion of macro 'UPDATE_ENDSTOP'

             UPDATE_ENDSTOP(Z, MIN);

             ^~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:321:44: error: 'SET_BIT' was not declared in this scope

   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))

                                            ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:326:7: note: in expansion of macro 'UPDATE_ENDSTOP_BIT'

       UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \

       ^~~~~~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:519:11: note: in expansion of macro 'UPDATE_ENDSTOP'

           UPDATE_ENDSTOP(Z, MIN_PROBE);

           ^~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:321:44: error: 'SET_BIT' was not declared in this scope

   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))

                                            ^

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:326:7: note: in expansion of macro 'UPDATE_ENDSTOP_BIT'

       UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \

       ^~~~~~~~~~~~~~~~~~

C:\Users\Familien\AppData\Local\Temp\arduino_build_411229\sketch\src\module\endstops.cpp:538:11: note: in expansion of macro 'UPDATE_ENDSTOP'

           UPDATE_ENDSTOP(Z, MAX);

           ^~~~~~~~~~~~~~

Marlin.zip

Roxy-3D commented 6 years ago

Cant find the merge, do i remember correctly that it was you that did something @Roxy-3D ?

Yes... And if we need to make changes to eliminate a name conflict... Probably the names in bitmap_flags.cpp should change. The bit map functions were pulled out of UBL to make them available to anything that wanted to pull in G26.

If you just want to change the names in G26, G29 and bitmap_flags.cpp, that will resolve the conflict. I can do that tomorrow if you want. But if you do it now... I'll merge it as soon as I see it show up.

8513 was one of the Pull Requests with the G26 and G29 support untangled.

FORCE_INLINE void bit_clear(uint16_t bits[16], const uint8_t x, const uint8_t y) { CBI(bits[y], x); }
FORCE_INLINE void bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { SBI(bits[y], x); }
FORCE_INLINE bool is_bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); }

#endif // _BITMAP_FLAGS_H_

Changing to:

FORCE_INLINE void bitmap_clear(uint16_t bits[16], const uint8_t x, const uint8_t y) { CBI(bits[y], x); }
FORCE_INLINE void bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { SBI(bits[y], x); }
FORCE_INLINE bool is_bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); }

#endif // _BITMAP_FLAGS_H_

would be fine....

Spawn32 commented 6 years ago

Probably best if you do it so i dont break something else, lol

If you could just mention the merge number here afterwards i can do the same in my fresh F7 adapted bugfix-2.0.x and multihost branches :)

Roxy-3D commented 6 years ago

Probably best if you do it so i dont break something else, lol

I'm waiting for Travis right now...

https://github.com/MarlinFirmware/Marlin/pull/8565

When Travis says OK... I'll merge.

Spawn32 commented 6 years ago

@Roxy-3D Applied your merge to my files and it didn't change anything, still the same error's. tested both in macros.h: //#define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (_BV(b))

define SEB(n,b,value) (n) ^= ((-value)^(n)) & (_BV(b))

changed SET_BIT to SEB in Marlin/src/module/endstops.cpp again and it compiles normally...

Is it the STM32GENERIC library i use in arduino that wants SEB and not SET_BIT ? and is there a way fix this so i dont need to modify it every time ? :)

The STM32GENERIC covers all STM32 cpu's so this will probably come up again..

Roxy-3D commented 6 years ago

aaargh... Yet another definition of SET_BIT() except this one is all capital letters. Can you cut and paste your current error messages without your patch?

Spawn32 commented 6 years ago

LOL :)

Removed it from macros and endstops, probably would be more errors if i enabled bedleveling etc. but i want to keep it as minimal as possible until the board is fully working :) If you ad SEB you will have the STM32GENERIC library cover'd.

Errors: `In file included from C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\cores\arduino/stm32_HAL/stm32XXxx_ll_spi.h:19:0,

             from C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\libraries\SPI\src/SPI.h:7,

             from C:\Users\Familien\Desktop\Marlin-bugfix-2.0.x\Marlin\Marlin.ino:52:

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:379:33: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->CR1, SPI_CR1_SPE);

                             ^

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:719:35: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->CR1, SPI_CR1_CRCEN);

                               ^

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:783:37: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->CR1, SPI_CR1_CRCNEXT);

                                 ^

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:883:34: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->CR2, SPI_CR2_NSSP);

                              ^

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:1108:35: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->CR2, SPI_CR2_ERRIE);

                               ^

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:1119:36: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->CR2, SPI_CR2_RXNEIE);

                                ^

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:1130:35: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->CR2, SPI_CR2_TXEIE);

                               ^

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:1216:37: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->CR2, SPI_CR2_RXDMAEN);

                                 ^

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:1249:37: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->CR2, SPI_CR2_TXDMAEN);

                                 ^

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:1648:63: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->I2SCFGR, SPI_I2SCFGR_I2SMOD | SPI_I2SCFGR_I2SE);

                                                           ^

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:1717:39: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->I2SCFGR, ClockPolarity);

                                   ^

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:1857:39: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->I2SPR, SPI_I2SPR_MCKOE);

                                   ^

C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\system/STM32F7/HAL_Inc/stm32f7xx_ll_spi.h:1891:45: error: macro "SET_BIT" requires 3 arguments, but only 2 given

SET_BIT(SPIx->I2SCFGR, SPI_I2SCFGR_ASTRTEN);

                                         ^

Using library SPI at version 1.0 in folder: C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\libraries\SPI Using library stm32_dma at version 1.0 in folder: C:\Program Files (x86)\arduino190B\hardware\STM32GEN\STM32\libraries\stm32_dma exit status 1 Error compiling for board The Borg.`

Spawn32 commented 6 years ago

@tcm0116 Finally got the second port working :)

define SERIAL_PORT 0

define SERIAL_PORT_2 5

and in my hal:

`#if !WITHIN(SERIAL_PORT, 0, 6)

error "SERIAL_PORT must be from 0 to 6"

endif

if SERIAL_PORT == 0

define MYSERIAL0 SerialUSB // was SerialUSB // usb_serial

elif SERIAL_PORT == 1

define MYSERIAL0 SerialUART1

elif SERIAL_PORT == 2

define MYSERIAL0 SerialUART2

elif SERIAL_PORT == 3

define MYSERIAL0 SerialUART3

elif SERIAL_PORT == 4

define MYSERIAL0 SerialUART4

elif SERIAL_PORT == 5

define MYSERIAL0 SerialUART5

elif SERIAL_PORT == 6

define MYSERIAL0 SerialUART6

endif

ifdef SERIAL_PORT_2

if !WITHIN(SERIAL_PORT_2, 0, 6)

#error "SERIAL_PORT_2 must be from 0 to 6"

elif SERIAL_PORT_2 == SERIAL_PORT

#error "SERIAL_PORT_2 must be different than SERIAL_PORT"

endif

define NUM_SERIAL 2

if SERIAL_PORT_2 == 0

#define MYSERIAL1 SerialUSB

elif SERIAL_PORT_2 == 1

#define MYSERIAL1 SerialUART1

elif SERIAL_PORT_2 == 2

#define MYSERIAL1 SerialUART2

elif SERIAL_PORT_2 == 3

#define MYSERIAL1 SerialUART3

elif SERIAL_PORT_2 == 4

#define MYSERIAL1 SerialUART4

elif SERIAL_PORT_2 == 5

#define MYSERIAL1 SerialUART5

elif SERIAL_PORT_2 == 6

#define MYSERIAL1 SerialUART6

endif

else

define NUM_SERIAL 1

endif`

was struggling for a long time, got nothing on the port, the i realized that all the uart's can be on 4 different places on this cpu, so had to pull a dirty one in the STM32GENERIC:

`const stm32_af_pin_list_type chip_af_usart_rx [] = { //UART4 { UART4 , GPIOA, GPIO_PIN_1 , GPIO_AF8_UART4 }, { UART4 , GPIOA, GPIO_PIN_11 , GPIO_AF6_UART4 }, { UART4 , GPIOC, GPIO_PIN_11 , GPIO_AF8_UART4 }, { UART4 , GPIOD, GPIO_PIN_0 , GPIO_AF8_UART4 }, //UART5 //{ UART5 , GPIOB, GPIO_PIN_5 , GPIO_AF1_UART5 }, //{ UART5 , GPIOB, GPIO_PIN_8 , GPIO_AF7_UART5 }, //{ UART5 , GPIOB, GPIO_PIN_12 , GPIO_AF8_UART5 }, { UART5 , GPIOD, GPIO_PIN_2 , GPIO_AF8_UART5 }, //UART7 { UART7 , GPIOA, GPIO_PIN_8 , GPIO_AF12_UART7}, { UART7 , GPIOB, GPIO_PIN_3 , GPIO_AF12_UART7}, { UART7 , GPIOE, GPIO_PIN_7 , GPIO_AF8_UART7 }, { UART7 , GPIOF, GPIO_PIN_6 , GPIO_AF8_UART7 }, //UART8 { UART8 , GPIOE, GPIO_PIN_0 , GPIO_AF8_UART8 }, //USART1 { USART1, GPIOA, GPIO_PIN_10 , GPIO_AF7_USART1}, { USART1, GPIOB, GPIO_PIN_7 , GPIO_AF7_USART1}, { USART1, GPIOB, GPIO_PIN_15 , GPIO_AF4_USART1}, //USART2 { USART2, GPIOA, GPIO_PIN_3 , GPIO_AF7_USART2}, { USART2, GPIOD, GPIO_PIN_6 , GPIO_AF7_USART2}, //USART3 { USART3, GPIOB, GPIO_PIN_11 , GPIO_AF7_USART3}, { USART3, GPIOC, GPIO_PIN_11 , GPIO_AF7_USART3}, { USART3, GPIOD, GPIO_PIN_9 , GPIO_AF7_USART3}, //USART6 { USART6, GPIOC, GPIO_PIN_7 , GPIO_AF8_USART6}, { USART6, GPIOG, GPIO_PIN_9 , GPIO_AF8_USART6}, };

const stm32_af_pin_list_type chip_af_usart_tx [] = { //UART4 { UART4 , GPIOA, GPIO_PIN_0 , GPIO_AF8_UART4 }, { UART4 , GPIOA, GPIO_PIN_12 , GPIO_AF6_UART4 }, { UART4 , GPIOC, GPIO_PIN_10 , GPIO_AF8_UART4 }, { UART4 , GPIOD, GPIO_PIN_1 , GPIO_AF8_UART4 }, //UART5 //{ UART5 , GPIOB, GPIO_PIN_6 , GPIO_AF1_UART5 }, //{ UART5 , GPIOB, GPIO_PIN_9 , GPIO_AF7_UART5 }, //{ UART5 , GPIOB, GPIO_PIN_13 , GPIO_AF8_UART5 }, { UART5 , GPIOC, GPIO_PIN_12 , GPIO_AF8_UART5 }, //UART7 { UART7 , GPIOA, GPIO_PIN_15 , GPIO_AF12_UART7}, { UART7 , GPIOB, GPIO_PIN_4 , GPIO_AF12_UART7}, { UART7 , GPIOE, GPIO_PIN_8 , GPIO_AF8_UART7 }, { UART7 , GPIOF, GPIO_PIN_7 , GPIO_AF8_UART7 }, //UART8 { UART8 , GPIOE, GPIO_PIN_1 , GPIO_AF8_UART8 }, //USART1 { USART1, GPIOA, GPIO_PIN_9 , GPIO_AF7_USART1}, { USART1, GPIOB, GPIO_PIN_6 , GPIO_AF7_USART1}, { USART1, GPIOB, GPIO_PIN_14 , GPIO_AF4_USART1}, //USART2 { USART2, GPIOA, GPIO_PIN_2 , GPIO_AF7_USART2}, { USART2, GPIOD, GPIO_PIN_5 , GPIO_AF7_USART2}, //USART3 { USART3, GPIOB, GPIO_PIN_10 , GPIO_AF7_USART3}, { USART3, GPIOC, GPIO_PIN_10 , GPIO_AF7_USART3}, { USART3, GPIOD, GPIO_PIN_8 , GPIO_AF7_USART3}, //USART6 { USART6, GPIOC, GPIO_PIN_6 , GPIO_AF8_USART6}, { USART6, GPIOG, GPIO_PIN_14 , GPIO_AF8_USART6}, }; `

Have no ider where or how to tell it to use the correct one, any chance you could have a look ? the fix i did is not a good solution :)

here is the link to the original STM32GENERIC if you could have a quick look:

https://github.com/danieleff/STM32GENERIC

Roxy-3D commented 6 years ago

removed it from macros and endstops, probaly would be more errors if i enabled bedleveling etc. but i want to keep it as minimal as possible until the board is fully working :)

Yeah... I don't really like the Marlin definition of SET_BIT(). It is overly complex. For sure, other libraries are going to use identifiers like set_bit(). Our SET_BIT is only used in one place and that is within the definition of yet another macro.

My vote would be we get rid of the macro definition.

Spawn32 commented 6 years ago

@tcm0116 So back to the debug output from TMC26XStepperSTM32.cpp. If i enable debug and change the serial print to: #ifdef DEBUG MYSERIAL1.println("TMC26X stepper library"); MYSERIAL1.print("CS pin: "); MYSERIAL1.println(cs_pin); MYSERIAL1.print("DIR pin: "); MYSERIAL1.println(dir_pin); MYSERIAL1.print("STEP pin: "); MYSERIAL1.println(step_pin); MYSERIAL1.print("current scaling: "); MYSERIAL1.println(current_scaling,DEC);

it compiles without error's but during restet / boot i get no usb port anymore and no response if i try to send anything to UART5, is there something more i need to do or include in TMC26XStepperSTM32.cpp ?

Feeling puzzled 😄

tcm0116 commented 6 years ago

@Spawn32 I'm not really familiar with that HAL. What file did you make those modifications to?

You might consider making the USB Serial port be -1 to match the other HALs.

Instead of using MYSERIAL1 directly, use the wrapper macros in serial.h, such as SERIAL_PRINTF.

Spawn32 commented 6 years ago

For the STM32F765ZG it uses STM32GEN\STM32\system\STM32F7\stm32_chip\stm32_USART_variant_8.h

Yes will change it to -1 when things are working and i do the clean up of the files :)