Skip to content

Commit a8b9674

Browse files
s-fairchilddeadprogram
authored andcommitted
Add build from source instructions for Fedora, PicoProbe Instructions
Building tinygo from source with the go tool chain requires configuring go-llvm for Fedora's source files. Add Fedora package instructions and PicoProbe debugger to debugging guide
1 parent 24c6586 commit a8b9674

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

content/docs/guides/build.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ For **MacOS**, you can install LLVM through [Homebrew](https://formulae.brew.sh/
6666
brew install llvm@14
6767
```
6868

69+
For **Fedora** users you configure the go-llvm module before installing the remaining dependencies
70+
```shell
71+
sudo dnf install llvm-devel golang-tinygo-x-llvm-devel lld-libs lld
72+
git clone https://github.com/tinygo-org/go-llvm.git
73+
cd go-llvm
74+
make config VERSION=14 SRCDIR=/usr/include/llvm/ BUILDIR=/usr/bin/llvm/
75+
go install
76+
```
77+
6978
After LLVM has been installed, installing TinyGo should be as easy as running the following command:
7079

7180
```shell
@@ -80,7 +89,7 @@ If you have gotten this far, please skip over to [Additional requirements](#addi
8089

8190
### With a self-built LLVM
8291

83-
You can also manually build LLVM. This is a long process which takes at least one hour on most machines. In many cases you can build TinyGo using a system-installed LLVM, see above.
92+
You can also manually build LLVM. This is a long process which takes at least one hour on most machines. In many cases you can build TinyGo using a system-installed LLVM, see above. More than 8GB of memory is recommend.
8493

8594
You will need a few extra tools that are required during the build of LLVM, depending on your OS.
8695

@@ -92,6 +101,13 @@ Debian and Ubuntu users can install all required tools this way:
92101
sudo apt-get install build-essential git cmake ninja-build
93102
```
94103

104+
Fedora users can install all required tools with:
105+
106+
```shell
107+
sudo dnf groupinstall "Development Tools"
108+
sudo dnf install cmake ninja-build
109+
```
110+
95111
On MacOS you can install these tools using [Homebrew](https://brew.sh/):
96112

97113
```shell

content/docs/guides/debugging.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,22 @@ You can install the most common dependencies through the package manager:
3030

3131
sudo apt-get install gdb-multiarch openocd
3232

33+
### Fedora
34+
35+
Fedora's `gdb` package comes compiled with multi arch support:
36+
37+
dnf install gdb openocd
38+
39+
To use the picoprobe as a debugger you must compile openocd from source using Raspberry Pi's openocd. [Getting Started with Raspberry Pi Pico](https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf) Appendix A has build instructions we can modify:
40+
41+
dnf install automake autoconf build-essential texinfo libtool libftdi-devel libusb1-devel
42+
git clone https://github.com/raspberrypi/openocd.git --recursive --branch rp2040 --depth=1
43+
cd openocd
44+
./bootstrap
45+
./configure --enable-ftdi --enable-sysfsgpio --enable-bcm2835gpio
46+
make -j$(nproc)
47+
sudo make install
48+
3349
### MacOS
3450

3551
You can install the most common dependencies through Homebrew:
@@ -55,6 +71,7 @@ Here are some debug probes that are known to work in TinyGo for at least some bo
5571
* [Particle Debugger](https://store.particle.io/products/particle-debugger): a [DAPLink](https://armmbed.github.io/DAPLink/) based debugger that can debug practially all ARM Cortex-M chips (like the SEGGER above) and does not have limitations on how it can be used. It is also open source. While this debugger is designed for Particle hardware it can easily handle chips from other vendors.
5672
* [ST-Link v2](https://www.st.com/en/development-tools/st-link-v2.html): a debugger often included on boards from STMicroelectronics and also sold separately. It is somewhat less powerful than some other debuggers as it is only intended to be used with ST hardware, even though it works with most microcontrollers that support SWD debugging. Note that many online stores sell counterfeit versions of this debugger that may be unreliable.
5773
* [DIY DAPLink](https://embeddedcomputing.weebly.com/the-5-programmer-debugger.html): a debugger you can make yourself. Requires compatible board, for example [Seeeduino XIAO](https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html) that costs about $5. Please see linked page for flashing and wiring instructions. For quick and easy start, it is possible to [download uf2 image](http://files.seeedstudio.com/wiki/Seeeduino-XIAO/res/simple_daplink_xiao.uf2) and flash it by simply copying it over to XIAO mounted as an external drive. Members of TinyGo community reported successfully using this method to debug XIAO and Arduino Nano 33 IoT boards.
74+
* [DYI Picoprobe](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#debugging-using-another-raspberry-pi-pico): Is another DIY opensource tool for the Raspberry Pi Pico. It acts as a Serial Wire Debugger (SWD) and UART to usb converter. The Raspberry Pi Pico getting started guide Appendix A page 60 has [instructions to build](https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf) from [source](https://github.com/raspberrypi/picoprobe) or you can download and flash the [UF2 image](https://datasheets.raspberrypi.com/soft/picoprobe.uf2).
5875

5976
Which one you should pick depends on availability and price in your area but if you want to be sure, the SEGGER debugger is a commonly used vendor-neutral debugger that supports almost all chips and is very reliable.
6077

0 commit comments

Comments
 (0)