# Preparing the system

## Tested System:

**Raspberry PI 3B+ running raspbian OS Lite**

```
  `.::///+:/-.        --///+//-:``    pi@firmwareuploader
 `+oooooooooooo:   `+oooooooooooo:    -------------------
  /oooo++//ooooo:  ooooo+//+ooooo.    OS: Raspbian GNU/Linux 10 (buster) armv7l
  `+ooooooo:-:oo-  +o+::/ooooooo:     Host: Raspberry Pi 3 Model B Plus Rev 1.3
   `:oooooooo+``    `.oooooooo+-      Kernel: 5.10.17-v7+
     `:++ooo/.        :+ooo+/.`       Uptime: 4 mins
        ...`  `.----.` ``..           Packages: 549 (dpkg)
     .::::-``:::::::::.`-:::-`        Shell: bash 5.0.3
    -:::-`   .:::::::-`  `-:::-       Terminal: /dev/pts/0
   `::.  `.--.`  `` `.---.``.::`      CPU: BCM2835 (4) @ 1.400GHz
       .::::::::`  -::::::::` `       Memory: 78MiB / 924MiB
 .::` .:::::::::- `::::::::::``::.
-:::` ::::::::::.  ::::::::::.`:::-
::::  -::::::::.   `-::::::::  ::::
-::-   .-:::-.``....``.-::-.   -::-
 .. ``       .::::::::.     `..`..
   -:::-`   -::::::::::`  .:::::`
   :::::::` -::::::::::` :::::::.
   .:::::::  -::::::::. ::::::::
    `-:::::`   ..--.`   ::::::.
      `...`  `...--..`  `...`
            .::::::::::
             `.-::::-`
```

## Hardware wise:

![](https://1066543514-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfWo0O3YNI1XV9DRwwL-887967055%2Fuploads%2Fv1hq2E3DMOoZiso63LXu%2Fuploader_terminal_info.001.jpeg?alt=media\&token=3a8a2c51-cfb8-43fa-a87b-de74d40469c9)

###

### Some other extra things:&#x20;

So I designed an all-in-one platform with the raspberry pi, custom keyboard (based on ATMega32u4 + cherry keys + cherry key sockets) an FTDI chip (as programmer for target, connected to pi over usb serial) and a display (more details later).&#x20;

Here is the HW over view of the platform that I designed.&#x20;

*If you do not use it you do not have to follow along.* &#x20;

### The platform:&#x20;

![](https://1066543514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MfWo0O3YNI1XV9DRwwL%2F-MiQWlBottTltnRMOdXo%2F-MiQX04oFjfPN4HgUAtj%2FIMG_20210824_202456_006.jpg?alt=media\&token=1a5b002a-47ac-498c-b5ec-ccb6b93da7a7)

![](https://1066543514-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfWo0O3YNI1XV9DRwwL-887967055%2Fuploads%2FP5jM0hYxQLpkWQSCZd7Y%2Fprogrammer_assembled_v2%20v30-1.png?alt=media\&token=4a107dea-9779-4b03-8067-e56ae52e56a3)

The project files:&#x20;

1. [Fusion360 project](https://a360.co/3kyZcl0)
2. [Fusion360 schematic](https://a360.co/3kHdwb4)
3. [Fusion 360 Brd](https://a360.co/2WJev2u)
4. [Fusion 360 3D](https://a360.co/38teMco)

### Assigning fixed Chip ID for FT232RQ chips are necessary:

**We have the FT232RQ FTDI chips in:**

1. Watch PCB (used for serial functionalities)
2. With Thermal printer contraption used by for our system to print out some physical debug messages. *My and suggested USB to serial adapter is based on FTDI FT232RQ.* (HW pictures and assembly guide in later pages)&#x20;
3. In the above PI's based all-in-1 system PCB for Serial to UPDI part, for programming the watch.&#x20;

The `serialport_manager.py` has logic to avoid (should avoid) both the thermal printer and the UPDI HW so that in can always scan (in a parallel threads) for unique FTDI chip ID (and avoid others).&#x20;

This way one can hot swap watch PCBs while the script is running as the serial port module and can manage all the different ports (like SERIAL UPDI PORT, THERMAL PRINTER SERIAL PORT and WATCH's UART PORT). &#x20;

**What are those static unique FTDI chip IDs?**&#x20;

In `global_vars.py`, if you take a peek, you can see:&#x20;

```
updi_ftdi_id = "A10KHTR4"
thermal_printer_serial_chip_id = "AC01O32Q"
```

**How to assign unique chip ID and  to which FT232RQ chips?**&#x20;

For the how part, well you would need a *windows machine* for that. :confused:

DOWNLOAD  and INSTALL the FTPROG software from [**here**](https://ftdichip.com/utilities/#ft_prog)**.**  Read the [**usage guide**](https://ftdichip.com/wp-content/uploads/2020/07/AN_124_User_Guide_For_FT_PROG.pdf) and it's very easy to provide custom parameters to an FT232RQ this way.&#x20;

**To which parts?**

&#x20;&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://werkhause.gitbook.io/firmware-uploader-terminal/system-pre-requisites.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
