# GDB server for KM4

**URL:** <https://forum.amebaiot.com/t/gdb-server-for-km4/1575>\
**Category:** SDK\
**Tags:** rtl872xd, evb-amb82\
**Created:** [December 6, 2022, 3:30pm UTC](https://forum.amebaiot.com/t/gdb-server-for-km4/1575 "2022-12-06T15:30:39Z")\
**Posts on this page:** 3\
**Page:** 2

<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:** [December 21, 2022, 9:55am UTC](https://forum.amebaiot.com/t/gdb-server-for-km4/1575/21 "2022-12-21T09:55:16Z")

</div>

Hi @Tuxford

1. I believe this signature refers to the one used to determine which OTA image to boot. Refer to OTA chapter of AN0400 application note. It looks like the bootloader has been uploaded normally, but it is trying to boot from another invalid image2.

2. Uploading a binary image is not just sending it over UART. A simplified explanation is available in this [post](https://forum.amebaiot.com/t/which-protocol-to-update-firmware-for-bw16-by-mcu/1600/2). There is also a link to a GitHub repo where someone reverse engineered the process and wrote an application to upload the binary images.

---

<div class="post-metadata">

**Author:** ![Tuxford](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tuxford](https://forum.amebaiot.com/u/Tuxford)\
**Post date:** [April 27, 2023, 10:28pm UTC](https://forum.amebaiot.com/t/gdb-server-for-km4/1575/22 "2023-04-27T22:28:52Z")

</div>

Hi @wyy  
I found that if km4 image is not uploaded or corrupted it’s impossible to establish connection by JLink to KM4. Otherwise it connects. It it good?

---

<div class="post-metadata">

**Author:** ![dakamaster](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/dakamaster/32/3588_2.png) [@dakamaster](https://forum.amebaiot.com/u/dakamaster)\
**Post date:** [April 28, 2023, 7:00am UTC](https://forum.amebaiot.com/t/gdb-server-for-km4/1575/23 "2023-04-28T07:00:46Z")

</div>

Hi @Tuxford,

Yes.

The reason why you need to build a `km4` image before establishing the connection to JLink is that your main uploaded binary is compiled in a file called `km0_km4_image2.bin`.

Building an image and establishing a JLink connection are two different things. The `km0_km4_image2.bin` image you build can also be flashed into the RTL8720DN module via Image Tool.

* * *

### To summarize the steps for image uploading using JLink

1. download GitHub ambd\_sdk
2. make all in project\_lp followed by project\_hp
3. follow AN0400 to setup GDB
4. `make flash` in project\_lp  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/8/8ce2b4c0ab01f9bb16463a47ee7b7fc050434cb1.png)
5. `make flash` in project\_hp  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/6/6be5c6166cb233081f66a99c89816e3ba48eaa6d.png)

* * *

Thanks.

[Previous page](https://forum.amebaiot.com/t/gdb-server-for-km4/1575.md?page=1)
