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);
}