# How do i use the examples in ameba sdk

**URL:** <https://forum.amebaiot.com/t/how-do-i-use-the-examples-in-ameba-sdk/1332>\
**Category:** SDK\
**Created:** [June 29, 2022, 12:21pm UTC](https://forum.amebaiot.com/t/how-do-i-use-the-examples-in-ameba-sdk/1332 "2022-06-29T12:21:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkAnd](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@MarkAnd](https://forum.amebaiot.com/u/MarkAnd)\
**Post date:** [June 29, 2022, 12:21pm UTC](https://forum.amebaiot.com/t/how-do-i-use-the-examples-in-ameba-sdk/1332/1 "2022-06-29T12:21:26Z")

</div>

Hello!  
How do I flash the examples from the ameba sdk? Where should I put the src-file (for the example)? Do I need to rebuild only project\_hp or also project\_lp?

---

<div class="post-metadata">

**Author:** ![wyy](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@wyy](https://forum.amebaiot.com/u/wyy)\
**Post date:** [June 30, 2022, 1:27am UTC](https://forum.amebaiot.com/t/how-do-i-use-the-examples-in-ameba-sdk/1332/2 "2022-06-30T01:27:35Z")

</div>

For peripheral examples found in `\project\realtek_amebaD_va0_example\example_sources`, you should copy the example source files and replace those found in `\project\realtek_amebaD_va0_example\src\src_hp`.

For software examples found in `\component\common\example`, they can be enabled by modifying the corresponding `#define` in `\project\realtek_amebaD_va0_example\inc\inc_hp\platform_opts.h`. Some examples will also require you to enter the `make menuconfig` configuration menu to enable the feature first (e.g. BLE).

Most of the time you should only need to rebuild project\_hp, unless you have code that specifically runs on the lp processor core.

---

<div class="post-metadata">

**Author:** ![MarkAnd](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@MarkAnd](https://forum.amebaiot.com/u/MarkAnd)\
**Post date:** [June 30, 2022, 6:37am UTC](https://forum.amebaiot.com/t/how-do-i-use-the-examples-in-ameba-sdk/1332/3 "2022-06-30T06:37:04Z")

</div>

Ok, thanks for your answer!  
What is the difference between peripheral and software examples?

---

<div class="post-metadata">

**Author:** ![wyy](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@wyy](https://forum.amebaiot.com/u/wyy)\
**Post date:** [June 30, 2022, 8:40am UTC](https://forum.amebaiot.com/t/how-do-i-use-the-examples-in-ameba-sdk/1332/4 "2022-06-30T08:40:53Z")

</div>

peripheral examples are examples that show how to use hardware peripherals on the chip, e.g. ADC, flash, GPIO, I2C, RTC, SDIO, SPI, timer, UART

software examples are examples that show how to use software libraries for communication / data processing, e.g. file system, HTTP, MQTT, OTA, SSL, TCP, WiFi

---

<div class="post-metadata">

**Author:** ![MarkAnd](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@MarkAnd](https://forum.amebaiot.com/u/MarkAnd)\
**Post date:** [June 30, 2022, 12:41pm UTC](https://forum.amebaiot.com/t/how-do-i-use-the-examples-in-ameba-sdk/1332/5 "2022-06-30T12:41:42Z")

</div>

Ok, understood.  
So lets say I flashed the soc with the “wlan\_scenario”. Where am I able to communicate with the board? For example if I want to scan for wifi networks, where do I write the input and where can I view the output (the networks that are detected)?

---

<div class="post-metadata">

**Author:** ![wyy](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@wyy](https://forum.amebaiot.com/u/wyy)\
**Post date:** [July 1, 2022, 1:21am UTC](https://forum.amebaiot.com/t/how-do-i-use-the-examples-in-ameba-sdk/1332/6 "2022-07-01T01:21:38Z")

</div>

The LOG\_UART pins (PA7 & PA8) would be the default input / output for most logs, messages and examples.

By default, even without enabling any examples, the compiled image should have an AT command interface listening on the LOG\_UART pins. You can refer to [AN0025](https://github.com/ambiot/ambd_sdk/blob/9fff35bf698d553d20f0a6019dab7e4eee8cb791/doc/AN0025%20Realtek%20at%20command.pdf) for the command format and functions. You can use the commands to connect to WiFi and transmit TCP messages.

---

<div class="post-metadata">

**Author:** ![MarkAnd](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@MarkAnd](https://forum.amebaiot.com/u/MarkAnd)\
**Post date:** [July 1, 2022, 12:18pm UTC](https://forum.amebaiot.com/t/how-do-i-use-the-examples-in-ameba-sdk/1332/7 "2022-07-01T12:18:49Z")

</div>

I got the AT-commands to work with pre-compiled binary files (downloaded from [AM8722DM factory reset - #4 by wyy](https://forum.amebaiot.com/t/am8722dm-factory-reset/936/4) ) so there is some problem with my own binaries…

---

<div class="post-metadata">

**Author:** ![wyy](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@wyy](https://forum.amebaiot.com/u/wyy)\
**Post date:** [July 1, 2022, 12:36pm UTC](https://forum.amebaiot.com/t/how-do-i-use-the-examples-in-ameba-sdk/1332/8 "2022-07-01T12:36:47Z")

</div>

Maybe you could try the [V1 release version](https://github.com/ambiot/ambd_sdk/releases/tag/QC-V1.0.0) instead of downloading from the master or dev branches.
