Using SparkFun Edge Board with Ambiq Apollo3 SDK
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. With this update, the board support package (BSP) are now located in a separate GitHub repository. Click the button below to download the forked version of the SDK!
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:
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, the BSP files are linked as a submodule from a separate repository.
- It is advisable for users to clone the submodules into the AmbiqSuiteSDK repository.
- However, users can also manually download the
.zipfile of the SparkFun_Apollo3_AmbiqSuite_BSPs and extract the contents into the
$AMB_ROOT/boards_sfedirectory.Extracting the BSP files into the
$AMB_ROOT/boards_sfedirectory. (Click to enlarge)
- $AMB_ROOT/CMSIS — This is a unified set of instructions for cortex processors.
- hal — Here you'll find the Ambiq interfaces for the hardware peripherals on the board.
- 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...
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 $AMB_ROOT/tools/apollo3_scripts/uart_wired_update.py may be incorrect. Make sure to change the permissions on this file to 755. (ie: chmod 755 uart_wired_update.py)