-
ARM Cortex debugger like JLINK debugger (e.g. J-Link EDU Mini) OR MAX32625PICO.
-
USB cables depending on the type of USB ports of your computer
-
Install Vistual Studio Code (I use it because it is very flexible, you may use Eclipse or your preferred IDE)
-
Intall GNU
make
. This step may vary depending on the operating sytem you are using. Following are some pointers -
Install GNU Arm Embedded Toolchain
GNU Toolchain | GNU Arm Embedded Toolchain Downloads - Arm Developer
-
Download MAX78000 SDK. The SDK is hosted on GitHub and is a submodule of the ai8x-sythesis repository. To get the SDK and all the additional supporting files, clone the ai8x-sythesis repository including submodules and save it somewhere other than your project directory.
git clone --recursive https://github.com/MaximIntegratedAI/ai8x-synthesis
-
Download and install OpenOCD. Installing OpenOCD directly from package managers like
brew
orapt
may not work for MAX78000. You will need to clone it from GitHub and build it manually on your computer. First clone the repositorygit clone --recursive https://github.com/MaximIntegratedMicros/openocd
Please refer to "OpenOCD Dependencies" in the repository to make sure you have everything ready. Basically, you need to have
make
,libtool
,pkg-config
,autoconf
,automake
,texinfo
,libusb
, andhidapi
installed in order to build OpenOCD. Installinghidapi
is tricky. First clone it from GitHub.git clone --recursive https://github.com/libusb/hidapi.git
Go to
hidapi
directory from terminal and run./bootstrap ./configure sudo make sudo make install
Now, go to OpenOCD directory from terminal and follow below steps
-
You need to tell the build system where to look for
hidapi
andlibusb
packages. I was able to build on Ubuntu without this step, but needed this for Mac. Find where these packages are installed and change the paths in the command below.export PKG_CONFIG_PATH=/usr/local/Cellar/hidapi/0.10.1/lib/pkgconfig/:/usr/local/Cellar/libusb/1.0.24/lib/pkgconfig/
-
Run
./bootstrap ./configure --enable-cmsis-dap --enable-jlink sudo make sudo make install
-
-
Install PySerial. This is needed to see printf messages.
-
Now, clone embedded-firmware repo somewhere on your computer
git clone https://gitlab.com/ka-moamoa/supersensor/software/runtime/embedded-firmware/
-
To fetch Ink-Kernel submodule, run the following command in terminal.
git submodule update --init --remote
-
Setup 2 environmental variables that will be used to specify the Maxim path and ARM_GCC path(both should be the root folder). Run the commands below in a shell to set the environmental variables temporarily. To permanently set them, add these lines to the end of your
~/.profile
or~/.bash_profile
or~/.zprofile
depending on your shell setup.export MAXIM_PATH="path to your maxim sdk folder" export ARM_PATH="path to gcc-arm-none-eabi folder"
-
Now, you can build by either running
make release
in the terminal in VS code or using tasks that are defined intasks.json
in.vscode
directory. To do this, pressF1
and writeTasks: Run Build Task
, then click onbuild-release
. -
To upload the code, press
F1
thenTasks: Run Build Task
, and click onflash-jlink
orflash-cmsis-dap
for MAX78000EVKIT depending on the debugger you are using, and click onflash-cmsis-dap
for MAX78000FTHR. -
To clean a previous build, press
F1
thenTasks: Run Build Task
, and click onclean
. -
You may set up VS Code keyboard shortcuts to make
clean
,build
andflash
process smoother and faster -
Install Cortex-Debug extension in VS Code. Change
adapter driver
tocmsis-dap
here. A run symbol on left side bar in VS Code will appear. Click on it and then click green run button on top left. This will build the code and you will see the pointer onmain()
. Now you can put breakpoints and start debugging as you like. Happy debugging :) -
Open terminal, change usb device path in the command below and run. Start executing instructions in debug mode to see all printf messages in the terminal. You may use any other serial tools for this.
miniterm.py /dev/cu.usbserial-D30754YD 115200
Please refer to MaximAI repository to see how ML applications can be built