[docs] Add debugging info for RPi 4, fix GPIO numbers

This commit is contained in:
Kuba Szczodrzyński
2022-06-14 11:43:07 +02:00
parent 4d1c8357b4
commit 191a2bdd2a
3 changed files with 20 additions and 2 deletions

View File

@@ -9,7 +9,7 @@
* [Common methods](ltapi/_libre_tuya_a_p_i_8h.md)
* [Family-provided methods](ltapi/_libre_tuya_custom_8h.md)
* [Logger](ltapi/lt__logger_8h.md)
* [Chip types & UF2 families](ltapi/_chip_type_8h.md)
* [Chip & family IDs](ltapi/_chip_type_8h.md)
* [POSIX utilities](ltapi/lt__posix__api_8h.md)
* Common API
* [Flash](ltapi/class_i_flash_class.md)

View File

@@ -5,6 +5,7 @@ Debugging of Realtek Ameba chips is possible and was tested with OpenOCD running
*(the following is applicable to Arduino framework, and was not tested with SDK framework)*
LibreTuya has ready-to-use OpenOCD config files:
- [platform/realtek-ambz/openocd/amebaz.cfg](../../../platform/realtek-ambz/openocd/amebaz.cfg)
## Local debugger
@@ -22,7 +23,18 @@ Using a Raspberry Pi is probably the easiest option (and cheapest, as everyone h
Connect your Realtek board to your Pi, as per [Programming Microcontrollers using OpenOCD on a Raspberry Pi](https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi).
TL;DR: Install OpenOCD. Conenct A14 to GPIO23, A15 to GPIO22. Remember to join GND together. Refer to [boards/](../../../boards/) for pinouts.
Check out [RPi BCM2711 GPIOs](https://elinux.org/RPi_BCM2711_GPIOs) to read more about BCM pin mappings.
TL;DR: Install OpenOCD. Conenct A14 to BCM GPIO#11, A15 to BCM GPIO#25. Remember to join GND together. Refer to [boards/](../../../boards/) for pinouts.
!!! note
On Raspberry Pi 4, additional config might be needed:
```
bcm2835gpio peripheral_base 0xFE000000
bcm2835gpio speed_coeffs 236181 60
```
Save the lines to a .cfg file, and pass it to OpenOCD using `-f file.cfg`.
Read more [here](https://forums.raspberrypi.com/viewtopic.php?p=1541631&sid=915e8d039f24301b85c060318a44b7f0#p1541631).
Start OpenOCD like this (you also need your config file in the working directory):
```shell

View File

@@ -30,3 +30,9 @@ plugins:
markdown_extensions:
- md_in_html
- admonition
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.details
- pymdownx.superfences