Skip to content

Instantly share code, notes, and snippets.

@lerouxb
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save lerouxb/f64891d25477e66a840b to your computer and use it in GitHub Desktop.

Select an option

Save lerouxb/f64891d25477e66a840b to your computer and use it in GitHub Desktop.
Some notes I took while getting the teensy version of micropython to build on OSX
* update README.md to mention "make deploy" and not "make upload"
* update README.md to link to wiki page
* update Makefile to include `pwd` in -path (see below)
* update README.md with build instructions for OSX:
(I'm probably missing some things because I've built some things before, but
those are all probably fairly standard "build toolchain" packages.)
# homebrew doesn't have the arm toolchain by default
- brew tap darconeous/embedded
- brew install arm-none-eabi-gcc
- brew install arm-none-eabi-binutils # probably a dependency of *-gcc already
# OSX and homebrew has no objcopy, so this is probably safe to symlink
- sudo ln -s /usr/local/bin/arm-none-eabi-objcopy /usr/local/bin/objcopy
# both OSX and homebrew don't come with realpath by default
- brew tap iveney/mocha
- brew install realpath
# the arduino files are deep inside the app package. This assumes you installed
# it system-wide at /Applications as opposed to /User/XXX/Applications
- export ARDUINO=/Applications/Arduino.app/Contents/Resources/Java
# -path="build" doesn't seem to work, but it could just be because the teensy
# loader can sometimes act weird on OSX until you plug in/out and press the
# program button again and again. `pwd`/build could probably work.
- /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/teensy_post_compile -file="micropython-mz" -path="/Users/XXX/src/micropython/teensy/build" -tools="/Applications/Arduino.app/Contents/Resources/Java/hardware/tools"
* To connect to the serial interface. usbmodem*** probably differs on your system
# picocom as a terminal emulator
- brew install picocom
- picocom /dev/tty.usbmodem415641
# OR (you only need one)
# screen is also a terminal emulator of sorts
- brew install screen
- screen /dev/tty.usbmodem415641
@dhylands

dhylands commented Aug 3, 2014

Copy link
Copy Markdown

About objcopy - I should update the script to use $(CROSS_COMPILE)objcopy (that gets mapped to arm-none-eabi-objcopy) which would be the better solution than using raw objcopy.

@dhylands

dhylands commented Aug 3, 2014

Copy link
Copy Markdown

Actually - looking at this again, I think that I should remove add-memzip.sh and just put it in the Makefile

@lerouxb

lerouxb commented Aug 3, 2014

Copy link
Copy Markdown
Author

Btw I'm still pretty sure that the -path parameter to teensy_post_compile is wrong:

leroux@lapdog:~/src/micropython/teensy$ make deploy V=1
../py/py-version.sh > build/genhdr/py-version.h.tmp
if [ -f "build/genhdr/py-version.h" ] && cmp -s build/genhdr/py-version.h build/genhdr/py-version.h.tmp; then rm build/genhdr/py-version.h.tmp; else echo "Generating build/genhdr/py-version.h"; mv build/genhdr/py-version.h.tmp build/genhdr/py-version.h; fi
Preparing post_compile for upload
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/teensy_post_compile -file="micropython-mz" -path="build" -tools="/Applications/Arduino.app/Contents/Resources/Java/hardware/tools"
Teensy Loader could not find the file micropython-mz
make: *** [post_compile] Error 1

Maybe that $(<D) bit behaves different in OSX?

@lerouxb

lerouxb commented Aug 3, 2014

Copy link
Copy Markdown
Author

Maybe it is better to call arm-none-eabi-objcopy rather than just objcopy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment