Copying bin files to FRDM-KL25Z/46Z using cp/mv commands in Mac OS X shell

The cp command in recent versions of Mac OS X preserves the extended file attributes and resource forks of each source file in the copy. The mv command also does the same thing. Unfortunately such behavior is sometimes harmful if the destination of the copy is in an MBED drive. For example, if your device is Freescale FRDM-KL25Z (or KL46Z), it seems OK to copy a .bin file using the cp command as follows, but this result in an error.

cp foo.bin /Volumes/MBED

In this case, your program will not not start and you will find a file named fail.txt in the MBED drive. The reason is that the file system provided by the device can not recognize the extended attributes or resource forks of the file. To avoid such trouble, you should specify "-X" option with the cp command.

cp -X foo.bin /Volumes/MBED


1 comment on Copying bin files to FRDM-KL25Z/46Z using cp/mv commands in Mac OS X shell:

19 Feb 2015

Hi ,

I am facing same issue as you mentioned in your post. I have posted my issue sometime but did not get any reply.

https://developer.mbed.org/questions/6142/copy-binary-file-to-mac-os-x-using-cp-co/

I tried the -X command which i do not see working. Once after cp command, i tried to reset board which also seems not working.

I am using 10.9.5 version of Mac.

Let me know if you have any other suggestion to try.

Jagadeesh K.

Please log in to post comments.