SparkFun Forums 

Where electronics enthusiasts find answers.

Everything with the AmbiqSuite SDK tools and software are welcome here.
User avatar
By gpiota
I'm trying to run the blinky example provided with the sparkfun bsps. The code uploads successfully with either bootloader, but nothing blinks. As a note, I am able to run the UART example successfully.

Looking at the code it shows `am_bsp_pins.c` to have

- `am_bsp_pins.h` sets `AM_BSP_GPIO_LED_BLUE` to `37`
- `am_bsp_pins.c` sets `g_AM_BSP_GPIO_LED_BLUE.uFuncSel`to `AM_HAL_PIN_37_GPIO`

Looking at the Nano schematics we see pad 19 maps to GPIO 19 which is assigned to LED and printed next to the LED. This makes me think 37 is incorrect the above values should be `19` and `AM_HAL_PIN_19_GPIO` respectively but this does not work either.

It seems the Thing Plus is set up this way (assuming it can run blinky...). Looking its schematics we see pas 26 maps to GPIO 18 which is assigned to the LED and also printed on the PCB next to the LED. In its respective files it has `AM_BSP_GPIO_LED_BLUE` set to 26 and `g_AM_BSP_GPIO_LED_BLUE.uFuncSel` set to `AM_HAL_PIN_26_GPIO`.

Nano Schematics: ... s-Nano.pdf
Thing Plus Schematics: ... ematic.pdf
I think the bsp is just configured poorly. Wrote my own blink by setting and clearing the pin.
Code: Select all
#include "am_mcu_apollo.h"

#define LED_BUILTIN 19

int main(void) {

  am_hal_gpio_pinconfig(LED_BUILTIN, g_AM_HAL_GPIO_OUTPUT);

  bool ledOn = false;
    } else {
    ledOn = !ledOn;