Using SparkFun Edge Board with Ambiq Apollo3 SDK

Pages
Contributors: Liquid Soulder
Favorited Favorite 5

Installing the SDK and Board Support Files

Downloading the SDK

The software development kit (SDK) is a collection of header files and functions that make using the Apollo3 much easier. Rather than reading the 900+ page datasheet and changing bits in registers the SDK gives the user functions and nearly-human-readable constants. On top of that, Ambiq has included a large number of examples to demonstrate all the bells and whistles of the Apollo3.

The SDK is a relatively big collection of files so you won't want to move it around often. You may also want to reference this location when you create a new project so make sure you download this to a location on your computer that makes sense.

This tutorial uses a forked version of the Ambiq Suite SDK v2.4.2. As a bonus, the board support package (BSP) is now included in the download. Click the button below to download the forked version of the SDK with BSP!

Once you have the SDK downloaded, extract it to your preferred location. Within that location, you should see a folder named something like AmbiqSuiteSDK -- from now on we'll call that the SDK root directory, with the path $AMB_ROOT where AMB expands to something like:

language:bash
C:/Users/you/Documents/AmbiqSuiteSDK
SDK Structure: When using an SDK like this one, with 'make' to track necessary compilation, the directory structure is very important. Don't change the locations of files or folders within your SDK. Adding new files or folders is OK.

In the Ambiq Suite SDK file structure you'll find the primary folders that contain source code that makes it really easy to use the microcontroller - for example drivers for UART, SPI, I2C, GPIO, ADC's -- you name it! You can explore these files in depth if you really need to know how the chip actually works, otherwise it suffices just to know that they are there to support your code-writing efforts. Below is a list of a few noteworthy folders:

  • $AMB_ROOT/boards — Here you can add custom definitions of the hardware or software capabilities of a given board that you might write code for - instead of having to manually include a custom header file all over the place. Ultimately this is where the SparkFun Edge Board Support Package will be placed if you are not using the mirrored Ambiq SDK.
  • $AMB_ROOT/boards_sfe — In SparkFun's mirror version of the Ambiq SDK v2.4.2, this is where our custom board files are located.
  • $AMB_ROOT/CMSIS — This is a unified set of instructions for cortex processors.
  • $AMB_ROOT/mcu
    • apollo3
      • hal — Here you'll find the Ambiq interfaces for the hardware peripherals on the board.
  • $AMB_ROOT/tools
    • apollo3_scripts — Python scripts for making and transmitting update images
  • $AMB_ROOT/utils — Utilities that aren't related to hardware peripherals - delays, string operations, etc...

Housekeeping

For various and sundry reasons, there are a few housekeeping items that need to be addressed. Please make sure to go through the steps below:

  • Within the Ambiq SDK, there is an incorrectly named file. Remove the "0" from the keys_info0.py file.
    • Old File Name: $AMB_ROOT/tools/apollo3_scripts/keys_info0.py
    • New File Name: $AMB_ROOT/tools/apollo3_scripts/keys_info.py
  • Permissions on bsp/tools/uart_wired_update_sparkfun.py may be incorrect. Make sure to change the permissions on this file to 755. (ie: chmod 755 uart_wired_update_sparkfun.py)