Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/macosx/maple_upload
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ${DFU_UTIL} -d ${usbID} -a ${altID} -D ${binfile} -R ${dfuse_addr} -R
echo -n Waiting for ${dummy_port_fullpath} serial...

COUNTER=0
while [ ! -c ${dummy_port_fullpath} ] && ((COUNTER++ < 40)); do
while ! dd if=${dummy_port_fullpath} of=/dev/null count=0 > /dev/null 2>&1 && ((COUNTER++ < 40)); do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Can you please explain why using dd is better than a built-in check (test -c)? I mean, device existence should be enough, there's no need to try opening it for reading.

  2. The same change is needed for linux (at least).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I mean, device existence should be enough, there's no need to try opening it for reading.

Because it does not have read permission though the device exist or you can't open the device for read though it have read permission. Please note that some device driver might return EACCESS on open operation even if the device entry on the file system have the permission.

  1. The same change is needed for linux (at least).

I can't test that modification because I don't have Linux PC. If you get device open error on your Linux, please try this patch.

sleep 0.1
done

Expand Down