Is this an M1 Mac related Argon flash issue?

Hi all,

I’m trying to use Visual Studio Code Particle Workbench on an M1 based Mac running OS 11.6. A simple LED program compiles but fails to flash. It works on the web-based IDE. I saw a post on this forum from a few years ago, but not sure if relevant. I have set the Terminal app to operate in Rosetta mode. No idea if this is specific to using the M1 Mac or something more general. I’m way out of my depth trying to interpret the errors, so help is appreciated.

Here’s the terminal window output when it is trying to flash the Argon:

:::: PUTTING DEVICE INTO DFU MODE

Done.

:::: FLASHING APPLICATION

text data bss dec hex filename
4204 116 1396 5716 1654 /Users/xxx/Documents/IOTclass/TestMac/TestMac/target/2.2.0/photon/TestMac.elf
dfu-suffix (dfu-util) 0.9

Copyright 2011-2012 Stefan Schmidt, 2013-2014 Tormod Volden
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util / Tickets

Suffix successfully added to file
Serial device PARTICLE_SERIAL_DEV : not available
Flashing using dfu:
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util / Tickets

Opening DFU capable USB device…
ID 2b04:d00c
Run-time device DFU version 011a
Claiming USB DFU Interface…
Setting Alternate Setting #0
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash "
Downloading to address = 0x080a0000, size = 4320
_dfu-util: Last page at 0x080a10df is not writeable
make[2]: *** [program-dfu] Error 74
make[1]: *** [modules/photon/user-part] Error 2
make: *** [flash-user] Error 2
The terminal process “/bin/bash ‘-c’, ‘make -f ‘/Users/xxx/.particle/toolchains/buildscripts/1.10.0/Makefile’ flash-user -s’” terminated with exit code: 2.

This is the code:

int led0 = D7;

// setup() runs once, when the device is first turned on.
void setup() {
  // Put initialization like pinMode and begin functions here.
  pinMode(led0, OUTPUT);
}

// loop() runs over and over again, as quickly as it can execute.
void loop() {
  // The core of your code will likely live here.
  // To blink the LED, first we'll turn it on...
  `digitalWrite(led0, HIGH);`

  // We'll leave it on for 1 second...
  delay(3000);

  // Then we'll turn it off...
  digitalWrite(led0, LOW);

  // Wait 1 second...
  delay(3000);
}

In the build output it looks like you are building for the photon, but you mention you are using the Argon. I’d try correcting this first.

You mentioned that you set Terminal to use Rosetta, but did you also set Visual Studio Code to use Rosetta? If not, this may be the issue since Visual Studio Code uses a separate terminal.

Also, is the following a typo when pasting into the forum or do you actually have it in your code?

`digitalWrite(led0, HIGH);`

If so, you should remove the backticks.

Hi, thanks for the suggestions.

Visual Studio Code doesn’t show the checkbox to use Rosetta - I hadn’t checked that before you suggested it. Good idea antyway.

When i get back to the lab in the morning, I’ll look for how to change from Photon to Argon. Didn’t explicitly select the Argon, so that may be it.

And yes, those extra ’ marks were put in by me when using the imbed code widget. Thanks for pointing that out.

1 Like

Ok, properly selecting the Argon (not the default Photon) as the target has it now compiling without errors. Thanks!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.