Skip to content
Snippets Groups Projects
Forked from card10 / firmware
Loading
README.md 4.96 KiB

card10 Firmware Readme

Toolchain

The card10 is based on an ARM Cortex-M4F CPU. To compile the firmware, you need a working cross compiler. To flash the firmware, you either need to use the bootloader or an SWD adapter and OpenOCD.

GCC

Please install arm-none-eabi-gcc on your system. Most distributions have it packaged (might be named gcc-arm-none-eabi). You can also download a precompiled toolchain from ARM.

GDB

If you want to debug code or replace the bootloader, you need OpenOCD and GDB.

Use arm-none-eabi-gdb (might be packaged as gdb-arm-none-eabi or get it from the binary distribution above).

Add the following line to your ~/.gdbinit file:

add-auto-load-safe-path <PATH TO THIS REPOSITORY>

This allows gdb to use our .gdbinit files without specifying them on the command line.

OpenOCD

If you want to debug code or replace the bootloader, you need OpenOCD and GDB.

Get OpenOCD from Maxim and checkout the max32xxx branch. Build using ./configure and 'make'. Make sure that the CMSIS-DAP Compliant Debugger is set to yes(auto) after running ./configure (you might need to install libusb and other USB related libaries).

Please run make install after removing any already installed OpenOCD version. Otherwise please always specify the full path to openocd (the binary is under src/openocd, when calling openocd.

Run OpenOCD from the root openocd/scripts directory in this repository like this: openocd -f interface/cmsis-dap.cfg -f target/max32665.cfg. It should display something similar to:

Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: FW Version = 1.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x2ba01477
Info : max32xxx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections

Debugger Connection

If you have the debugger provided with the card10, connect it as follows:

  • HDK: This connection provides debugging (SWD) and UART
  • DEV: This connection provides power (battery charger) and the native USB connection (bootloader)
  • USB-C: Connect the proved USB-C cable with the side which has the blue dot, so the blue dots have the same side