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

Sketch didn't work on Apple M1 Pro Sonoma v14.1.2 #125

Open
YanisDeplazes opened this issue Mar 1, 2024 · 1 comment
Open

Sketch didn't work on Apple M1 Pro Sonoma v14.1.2 #125

YanisDeplazes opened this issue Mar 1, 2024 · 1 comment

Comments

@YanisDeplazes
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Example sketch code:
    `/*
    Simple demo with DRV8255 driver on CNC shield

    Connect STEP, DIR as indicated!
    Driverslots X, Y, Z on the CNC shield can be used

    In this demo driver chip is in slot X (pin 5, 2)

    Adapted 2021/2022 by Gordan Savicic
    based on Copyright (C)2015-2017 Laurentiu Badea

    This file may be redistributed under the terms of the MIT license.
    A copy of this license has been included with this distribution in the file LICENSE.

*/
#include <Arduino.h>
#include "BasicStepperDriver.h"

// Motor steps per revolution. Most steppers are 200 steps or 1.8 degrees/step
#define MOTOR_STEPS 200
#define RPM 120

// Since microstepping is set externally, make sure this matches the selected mode
// Set the jumper to middle position when using MICROSTEPS 4, no jumper = MICROSTEPS 1
// 1=full step, 2=half step etc.
#define MICROSTEPS 1

// Driver in CNC shield X
#define DIR_X 5
#define STEP_X 2

// Driver in CNC shield Y
#define DIR_Y 6
#define STEP_Y 3

// Driver in CNC shield Z
#define DIR_Z 7
#define STEP_Z 4

// Define the pin for enable/disable functionality
#define SLEEP 8

// Initialize the driver(s)
BasicStepperDriver stepper(MOTOR_STEPS, DIR_Y, STEP_Y, SLEEP);
BasicStepperDriver stepper2(MOTOR_STEPS, DIR_X, STEP_X, SLEEP);

void setup() {
// Pass some config to the instances and begin
stepper.begin(RPM, MICROSTEPS);

// if using enable/disable on ENABLE pin (active LOW) instead of SLEEP uncomment next line
stepper.setEnableActiveState(LOW);

stepper2.begin(RPM, MICROSTEPS);

// if using enable/disable on ENABLE pin (active LOW) instead of SLEEP uncomment next line
stepper2.setEnableActiveState(LOW);
}

void loop() {
// energize coils
stepper.enable();
stepper2.enable();

// Moving motor one full revolution using the degree notation
stepper.rotate(360);
stepper2.rotate(360);

// pause and allow the motor to be moved by hand
stepper.disable();
stepper2.disable();

delay(2000); // repeat after 2sec. pause
}`

  1. Compiled the code (Worked) (On Mac)

  2. Uploaded the code (Worked) (On Mac)

  3. Motors didn't rotate as expected.

  4. When running and compiling over a windows it did work as expected.

Expected behavior
I expected the library to work on a Apple Macbook.

Platform Setup (please complete the following information):

  • Apple M1 Pro Macbook with Sonoma v14.1.2
  • Arduino IDE version 2.3.2
  • Board type (Uno)
  • Stepper driver type (A4988) 1.4.1
  • Wiring (if needed) - please note that hardware issues are outside of the scope of this project
@YanisDeplazes YanisDeplazes changed the title Didn't work on Apple M1 Pro Sonoma v14.1.2 Sketch didn't work on Apple M1 Pro Sonoma v14.1.2 Mar 1, 2024
@laurb9
Copy link
Owner

laurb9 commented Mar 2, 2024

This is likely an Arduino support issue on M1 Sonoma Macs. The library code is cross-compiled to the target arch by Arduino or PlatformIO so it has no dependency on the host machine itself.
Perhaps the Arduino configuration or version on the two platforms tried differ in some way that causes this. I suggest trying out another simple sketch like Blink to make sure that works to eliminate that possibility.
I've found that Bing ChatGPT can be an useful assistant in troubleshooting the issue, if that does not yield results you may try opening an issue in the Arduino forums.

Please do post back if you find a resolution to this issue.

@laurb9 laurb9 removed the bug label Mar 2, 2024
@laurb9 laurb9 removed their assignment Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants