tinyvision-ai-inc / tinyclunx33_public

Documentation for the tinyNX33U SoM and related boards
Other
4 stars 2 forks source link

[doc] document the use of Zadig for Windows, and sudo for Linux #3

Open josuah opened 2 weeks ago

josuah commented 2 weeks ago

The open-source command line tools used to debug the tinyCLUNX33 such as ecpprog were developped under Linux as part of the Yosys community.

This means they use libusb to implement the FTDI driver in user-space, rather than using the FTDI-provided driver (absent on Linux). One Windows, like for many command line utilities developped for Linux/MacOS first, this means that it is required to switch the driver used using tools like Zadig, so that instead of using the FTDI driver, they get a generic driver assigned allowing to communicate with the device directly.

Also, on Linux, in order to be able to read logs from the /dev/ttyUSB1 device, it is required to:

And to be able to use ecpprog command:

An alternative to bypass all of this setup is to run the command with sudo

And bit of background about how this can be done in a VM or WSL would also be appreciated: links for how to access a local USB device into WSL or in a VM, even if it is not tested.

This would need to be mentioned on this page maybe: https://tinyclunx33.tinyvision.ai/md_som_flash.html

Unless there is a better place where to document it...

alanridel commented 1 week ago

Zadig Usage

This document will cover:

Introduction

Zadig is a portable tool for Windows that is meant to install a libusb compatible driver, for a device that does not yet have such a driver installed.

Download and Run Zadig

Go to Zadig official website, there you will find a download button for the latest release. This will download a portable (you don't have to install it) .exe file to your downloads folder.

To run Zadig go to your Download folder where your Zadig executable was downloaded and double-click on the executable.

Zadig Usage

Once you open the application, you will get a screen that looks like shown below.

Capture_2

Here on the first dropdown menu, it will display all the connected USB devices. Select the device for which we need to add driver support.

If you cannot see your device listed, then it probably means that it already has a driver installed.

Next, you need to select which driver we need to install by changing the second menu option as shown below.

tempsnip_3

Now Click on the Install Driver button. This will install the driver and display a successful installation message as a popup.

alanridel commented 1 week ago

Sudo

sudo (SuperUser DO) allows a permitted user to execute a command as the superuser this lets you access restricted files and operations. The sudo command temporarily elevates privileges, allowing users to complete sensitive tasks without logging in as the root user.

sudo Command Syntax

sudo [command]

Basic sudo Usage

For a normal user, apt update command will give a premission denied error. So you can run sudo apt update which will ask for the root password, on successful authentication, apt update will run with root privilege.

Now if you want to run multiple commands on the shell that require root permission, you can open a shell with root access. to do that type the following command.

sudo -s

This will ask for a password and if the user has root access his terminal prompt user:~$ will change to user:~#.

Now your shell will have root access to all the files and operations on the Linux system.

Use this with caution as this can delete or run any program/file without any warning.

josuah commented 1 week ago

Next is to integrate it to the website.

[...]