Skip to content

Instantly share code, notes, and snippets.

@toshikaz55
Last active December 16, 2015 06:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toshikaz55/5394720 to your computer and use it in GitHub Desktop.
Save toshikaz55/5394720 to your computer and use it in GitHub Desktop.
How to setup Pebble E-Paper Smart watch SDK on MacOSX 10.8.3
Ref.
Step 2. Install the SDK toolchain & Compile a watch face from source code
http://developer.getpebble.com/1/01_GetStarted/01_Step_2
/Users/toshikaz% cd works/pebble-sdk-release-001/
/Users/toshikaz/works/pebble-sdk-release-001% ls
README.md demos/ sdk/ templates/ tools/ watches/
/Users/toshikaz/works/pebble-sdk-release-001% mdview README.md
/Users/toshikaz/works/pebble-sdk-release-001% cd sdk/
/Users/toshikaz/works/pebble-sdk-release-001/sdk% ls
include/ pebble_app.ld requirements.txt src/ waf* wscript
lib/ readme.txt resources/ tools/ waftools/
/Users/toshikaz/works/pebble-sdk-release-001/sdk% ./waf configure build
Setting top to : /Users/toshikaz/works/pebble-sdk-release-001/sdk
Setting out to : /Users/toshikaz/works/pebble-sdk-release-001/sdk/build
Checking for program gcc,cc : arm-none-eabi-gcc
Could not determine the compiler version ['arm-none-eabi-gcc', '-dM', '-E', '-']
(complete log in /Users/toshikaz/works/pebble-sdk-release-001/sdk/build/config.log)
/Users/toshikaz/works/pebble-sdk-release-001/sdk% echo "int main(void) {return 0;}" | arm-none-eabi-gcc -x c -
zsh: command not found: arm-none-eabi-gcc
/Users/toshikaz/works/pebble-sdk-release-001/sdk% sudo brew install libmpc
==> Installing libmpc dependency: mpfr
==> Downloading http://ftpmirror.gnu.org/mpfr/mpfr-3.1.1.tar.bz2
######################################################################## 100.0%
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file PATCHES
patching file VERSION
patching file src/get_d64.c
patching file src/mpfr.h
patching file src/version.c
patching file tests/tget_set_d64.c
patching file PATCHES
patching file VERSION
patching file src/mpfr.h
patching file src/strtofr.c
patching file src/version.c
patching file tests/tstrtofr.c
patch unexpectedly ends in middle of line
Hunk #2 succeeded at 1203 with fuzz 1.
==> ./configure --prefix=/usr/local/Cellar/mpfr/3.1.1-p2 --build=x86_64-apple-darwin
==> make
==> make check
==> make install
🍺 /usr/local/Cellar/mpfr/3.1.1-p2: 23 files, 3.2M, built in 101 seconds
==> Installing libmpc
==> Downloading http://multiprecision.org/mpc/download/mpc-1.0.1.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/libmpc/1.0.1 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr
==> make
==> make check
==> make install
🍺 /usr/local/Cellar/libmpc/1.0.1: 9 files, 292K, built in 63 seconds
/Users/toshikaz/works/pebble-sdk-release-001/sdk% ls /usr/local/lib/libmpc.3.dylib
/usr/local/lib/libmpc.3.dylib@
Download arm-cs-tools from Pebble site
Mac OS X 10.8: http://developer.getpebble.com/files/sdk-release-001/arm-cs-tools-osx-10.8-2012-12-07.tar.bz2
% sudo cp -r arm-cs-tools/ /usr/local/
*Add .zshrc file
export PATH=/usr/local/arm-cs-tools/bin:$PATH
*source ~/.zshrc
/Users/toshikaz/works/pebble-sdk-release-001% arm-none-eabi-gcc --version
arm-none-eabi-gcc (32-bit ARM EABI Toolchain JBS-2012.03-56-v2011.09-69-17-g3019757) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
/Users/toshikaz/works/pebble-sdk-release-001% echo "int main(void) {return 0;}" | arm-none-eabi-gcc -x c -
/usr/local/bin/../lib/gcc/arm-none-eabi/4.6.3/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000008018
*warning message which can be ignored
/Users/toshikaz/works/pebble-sdk-release-001% ls
README.md a.out* demos/ sdk/ templates/ tools/ watches/
*compiled file -> a.out
/Users/toshikaz/works/pebble-sdk-release-001% ./a.out
zsh: exec format error: ./a.out
/Users/toshikaz/works/pebble-sdk-release-001% python
*activate python27
(python27)/Users/toshikaz/works/pebble-sdk-release-001% pip install -r sdk/requirements.txt
...
Successfully installed Pillow freetype-py sh
(python27)/Users/toshikaz/works/pebble-sdk-release-001% python -c "import freetype"
(python27)/Users/toshikaz/works/pebble-sdk-release-001%
*No freetype error
(python27)/Users/toshikaz/works/pebble-sdk-release-001% cd sdk
(python27)/Users/toshikaz/works/pebble-sdk-release-001/sdk% ./waf configure
Setting top to : /Users/toshikaz/works/pebble-sdk-release-001/sdk
Setting out to : /Users/toshikaz/works/pebble-sdk-release-001/sdk/build
Checking for program gcc,cc : arm-none-eabi-gcc
Checking for program ar : arm-none-eabi-ar
'configure' finished successfully (3.022s)
(python27)/Users/toshikaz/works/pebble-sdk-release-001/sdk% ./waf build
Waf: Entering directory `/Users/toshikaz/works/pebble-sdk-release-001/sdk/build'
[ 1/11] resource_map.json: resources/src/resource_map.json -> build/resources/src/resource_map.json
[ 2/11] app_resources.pbpack.data: build/resources/src/resource_map.json -> build/resources/src/app_resources.pbpack.data
[ 3/11] app_resources.pbpack.table: build/resources/src/resource_map.json tools/pbpack_meta_data.py -> build/resources/src/app_resources.pbpack.table
[ 4/11] resource_ids.auto.h: build/resources/src/resource_map.json tools/generate_resource_code.py build/resources/src/app_resources.pbpack.data -> build/src/resource_ids.auto.h
[ 5/11] app_resources.pbpack.manifest: build/resources/src/app_resources.pbpack.data tools/pbpack_meta_data.py -> build/resources/src/app_resources.pbpack.manifest
[ 6/11] c: src/example_src.c -> build/src/example_src.c.1.o
[ 7/11] app_resources.pbpack: build/resources/src/app_resources.pbpack.manifest build/resources/src/app_resources.pbpack.table build/resources/src/app_resources.pbpack.data -> build/app_resources.pbpack
[ 8/11] cprogram: build/src/example_src.c.1.o -> build/pebble-app.elf
[ 9/11] pebble-app.raw.bin: build/pebble-app.elf -> build/pebble-app.raw.bin
[10/11] inject-metadata: build/pebble-app.raw.bin -> build/pebble-app.bin
[11/11] sdk.pbw: tools/mkbundle.py build/pebble-app.bin build/app_resources.pbpack resources/src/resource_map.json -> build/sdk.pbw
{'application': {'crc': 694619101L,
'name': 'pebble-app.bin',
'reqFwVer': 1,
'size': 3840,
'timestamp': 1366110471},
'debug': {'resourceMap': {u'friendlyVersion': u'VERSION',
u'media': [{u'defName': u'DUMMY',
u'file': u'resource_map.json',
u'type': u'raw'}],
u'versionDefName': u'VERSION'}},
'generatedAt': 1366110488,
'generatedBy': 'mac-mini2011.local',
'manifestVersion': 1,
'resources': {'crc': 2040033381L,
'friendlyVersion': u'VERSION',
'name': 'app_resources.pbpack',
'size': 4256,
'timestamp': 1366110471},
'type': 'application'}
writing bundle to /Users/toshikaz/works/pebble-sdk-release-001/sdk/build/sdk.pbw
done!
Waf: Leaving directory `/Users/toshikaz/works/pebble-sdk-release-001/sdk/build'
'build' finished successfully (17.446s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment