Marlin compilation error on sensitive_pins
December 21, 2015 06:45AM
Greetings!

I'm getting the following error when compilling Marlin

Quote

Arduino: 1.6.5 (Mac OS X), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Marlin_main.cpp:269: error: 'SENSITIVE_PINS' was not declared in this scope
const int sensitive_pins[] = SENSITIVE_PINS; ///< Sensitive pin list for M42
^
'SENSITIVE_PINS' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

I'm configuring a Leapfrog Creatr to use a Megatronics so I just copied and pasted a lot of the settings from the old board's Marlin firmware over to the Megatronics.

Any help appreciated.
Re: Marlin compilation error on sensitive_pins
December 21, 2015 07:08AM
Btw, on the Creatr firmware there's the following line in the pins.h file:

Quote

//List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN,
#if EXTRUDERS > 1
#define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN,
#else
#define _E1_PINS
#endif
#if EXTRUDERS > 2
#define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, HEATER_2_PIN,
#else
#define _E2_PINS
#endif

#ifdef DISABLE_MAX_ENDSTOPS
#define X_MAX_PIN -1
#define Y_MAX_PIN -1
#define Z_MAX_PIN -1
#endif

#define SENSITIVE_PINS {0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, LED_PIN, PS_ON_PIN, \
HEATER_BED_PIN, FAN_PIN, \
_E0_PINS _E1_PINS _E2_PINS \
TEMP_0_PIN, TEMP_1_PIN, TEMP_2_PIN, TEMP_BED_PIN }

This isn't present on the Megatronics so I tried copying it but I got another compilation error.
Re: Marlin compilation error on sensitive_pins
December 21, 2015 08:28AM
Almost always when you get a "was not declared in this scope" error the problem is being caused by mismatched #ifdef #else and #endif preprocessor directives.

The #else is harder to check. But when you are done editing the file, the number of #ifdef and #endif directives should always be equal (in Marlin).
Re: Marlin compilation error on sensitive_pins
December 22, 2015 03:22AM
Sometimes it's just a missing " ; " or // to make the error disappear.
-Olaf
Re: Marlin compilation error on sensitive_pins
December 22, 2015 10:16PM
I'm still getting errors, namely in terms of variables that it's complaining that aren't declared in the scope. I'm not that familiar with Python so I'm sure I'm just missing something basic here and not setting some fundamental configuration steps.

If anyone has the patience I've put together a small zip file with the Megatronics generic firmware I've been trying to configure and the original Creatr controller board's Marlin firmware. It can be downloaded here.

Any help would be appreciated.
Re: Marlin compilation error on sensitive_pins
December 23, 2015 09:47AM
Quote
Outbound
I'm still getting errors, namely in terms of variables that it's complaining that aren't declared in the scope. I'm not that familiar with Python so I'm sure I'm just missing something basic here and not setting some fundamental configuration steps.

If anyone has the patience I've put together a small zip file with the Megatronics generic firmware I've been trying to configure and the original Creatr controller board's Marlin firmware. It can be downloaded here.

Any help would be appreciated.

The Marlin team is setup to use forks... I'm hardly one to preach. But if you fork the code base, make your changes, and then do a pull request, it is very easy for people setup to use GitHub to look at it.

Give that a try. If you can't make that work, I'll pull in your .ZIP file and see if I can find the problem.

Edited 1 time(s). Last edit at 12/23/2015 10:13AM by Roxy.
Re: Marlin compilation error on sensitive_pins
December 23, 2015 11:21AM
Thanks, I'll try that. I've been looking for a reason to learn how to work with Github and I guess I've found a good one.

smiling smiley
Re: Marlin compilation error on sensitive_pins
December 23, 2015 11:49AM
Quote
Outbound
Thanks, I'll try that. I've been looking for a reason to learn how to work with Github and I guess I've found a good one.

smiling smiley

And actually.... Probably what is going to happen is you don't need to do a Pull Request. The reason is GitHub is going to show you the changes to the files. And you are going to see a mis-matched #ifdef / #endif pair most likely.
Re: Marlin compilation error on sensitive_pins
December 23, 2015 07:40PM
So I'm taking a look at the Github for Marlin but it seems like the only thing I can do is suggest a new file.

I'm not sure how to upload all the changes I've made to my configuration so someone can look at it.

Any hints?
Re: Marlin compilation error on sensitive_pins
December 23, 2015 08:19PM
Quote
Outbound
So I'm taking a look at the Github for Marlin but it seems like the only thing I can do is suggest a new file.

I'm not sure how to upload all the changes I've made to my configuration so someone can look at it.

Any hints?

I'm not a GitHub expert. But what you do is fork the appropriate repository. You tell it to put it on your local machine. You make what ever changes you need to make. Get it as close as you can. And then you do a Commit for those changes and then you issue a Pull Request. At that point, anybody can check out and work with the changes you have made.
Re: Marlin compilation error on sensitive_pins
December 23, 2015 08:21PM
OK,

So I didn't quite understand what you meant. I did create a public repository with the changes I'm making:

[github.com]

I'm not sure I'm uploading everything correctly though.

However, I'm also not sure that what I want is necessarily to compare all the files because I've done some tweaking in the pins files so that the y-axis stepper pins are switched with the z-axis stepper pins because on the Creatr the y-axis is the one that uses two stepper motors.
Re: Marlin compilation error on sensitive_pins
December 23, 2015 08:26PM
Quote

I'm not a GitHub expert. But what you do is fork the appropriate repository. You tell it to put it on your local machine. You make what ever changes you need to make. Get it as close as you can. And then you do a Commit for those changes and then you issue a Pull Request. At that point, anybody can check out and work with the changes you have made.

Yeah I just copied the files I had on my edited version into the Marlin repository I had on my desktop and tried to issue a pull request but it said I didn't have the permissions for that...

Edited 1 time(s). Last edit at 12/23/2015 08:27PM by Outbound.
Re: Marlin compilation error on sensitive_pins
December 23, 2015 09:41PM
Alright, so I was able to get it to compile.

What was happening was that it was crapping out on defining the pins for the micro-stepping mode, which apparently the Megatronics v3 does not have anything defined for it in its pins file, only two boards seem to have it and it's present in the "pins_generic.h" file.

All I did in the "stepper.cpp" file was comment out any of the field regarding setting the micro-stepping. Now I'm not sure how smart this is, but I'm holding off uploading it to the board until I get some feedback over here. I'll only be able to test it out on the machine on 4 January anyway.
Re: Marlin compilation error on sensitive_pins
December 23, 2015 10:54PM
Alright, I got a bit excited and uploaded it to the board.

It seems to work out alright for now and I get the error message that was expected when it detects no signal from the thermistors and shuts down.

Now I have to wait to have access to the machine again, which will only happen in a couple of weeks... sad smiley

Meanwhile I was able to upload everything to Github.

I'll update on any new developments.

Merry X-mas and a Happy New year to all!
Re: Marlin compilation error on sensitive_pins
December 25, 2015 10:50AM
Micro Stepping just gives you better resolution. Very typically, if you are going to be running in micro-step mode there are jumpers you have to set on your controller board. You should make sure that how ever you have the board configured matches the software mode you are using.
Sorry, only registered users may post in this forum.

Click here to login