I’m glad to see that you got it working. But you still have a problem with your installation and it will likely cause troubles in the future.
The problem is that you have two drivers for the same device, one from Apple and one from SiLabs. (I guess your board has a CP2102 USB-to-serial converter chip.) They create two devices under /dev/cu...
, one working and one raising the resource busy error. PlatformIO happened to pick the wrong one.
The resolution is to uninstall the SiLabs driver. First find the location of the driver:
sudo ls -l /System/Library/Extensions/SiLabsUSBDriver.kext
sudo ls -l /Library/Extensions/SiLabsUSBDriver.kext
Then disable and remove it:
sudo kextunload /Library/Extensions/SiLabsUSBDriver.kext
sudo rm -rf /Library/Extensions/SiLabsUSBDriver.kext
This should solve the issue once and for all. And the upload_port
line shouldn’t be needed anymore as PlatformIO will automatically detect the correct device.