SparkFun Forums 

Where electronics enthusiasts find answers.

Everything with the AmbiqSuite SDK tools and software are welcome here.
User avatar
By AustinGreyson
#215756
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`.
User avatar
By liquid.soulder
#215764
Hi. Thanks for the report.

I can't seem to replicate your issue.
I am using v1.1.1 of the Arduino core, running in Arduino 1.8.12
All the latest source code suggests that the pin for LED_BUILTIN / LED_BLUE is correctly configured to be pin 19:
- https://github.com/sparkfun/SparkFun_Ap ... p/am_bsp.h
- https://github.com/sparkfun/SparkFun_Ap ... bsp_pins.c
- https://github.com/sparkfun/SparkFun_Ap ... bsp_pins.h
- https://github.com/sparkfun/SparkFun_Ap ... p_pins.src
- https://github.com/sparkfun/Arduino_Apo ... /variant.h

Can you please provide more details about your issue? For example what version of the core you are using. It would also be helpful if you could share some links / photos that demonstrate where you found usage of pin '37' for the RedBoard Artemis Nano.

I was able to run the 'Examples->Basics->Blink' sketch on the RBA Nano successfully.
User avatar
By Oxcart
#218538
In the 'blinky' example found in the 'boards_sfe' repository the pin configuration uses g_AM_HAL_GPIO_OUTPUT:
Code: Select all
am_hal_gpio_pinconfig(ui32GPIONumber, g_AM_HAL_GPIO_OUTPUT);
This global variable is defined in 'am_hal_gpio.c' as:
Code: Select all
const am_hal_gpio_pincfg_t g_AM_HAL_GPIO_OUTPUT =
{
    .uFuncSel       = 3,
    .eDriveStrength = AM_HAL_GPIO_PIN_DRIVESTRENGTH_2MA,
    .eGPOutcfg      = AM_HAL_GPIO_PIN_OUTCFG_PUSHPULL
};
Why is the call to 'am_hal_gpio_pinconfig()' not using 'g_AM_BSP_GPIO_LED_BLUE' from the 'am_bsp_pins.c' (for the right board)? For the artemis_thing_plus 'g_AM_BSP_GPIO_LED_BLUE' is defined as:
Code: Select all
const am_hal_gpio_pincfg_t g_AM_BSP_GPIO_LED_BLUE =
{
    .uFuncSel            = AM_HAL_PIN_26_GPIO,
    .eDriveStrength      = AM_HAL_GPIO_PIN_DRIVESTRENGTH_12MA
};
I tried this and it doesn't work.
  • 'AM_HAL_PIN_26_GPIO' is defined with a value of (3) which is the same value used in ' g_AM_HAL_GPIO_OUTPUT' for 'uFuncSel'.
  • The drive strengths are different. Why? 12MA seems wrong in the BSP version.
  • And eGPOutcfg isn't defined at all.
Is this correct or an error with the BSP definition? It seems like I should be able to use 'g_AM_BSP_GPIO_LED_BLUE' on the Artemis Thing Plus?
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]