Status
As of April 13, 2017, the status is that the Ramp -> Display composite accessor runs on the Maxim Integrated MAX32630. The sizes are:
text data bss dec hex filename
291848 2964 8400 303212 4a06c BUILD/mbed-duktape2.elf
The work is in accessors/web/hosts/duktape/mbed-duktape2
. Running make
in that directory uses #define
s to create a Ramp -> Display composite accessor.
Future work would include porting accessor implementations to this chip.
The text below describes how to get started with the chip.
Overview
One idea is to run Accessors on the Maxim Integrated MAX32630 using Duktape.
- Datasheets
- Stats
- Cortex-M4
- 512K RAM
- 2MB Flash
- 1.8V core
- 106 uA/Mhz (up to 96 MHz => 10 mA full speed)
- 600 nA w/ RTC running
- 3.5 uW with RAM retention
Available from Digikey as dev kit for $28.05
Development Kit
There are two boards:
- The MAX32630FTHR, which is rectangular and has a SD slot and two micro usb-b connectors
- The MAXREFDES100HDK, which is house shaped with a connector on the end and a micro usb-b connector.
The should be connected together via a ribbon cable.
https://developer.mbed.org/platforms/MAX32630FTHR/ says to
- plug the port on the MAX32630FTHR into a USB cable and then to the computer
- plug the
hdk
port of the MAXREFDES100HDK into a USB cable and then to the computer
A USB drive should show up on the host computer.
Blinky
See https://developer.mbed.org/platforms/MAX32630FTHR/
There are two different mbed build systems
- A web-based system that requires a free account
- A command line system.
Starting with the web-based system is easier
- Go to https://developer.mbed.org/platforms/MAX32630FTHR/ then, under Example Programs, click on mbed-os-example-blinky
- In the mbed OS Blinky page, in the upper right, click on import into compiler
- In the mbed compiler window, select the /mbed-os-example-blinky project and then hit the Compile button
- Save the binary that is created
- Copy the binary to the drive that is provided by the board:
cp mbed-os-example-blinky_MAX32630FTHR.bin /Volumes/DAPLINK/
Blinky Troubleshooting
- Make sure that the correct device is selected. The name of the binary that is created should include
MAX32630FTHR
Command Line Interface
https://github.com/ARMmbed/mbed-os-example-blinky describes how to use the command line to install
mbed
requires Python 2.
Following https://github.com/ARMmbed/mbed-os-example-blinky
the following failure occurred:
bash-3.2$ mbed import mbed-os-example-blinky
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin/mbed", line 11, in <module>
load_entry_point('mbed-cli==1.0.0', 'console_scripts', 'mbed')()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 561, in load_entry_poi\
nt
return get_distribution(dist).load_entry_point(group, name)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_po\
int
return ep.load()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2291, in load
return self.resolve()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2297, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mbed/mbed.py", line 1040
sorted_scms = sorted(sorted_scms, key=lambda (m, _): not m)
bash-3.2$ which mbed
/opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin/mbed
Instead, use the pip2 installed by brew:
sudo -H pip2 install mbed-cli
/usr/local/bin/mbed import mbed-os-example-blinky
Compile with:
mbed compile -m MAX32630FTHR -t GCC_ARM
Then copy the binary:
cp ./BUILD/MAX32630FTHR/GCC_ARM/mbed-os-example-blinky.bin /Volumes/DAPLINK/
CLI Problems
If you get
bash-3.2$ mbed compile -m K64F -t ARM
usage: make.py [-h] [-m MCU] [-t TOOLCHAIN] [--color] [--cflags CFLAGS] [--asmflags ASMFLAGS] [--ldflags LDFLAGS] [-c] [--profile PROFILE]
[--app-config APP_CONFIG] [-p PROGRAM] [-n PROGRAM] [-j JOBS] [-v] [--silent] [-D MACROS] [-S] [-f GENERAL_FILTER_REGEX] [--automated]
[--host HOST_TEST] [--extra EXTRA] [--peripherals PERIPHERALS] [--dep DEPENDENCIES] [--source SOURCE_DIR] [--duration DURATION]
[--build BUILD_DIR] [-N ARTIFACT_NAME] [-d DISK] [-s SERIAL] [-b BAUD] [-L] [--rtos] [--rpc] [--eth] [--usb_host] [--usb] [--dsp]
[--fat] [--ublox] [--testlib] [-l LINKER_SCRIPT]
make.py: error: Could not find executable for ARM.
Currently set search path: No path set
[mbed] ERROR: "python" returned error code 2.
[mbed] ERROR: Command "python -u /Users/cxh/src/max/mbed-os-example-blinky/mbed-os/tools/make.py -t ARM -m K64F --source . --build ./BUILD/K64F/ARM" in\
"/Users/cxh/src/max/mbed-os-example-blinky"
---
then the problem is that you are running with the wrong machine (
K64F
) and toolchain (
ARM
)
Duktape
Build Duktape for the Maxim Pegasus
- See The Accessors Repository for how to get access to the repository
bash-3.2$ pwd
/Users/cxh/ptII/org/terraswarm/accessor/accessors/web/hosts/duktape/mbed-duktape2
- Run
ant
in the accessors/web
directory to build .h versions of .js files in accessors/web/hosts/duktape/eduk2/
- Under Mac OS X, install brew and install arm-none-eabi-gcc. In March, 2016, macports arm-none-eabi-gcc 5.4.0 did not work during linking:
/opt/local/lib/gcc/arm-none-eabi/5.4.0/../../../../arm-none-eabi/bin/ld: cannot find crt0.o: No such file or directory
: cannot find -lnosys
collect2: error: ld returned 1 exit status
...
bash-3.2$ /opt/local/lib/gcc/arm-none-eabi/5.4.0/../../../../arm-none-eabi/bin/ld --version
/opt/local/lib/gcc/arm-none-eabi/5.4.0/../../../../arm-none-eabi/bin/ld --version
GNU ld (GNU Binutils) 2.28
The solution is to use brew:
export PATH=/usr/local/Cellar/arm-none-eabi-gcc/6-2017-q1-update/bin:${PATH}
bash-3.2$ which arm-none-eabi-gcc
/usr/local/Cellar/arm-none-eabi-gcc/6-2017-q1-update/bin/arm-none-eabi-gcc
bash-3.2$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors 6-2017-q1-update) 6.3.1 20170215 (release) [ARM/embedded-6-branch revision 245512]
Copyright (C) 2016 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.
bash-3.2$
- Run make in the eduk2 directory to create
commonHost.h
and other files
- Run make in the mbed-duktape2 directory, then copy the file:
make
cp BUILD/mbed-duktape2.bin /Volumes/DAPLINK/
- The LED on the MAXREFDES100HDK, which is house shaped with a connector on the end, should blink
- Under Mac OS, eventually a dialog appears about how
DAPLINK
was not properly disconnected.
- On the The MAX32630FTHR, which is rectangular and has a SD slot and two micro usb-b connectors, press the reset switch near the white power connector
- Use a serial tool like CoolTerm to find the port, set it for 9600-8-None-1
- You should see output in CoolTerm
Duktape Problems