From e5024468112a84db5e57a020acd0a4b6848bf9dc Mon Sep 17 00:00:00 2001 From: Manfred Steiner Date: Sun, 1 Oct 2023 08:34:47 +0200 Subject: [PATCH] README.md updated --- README.md | 2 +- examples/simuc/README.md | 62 +++++++++++++++++++++++++++++++++------- 2 files changed, 52 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 265da2f..bef3e16 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # simavr -This repository is mirrored from [https://github.com/buserror/simavr.git](https://github.com/buserror/simavr.git), commit 7003af0 (Mon Jul 18 10:29:17 2022) +This repository is forked from [https://github.com/buserror/simavr.git](https://github.com/buserror/simavr.git), commit 7003af0 (Mon Jul 18 10:29:17 2022) * **simuc**: see [examples/](examples/simuc/README.md) * Original `README.md`: see [README-simavr.md](README-simavr.md) diff --git a/examples/simuc/README.md b/examples/simuc/README.md index aded0e6..af37561 100644 --- a/examples/simuc/README.md +++ b/examples/simuc/README.md @@ -2,30 +2,65 @@ **simuc** is used to simulate a megaAvr microcontroller. -If the cpu is stopped by command or `avr-gdb`, some information is printed on standard output: +The git repository for this program can be found on the git repository [https://git.htl-mechatronik.at/public/?p=sx/simavr.git;a=home](https://git.htl-mechatronik.at/public/?p=sx/simavr.git;a=home). +The software `simuc` itself is located in the subfolder [examples/simuc](https://git.htl-mechatronik.at/public/?p=sx/simavr.git;a=tree;f=examples/simuc;hb=HEAD) + +---------------------------------------------------- + +## Installation + +If the Debian/Ubuntu htl package is included the software is already installed. + +In any other case "ready to use" debian packages are located on [http://www.htl-mechatronik.at/ubuntu-new/pool/partner/](http://www.htl-mechatronik.at/ubuntu-new/pool/partner/) and can be installed after download with `apt install ...`. + +The package is available for 4 supported architectures: + +* **[amd64](http://www.htl-mechatronik.at/ubuntu-new/pool/partner/htl-simuc_0.0.6~1_amd64.deb)** Linux (Debian, Ubuntu, ...) PC 64 bit +* **[i386](http://www.htl-mechatronik.at/ubuntu-new/pool/partner/htl-simuc_0.0.6~1_arm64.deb)** Linux (Debian, Ubuntu, ...) PC 32 bit +* **[arm64](http://www.htl-mechatronik.at/ubuntu-new/pool/partner/htl-simuc_0.0.6~1_arm64.deb)** ARM 64 Bit (Respberry Pi 3,4 ... with RaspbianOs 64 Bit) +* **[armhf](http://www.htl-mechatronik.at/ubuntu-new/pool/partner/htl-simuc_0.0.6~1_armhf.deb)** ARM 32 Bit (Raspberry Pi 2,3,4 ... with RaspbianOs 32 Bit) + +---------------------------------------------------- + +## Overview + +If the microcontroller CPU is stopped by command or `avr-gdb`, some information is printed on standard output: * Number of cycles and elapsed time * Status Flags * General Purpose registers r0..r31 * address registers X, Y and Z * Stack pointer SP and stack content - -Commands available via standard input (keyboard): -* *Enter* print current cycles, elapsed time and LED status -* `interrupt`: stop cpu -* `continue`: continue cpu run -* `stack`: print complete stack content on standard output +* LED status for some type boards (Arduino, Sure Electronics, ...) + +**Commands** available via standard input (keyboard): +* ***Enter*** print current cycles, elapsed time and LED status +* `break` + *Enter*: + ... stop microcontroller CPU (breakpoint) +* `continue` + *Enter*: + ... continue microcontroller CPU +* `reset` + *Enter*: + ... simulate external reset (registers will be cleared, SRAM contents remain unchanged) +* `power` + *Enter*: + ... simulate power on reset (registers and SRAM will be cleared) +* `stack` + *Enter*: + ... print complete stack content on standard output + +It is sufficient to enter only as many characters of the command until the command is unique. +`b` for *break*, `c` for *continue*, `r` for *reset*, `p` for *power* and `s` for *stack* Microcontrollers UART interface(s) is/are connected to local devices and can be used with terminal programs (like `picocom`). -After start of `simuc` the program waits for an keyboard action to start simulation. So you are able to connect with avr-gdb before the simulation is executing some machine code. +After start of `simuc` the program waits for a command (via keyboard) to start simulation. So you are able to connect with *avr-gdb* before the simulation is executing some machine code. 1) start `simuc` with proper options and arguments 2) start new shell and execute `avr-gdb` 3) inside (gdb) connect to simuc with the gdb shell command `target remote :1234` 4) load symbols with gdb command `file ...` 5) optionally set source directory with `directory ...` -6) press enter in the shell of simuc -7) now debug avr program step by step with gdb commands `stepi`, `step`, `nexti`, `next` or continue execution with `continue` +6) press `b` and enter in the shell of simuc (break on first machine command) +7) now debug avr program step by step with gdb commands `stepi` (`si`), `step` (`s`), `nexti` (`ni`), `next` (`n`) or continue execution with `continue` (`c`) + +Don't forget to compile your program with the option **`-g`** (include gdb debugging information in elf-file)! ------------------------------------------------------------- @@ -35,7 +70,7 @@ After start of `simuc` the program waits for an keyboard action to start simulat ```sh $ sudo apt install gcc make gcc-avr avr-libc $ sudo apt install libelf-dev -$ sudo apt install freeglut3 freeglut3-dev +$ sudo apt install freeglut3-dev $ sudo apt install libncurses5 libncurses5-dev ``` @@ -45,6 +80,9 @@ $ sudo apt install libncurses5 libncurses5-dev user@host:~ $ git clone https://git.htl-mechatronik.at/public/sx/simavr.git ``` +The main branch is named `sx-master` because the branch `master` remains unchanged with the original simavr repository on [https://github.com/buserror/simavr](https://github.com/buserror/simavr) (commit [7003af0](https://github.com/buserror/simavr/commit/7003af0)). + + ### Make complete simavr ```sh @@ -70,3 +108,5 @@ user@host:~/simavr/examples/simuc $ export DEBVERSION="0.0.6~1"; make deb ``` Debian packet available in folder `dpkg` + +Find "ready to use" debian packages on [http://www.htl-mechatronik.at/ubuntu-new/pool/partner/](http://www.htl-mechatronik.at/ubuntu-new/pool/partner/). -- 2.39.5