0

I'm using a Arduino nano and am trying to upload a .hex file to the Arduino using the ArduinoUploader Package through a .net C# interface. And I run into the error:

Unable to aqcuire sync in SendWithSyncRetry for request of type ArduinoUploader.BootloaderProgrammers.Protocols.STK500v1.Messages.ReadSignatureRequest!

Code:

static SerialPort _serialPort = null!;

static void ResetArduino(string portName)
{
    _serialPort = new SerialPort(portName, 1200);
    using (_serialPort)
    {
        _serialPort.Open();
        _serialPort.Close();
    }
    System.Threading.Thread.Sleep(5000);
}

static void Main(string[] args)
{
    try
    {
        ResetArduino("COM8");
        var uploader = new ArduinoSketchUploader(
            new ArduinoSketchUploaderOptions()
            {
                FileName = @"PATH_TO_HEX",
                PortName = "COM8",
                ArduinoModel = ArduinoModel.NanoR3
            });

        uploader.UploadSketch();
    }
    catch (ArduinoUploaderException ex)
    {
        Console.WriteLine($"Error: {ex.Message}");
    }
}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.