DeqingSun / Prototyping-Electronic-Devices

An ITP Class
https://itp.nyu.edu/classes/prototypingelectronicdevices/
15 stars 7 forks source link

debug issue in Mac OS #1

Open DeqingSun opened 3 years ago

DeqingSun commented 3 years ago

Tested in macOS Catalina 10.15.7 and macOS Mojave 10.14.6

1. Burn bootloader in Arduino IDE to confirm your board is working properly.

If you can burn bootloader, it means your CH552 board, Arduino chip, and ISP connections in between are working. This is critical for the following steps.

2. Unplug the board and replug the CH552 board

Power cycle your target board can solve some weird connection issue, if you just burned the bootloader.

3. Download the class repo again.

On Nov 11, 2020, the tool has been updated to a new static linked version. No brew install of libusb is needed.

4. Start to debug

canNotVerify

The debug server is not notarized or signed, so it will trigger the protection of OS.

allowApp

Go to System Preferences > Security & Privacy, under the General tab. Allow dwdebug to run.

permissionInVS

The next time you debug, you will be able to open it. The debugging may not work properly this time. Just stop and debug again and it work.

DeqingSun commented 3 years ago

Extra, trouble shoot in command line. If it still doesn't work.

01_drag_and_open

Drag dwdebug into terminal and press enter to run it. It may trigger the protection of OS.

02_allow_app

Go to System Preferences > Security & Privacy, under the General tab. Allow dwdebug to run.

03_openAgain

Then next time you will be able to run it.

04_libusb

If you ever see the library not found error. It may cause by using the old version. Download the repo again and try again.

05_unconnected

If it runs successfully, you should see the unconnected prompt.

06_ch552notfound

Type dwen,device usbtiny1 and press enter. If you see "Cannot find requested device." It means the CH552 is not connected to the USB port properly or the CH552 is not working properly. Press Control+C to quit.

07_connected

If your board is connected properly, you should be able to connect. Press Control+C to quit.

If you see other error, and you are sure you've burned the boot loader successfully. Press Control+C to quit. Replug the USB to power cycle the Arduino, and try again. Because the Uno can not enter debug mode if you quit the debug mode in the same power cycle.