ChibiStudio - installation on Linux.

Based on using Linux Mint 21.1

(Much of this has some application to a Windows installation as well)

Installation
============
1. As per instructions, simply unzip into a suitable host directory. It creates a tree under new directory ChibiStudio. This can be renamed if preferred.

2. Note: You have to use a separate workspace for each version of ChibiOS  if the predefined ones arent suitable, create a new workspace directory.

Start up ChibiStudio, select the desired workspace.

3. A project Chibios (whole tree) should be shown in project explorer; this will probably give an error when you try to open it, in which case continue with the rest of this section:
	a) Delete the project
	b) Select import an existing project, and select the directory for your version of ChibiOS (e.g. chibios2111). [There should be a hidden file .project in the root directory of the chibiOS version; if not, unsure what to do!]
	c) Once imported, check the directory references in the project preferences.

Note: When developing, make sure the Chibios (whole tree) project is open (this defines the CHIBIOS environment variable, among other things, and is needed for some of the tools to work).

4. Add in any of your own supporting libraries.

5. Copy existing projects into the workspace, then import them.

6. For each project check the paths given in the preferences (Resources and Linked Resources), and adjust if necessary.

It should now be possible to compile projects in the normal way.


Debugging
=========
The distribution includes the normal Eclipse debug view with Chibi plugin, plus openOCD.

7. Copy udev rules file from tools/openOCD/ contrib/libdcc60-openocd.rules to etc/udev/rules.d/ (you may need to create your own rules if using an unsupported debugger).

Load the new rules:
	udevadm control --reload

8. May need to add user to group dialout:
			adduser username dialout

9. May need to install libcurses5 for gdb to work (libcurses5 is now legacy; will depend on version of gdb included with Chibi distribution).

10. In use, it is necessary to launch OpenOCD configured for the appropriate target (Run->External_Tools). Script files for many targets are in tools/openocd/scripts. It may be desirable/necessary to create a new script for a specific target.

Note: For stmL0xx series, there are single bank and dual bank devices which need different startup scripts. Also, some of the smaller devices do not have enough RAM for the configured workspace size of 0x2000.

