From ec205e745a01c68d69d4362a34aa85d9f2ee6f86 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 22 Jul 2021 11:41:55 +0200 Subject: [PATCH] added scratch buffer section --- README.md | 62 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 356ccf75..9e72aa4d 100644 --- a/README.md +++ b/README.md @@ -591,6 +591,20 @@ Eclipse indexer. # Q7S Utilities and Troubleshooting +## Core commands + +Display currently running image: + +```sh +xsc_boot_copy +``` + +Rebooting currently running image: + +```sh +xsc_boot_copy -r +``` + ## pa3tool Host Tool The `pa3tool` is a host tool to interface with the ProASIC3 on the Q7S board. It was @@ -612,6 +626,40 @@ cat /tmp/test.txt For more useful combinations, see this [link](https://www.freecodecamp.org/news/the-cat-command-in-linux-how-to-create-a-text-file-with-cat-or-touch/). +## Using the scratch buffer of the ProASIC3 + +The ProASIC3 has a 1024 byte scratch buffer. The values in this scratch buffer will survive +a reboot, so this buffer can be used as an alternative to the SD cards to exchange information +between images or to store mission critical information. + +You can use `xsc_scratch --help` for more information. + +Write to scratch buffer: + +```sh +xsc_scratch write TEST "1" +``` + +Read from scratch buffer: + +```sh +xsc_scratch read TEST +``` + +Read all keys: + +```sh +xsc_scratch read + +``` + +Get fill count: + +```sh +xsc_scratch read | wc -c +``` + + ## Using `system` when debugging Please note that when using a `system` call in C++/C code and debugging, a new thread will be @@ -695,20 +743,6 @@ Reading data from CAN: candump can0 ```` -## Useful Q7S Linux Commands - -Display currently running image: - -```sh -xsc_boot_copy -``` - -Rebooting currently running image: - -```sh -xsc_boot_copy -r -``` - ## Preparation of a fresh rootfs and SD card This section summarizes important changes between a fresh rootfs and the current