Getting started on OSX?

Apple Mac OSX
User avatar
RogerClark
Posts: 7475
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Getting started on OSX?

Post by RogerClark » Fri Jun 19, 2015 10:23 pm


User avatar
anthonyjclarke
Posts: 12
Joined: Tue Jun 16, 2015 8:44 pm

Re: Getting started on OSX?

Post by anthonyjclarke » Fri Jun 19, 2015 10:27 pm

I may be stretching "friendship" here... but decided to go over to Maple, install their IDE....

Whilst I cant select a Serial Port, I load Blink.... and it compiles and uploads (see below).... issue here is no blinking LED... :) but I can get to that later!

Binary sketch size is reported above. Check it against a 17000 byte maximum.
Loading via dfu-util
Resetting to bootloader via DTR pulse

Reset via USB Serial Failed! Did you select the serial right serial port?
Assuming the board is in perpetual bootloader mode and continuing to attempt dfu programming...


Searching for DFU device [1EAF:0003]...
Found it!

Opening USB Device 0x1eaf:0x0003...
Found Runtime: [0x1eaf:0x0003] devnum=0, cfg=0, intf=0, alt=0, name="DFU Program RAM 0x20000C00"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x0400
bytes_per_hash=256
Starting download: [##################################################] finished!
error resetting after download: usb_reset(ResetDevice): unknown error
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode

User avatar
RogerClark
Posts: 7475
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Getting started on OSX?

Post by RogerClark » Fri Jun 19, 2015 10:37 pm

Anthony

there is no harm in using the Maple IDE, but you will miss out on a lot of new stuff.

i know one or two people have found that installing the Maple IDE, magically fixed their Arduino IDE issues, but in your case I'm not sure if thats the case.

it just sounds like a permissions issue on one of the files.

i will check my mac to see if i need to widen the permissions on the new upload-reset file

User avatar
anthonyjclarke
Posts: 12
Joined: Tue Jun 16, 2015 8:44 pm

Re: Getting started on OSX?

Post by anthonyjclarke » Fri Jun 19, 2015 10:38 pm

Hows this?

nthonys-MBP-2:macosx anthonyjclarke$ ls -l
total 32
-rw-rw-rw-@ 1 anthonyjclarke staff 827 14 Jun 18:05 maple_upload
-rw-r--r--@ 1 anthonyjclarke staff 90 14 Jun 18:05 serial_upload
drwxrwxrwx@ 8 anthonyjclarke staff 272 20 Jun 08:36 stlink
-rw-r--r--@ 1 anthonyjclarke staff 64 14 Jun 18:05 stlink_upload
drwxrwxrwx@ 3 anthonyjclarke staff 102 17 Jun 09:12 stm32flash
-rw-r--r--@ 1 anthonyjclarke staff 420 14 Jun 18:05 upload_router

User avatar
RogerClark
Posts: 7475
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Getting started on OSX?

Post by RogerClark » Fri Jun 19, 2015 10:48 pm

OK

Sounds like the permissions are screwed up

mine are

Code: Select all

-rwxr-xr-x   1 administrator  staff  1377 16 Jun 21:23 maple_upload
-rwxr-xr-x   1 administrator  staff    90  8 Feb 18:01 serial_upload
drwxr-xr-x   8 administrator  staff   272  7 Apr 08:04 stlink
-rwxr-xr-x   1 administrator  staff    64  8 Feb 18:01 stlink_upload
drwxr-xr-x   4 administrator  staff   136  7 Apr 08:01 stm32flash
-rwxr-xr-x   1 administrator  staff  9424 16 Jun 21:17 upload-reset
-rwxr-xr-x   1 administrator  staff   420  8 Feb 18:01 upload_router
Did you install from zip file or by cloning the repo using git clone

just run chmod +x on the files that don't have execute but should have

I will download the zip file onto my mac (I'm now on my mac as you can probably guess), and see what happens to the permissions

edit

I just downloaded the zip and "archiver" unzipped it, and my permissions are fine

Code: Select all

ls -al
total 56
drwxr-xr-x@ 9 administrator  staff   306 17 Jun 09:29 .
drwxr-xr-x@ 7 administrator  staff   238 20 Jun 08:52 ..
-rwxr-xr-x@ 1 administrator  staff  1377 17 Jun 09:29 maple_upload
-rwxr-xr-x@ 1 administrator  staff    90 17 Jun 09:29 serial_upload
drwxr-xr-x@ 7 administrator  staff   238 17 Jun 09:29 stlink
-rwxr-xr-x@ 1 administrator  staff    64 17 Jun 09:29 stlink_upload
drwxr-xr-x@ 3 administrator  staff   102 17 Jun 09:29 stm32flash
-rwxr-xr-x@ 1 administrator  staff  9424 17 Jun 09:29 upload-reset
-rwxr-xr-x@ 1 administrator  staff   420 17 Jun 09:29 upload_router
Edit 2.

I just cloned the repo onto my local machine, using git clone https://github.com/rogerclarkmelbourne/ ... _STM32.git
and its also totally OK

I wonder if this is some sort of new OSX security issue.

I have noticed that Apple are pushing everything towards using their "App Store" for OSX "apps" (I do commercial dev that sometimes touches on OSX stuff) - and we had issues where Applications no longer run on the newer OSX versions because for Applications, the security is set so that only stuff that is digitally signed by Apple will run.

You can of course change the setting in the control panel to allow any Application to run, but I suspect that most people may not change this as it sounds like a security risk (but really its what the setting has been for the last 10+ years)




How did you download the repo ?
Last edited by RogerClark on Fri Jun 19, 2015 10:59 pm, edited 1 time in total.

User avatar
anthonyjclarke
Posts: 12
Joined: Tue Jun 16, 2015 8:44 pm

Re: Getting started on OSX?

Post by anthonyjclarke » Fri Jun 19, 2015 10:57 pm

Woohoo! (I think)....

Changed File Permissions....

Uploaded this :

void setup() {
// initialize digital pin 13 as an output.
pinMode(PB1, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(PB1, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(PB1, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

But no flashing LED anymore... maybe I don't have one on my Board :)

Output :


Sketch uses 12,564 bytes (11%) of program storage space. Maximum is 110,592 bytes.
Global variables use 3,104 bytes of dynamic memory.
dfu-util 0.8

dfu-util: Invalid DFU suffix signature
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Deducing device DFU version from functional descriptor length
Opening DFU capable USB device...
ID 1eaf:0003
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #1 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 1024
Copying data from PC to DFU device

Download [ ] 0% 0 bytes
Download [= ] 7% 1024 bytes
Download [=== ] 15% 2048 bytes
Download [===== ] 22% 3072 bytes
Download [======= ] 30% 4096 bytes
Download [========= ] 37% 5120 bytes
Download [=========== ] 45% 6144 bytes
Download [============= ] 52% 7168 bytes
Download [=============== ] 60% 8192 bytes
Download [================ ] 67% 9216 bytes
Download [================== ] 75% 10240 bytes
Download [==================== ] 82% 11264 bytes
Download [====================== ] 90% 12288 bytes
Download [======================== ] 97% 12564 bytes
Download [=========================] 100% 12564 bytes
Download done.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
dfu-util: error resetting after download

User avatar
RogerClark
Posts: 7475
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Getting started on OSX?

Post by RogerClark » Fri Jun 19, 2015 11:02 pm

Dont worry about the error, DFU util seems to intermittently do that on all systems

It definitely looks like its uploading.

Try using Serial and see if something prints out.

e.g.

Code: Select all

#define LEDPIN PB1

void setup() {
  // put your setup code here, to run once:
pinMode(LEDPIN,OUTPUT);
Serial.begin(115200); // not really needed on Maple
}
int c;
void loop() {
  // put your main code here, to run repeatedly:
Serial.println(c++);
digitalWrite(LEDPIN, !digitalRead(LEDPIN));
delay(500);
}

User avatar
RogerClark
Posts: 7475
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Getting started on OSX?

Post by RogerClark » Fri Jun 19, 2015 11:05 pm

Selected Maple mini rev 2 to flash

original bootloader

uploaded on 2 different maple minis

both worked fine for me.

User avatar
RogerClark
Posts: 7475
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Getting started on OSX?

Post by RogerClark » Fri Jun 19, 2015 11:08 pm

One other thing to try is manually reset the board after upload

I have seen the old bootloader sometimes not reset after upload

User avatar
RogerClark
Posts: 7475
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Getting started on OSX?

Post by RogerClark » Fri Jun 19, 2015 11:09 pm

BTW.

When you get chance can you tell me how you did the original install of the files e.g. downloaded the zip and unzipped or cloned the repo

As I've not had any issues with permissions on binary files before, but this could be a new OSX version issue

Post Reply