Upcoming maintenance
Dear Customers and Partners.
This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.
This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.
We apologize for any inconvenience.
Getting started with SDK
-
Hello,
I installed and have setup the SDK and VScode successfully. Even the trial "hello world" serial port program is working fine. But I'm unable to proceed further. I read the SDK developer guide multiple times but I don't know exactly where to start. The example programs were a bit complicated to me. Could you give some starting point to understand how the SDK programming works, something like a blink program to start with and how building and flashing the programs work, so that I could built further concepts on top of it.I'm bit acquainted to Embedded C programming on AVR microcontrollers. So some tutorial parallel to that would be really beneficial to understand easier.
Thank you
-
You can start by checking some examples: https://developer.sony.com/develop/spresense/docs/sdk_tutorials_en.html. Each example includes instructions on how to build and flash Spresense.
The source code for these examples is here: https://github.com/sonydevworld/spresense/tree/master/examples
Example code to turn on all four LEDs:
#include <sdk/config.h> #include <stdio.h> #include <arch/board/board.h> #include <arch/chip/pin.h> #define LED0 PIN_I2S1_BCK #define LED1 PIN_I2S1_LRCK #define LED2 PIN_I2S1_DATA_IN #define LED3 PIN_I2S1_DATA_OUT int myapps_main(int argc, char *argv[]) { board_gpio_write(LED0, -1); board_gpio_config(LED0, 0, 0, true, PIN_FLOAT); board_gpio_write(LED1, -1); board_gpio_config(LED1, 0, 0, true, PIN_FLOAT); board_gpio_write(LED2, -1); board_gpio_config(LED2, 0, 0, true, PIN_FLOAT); board_gpio_write(LED3, -1); board_gpio_config(LED3, 0, 0, true, PIN_FLOAT); board_gpio_write(LED0, 1); board_gpio_write(LED1, 1); board_gpio_write(LED2, 1); board_gpio_write(LED3, 1); return 0; }
You can follow the instructions from here: https://developer.sony.com/develop/spresense/docs/sdk_set_up_ide_en.html#_edit_the_main_source_code
Hope this helps you.
Best Regards,
Kamil Tomaszewski -
@kamiltomaszewski Thank you sir !