Skip to content
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

Marlin 2.1.x bugfix issue with pins debugging on a 32 bit board #24846

Closed
1 task done
SamppaD78 opened this issue Oct 8, 2022 · 16 comments
Closed
1 task done

Marlin 2.1.x bugfix issue with pins debugging on a 32 bit board #24846

SamppaD78 opened this issue Oct 8, 2022 · 16 comments

Comments

@SamppaD78
Copy link

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

Hi. I was updating firmware from 2.9.3 to 2.1.x bugfix and came across a issue. When pins debugging is enabled i cant recompile firmware. Issue is a #define num_analog_last line, that is reporting error. Printer control board is a SKR mini E3 V2.0 with STM32F103RC controller. Only work around that i found is disabling pins debugging,after that firmware recompiled without issues.
Is there a better solution for this problem?

Bug Timeline

started after updating to 2..1.x bugfix

Expected behavior

Expected no issues when pins debugging is enabled

Actual behavior

Cant compile 2.1.x bugfix firmware

Steps to Reproduce

  1. enable pins debugging on a marlin 2.1.x bugfix and compile the firmware.

Version of Marlin Firmware

2.1.x bugfix

Printer model

Ender 3 pro

Electronics

SKR mini E3 V2.0

Add-ons

No response

Bed Leveling

ABL Bilinear mesh

Your Slicer

Cura

Host Software

OctoPrint

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

Configuration files.zip

@cbagwell
Copy link
Contributor

cbagwell commented Oct 8, 2022

It looks like buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h needs same update as #24748 . Adding this should get it compiling:

#define NUM_ANALOG_FIRST PA0

@SamppaD78
Copy link
Author

Hi. Where do i add this line, im looking at pins_arduino.h file and line 64?

@cbagwell
Copy link
Contributor

cbagwell commented Oct 8, 2022

Add like this diff:

diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h
index 8f17d052bb..54e4babe60 100644
--- a/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h
+++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h
@@ -88,6 +88,7 @@ extern "C" {
 #define NUM_DIGITAL_PINS        51
 // This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
 #define NUM_ANALOG_INPUTS       16
+#define NUM_ANALOG_FIRST        PA0
 
 // On-board LED pin number
 #ifndef LED_BUILTIN

@SamppaD78
Copy link
Author

Hi.I found the location thanks for help, but by adding #define NUM_ANALOG_FIRST PA0 i get a lot of new errors regarding this added analog PA0 input. So it looks like work around doesn't work with this stm controller. Well at least i can disable debugging and get Marlin to compile.

@cbagwell
Copy link
Contributor

cbagwell commented Oct 8, 2022

Make sure your using latest bugfix-2.1.x that contains pull request #24748 or you will get compile failures. Are you seeing the issue with latest?

@SamppaD78
Copy link
Author

SamppaD78 commented Oct 8, 2022 via email

@SamppaD78
Copy link
Author

Hi. I have tested latest Marlin 2.1.1 and no problems with enabling pins debugging. Marlin compiles without errors.

@thisiskeithb
Copy link
Member

bugfix-2.1.x is "bleeding edge" and should be used for all testing of potential bugs since it serves as the main branch for PRs/bug fixes & is a feeder to the 2.1.x branch.

2.1.x is a rolling branch of updates from bugfix-2.1.x above and usually lags behind it up until a release is tagged.

2.1.1 is a static 2.1.x release/snapshot at a particular point in time and should not be used to test for bugs.

So...

Please download bugfix-2.1.x to test with the latest code and let us know if you're still having this issue.

@SamppaD78
Copy link
Author

SamppaD78 commented Oct 10, 2022 via email

@hcet14
Copy link

hcet14 commented Oct 23, 2022

Hi,
I also have an issue with "NUM_ANALOG_LAST"

  • In file included from Marlin/src/gcode/config/../../pins/pinsDebug.h:171,
    from Marlin/src/gcode/config/M43.cpp:29:
    Marlin/src/gcode/config/../../pins/../HAL/STM32/pinsDebug.h:114: warning: "NUM_ANALOG_LAST" redefined
    114 | #define NUM_ANALOG_LAST ((NUM_ANALOG_FIRST) + (NUM_ANALOG_INPUTS) - 1)
    |
    In file included from /home/hcet/.platformio/packages/framework-arduinoststm32@src-37335c727965154be67d1d5ed653b9c6/cores/arduino/Arduino.h:56,
    from Marlin/src/gcode/config/../../inc/../HAL/./STM32/../shared/Marduino.h:36,
    from Marlin/src/gcode/config/../../inc/../HAL/./STM32/HAL.h:28,
    from Marlin/src/gcode/config/../../inc/../HAL/HAL.h:30,
    from Marlin/src/gcode/config/../../inc/MarlinConfig.h:31,
    from Marlin/src/gcode/config/M43.cpp:23:
    /home/hcet/.platformio/packages/framework-arduinoststm32@src-37335c727965154be67d1d5ed653b9c6/cores/arduino/pins_arduino.h:65: note: this is the location of the previous definition
    65 | #define NUM_ANALOG_LAST (NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS)

Last time I compiled marlin was Marlin-bugfix-2.1.x_220816_13_34, output was firmware.bin 179,5 KiB.

Today I compiled the actual Marlin-bugfix-2.1.x with above warning and a firmware.bin 114,9 KiB which wouldn't boot.

I did it as always. I merged my old config files against the new ones and did my personal comments. Maybe I did a copy and paste error? But I don't think so. I'll try again, when I find time.

I have no clue!

Maybe try '//#define PINS_DEBUGGING'?

Does anyone have an idea?

Mainboard: SKR2
Printer: CTC A13 (Ender3 clone)

Marlin-bugfix-2.1.x_220816_13_34.zip
Marlin-bugfix-2.1.x_221023_15_47.zip

Kind regards, hcet14

@SamppaD78
Copy link
Author

SamppaD78 commented Oct 23, 2022 via email

@hcet14
Copy link

hcet14 commented Oct 23, 2022

Hi. Turn off pins debugging and compile firmware again.

... with //#define PINS_DEBUGGING

No change, except firmware.bin 110,2 KiB, but still not booting.

There is a lot more missing, when you compare firmware.bin file sizes.

I have no clue what's going wrong with Marlin-bugfix-2.1.x from today! Above mentioned possible issues should be included.

No clue or idea at all!

Thanks for the reply, hcet14

@cbagwell
Copy link
Contributor

@hcet14 The original issue described was that you could not compile with PINS_DEBUGGING and commenting it out worked around the issue and booted OK.

If its not working for you when PINS_DEGUGGING is comment out then I think your issues is unrelated. I would look to see if a #define was renamed in newer versions and could be cause of your firmware size dropping.

If you wanted to further confirm its unrelated, you could edit Marlin/HAL/STM32/pinsDebug.h line 114 and change the two lines to match to make the warning go away but I do not think that file can affect behavior beyond M43 command.

Change from:

#define NUM_ANALOG_LAST ((NUM_ANALOG_FIRST) + (NUM_ANALOG_INPUTS) - 1)

To:

#define NUM_ANALOG_LAST (NUM_ANALOG_FIRST + NUM_ANALOG_INPUTS)

@hcet14
Copy link

hcet14 commented Oct 24, 2022

@cbagwell
I agree. Sorry, I'm a little short of time right now. I'll try to get back at the weekend.
Thank you.
Kind regards, hcet14

@github-actions
Copy link

This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.

@github-actions
Copy link

github-actions bot commented Mar 4, 2023

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.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants