found issue root

This commit is contained in:
Robin Müller 2021-07-06 18:17:32 +02:00 committed by Robin Mueller
parent a4c843e3e2
commit 16a3ba1345
4 changed files with 49 additions and 7 deletions

View File

@ -576,7 +576,7 @@ When using Eclipse, there are two special build variables in the project propert
the sysroot path in those variables to get any additional includes like `gpiod.h` in the
Eclipse indexer.
# Q7S Utilities
# Q7S Utilities and Troubleshooting
## Creating files with cat and echo
@ -591,6 +591,17 @@ 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 `system` when debugging
Please note that when using a `system` call in C++/C code and debugging, a new thread will be
spawned which will appear on the left in Eclipse or Xilinx SDK as a `sh` program.
The debugger might attach to this child process automatically, depending on debugger configuration,
and the process needs to be selected and continued/started manually. You can enable or disable
this behaviour by selecting or deselecting the `Attach Process Children` option in the Remote
Application Configuration for the TCF plugin like shown in the following picture
<img src="https://egit.irs.uni-stuttgart.de/eive/eive-obsw/raw/branch/develop/doc/img/ProcessSettings.png" width="50%"> <br>
## Libgpiod
Detect all gpio device files:
@ -666,9 +677,10 @@ candump can0
## Useful Q7S Linux Commands
Rebooting currently running image:
````
```sh
xsc_boot_copy -r
````
```
# Running the EIVE OBSW on a Raspberry Pi

View File

@ -1,6 +1,8 @@
#include "Q7STestTask.h"
#include "fsfw/timemanager/Stopwatch.h"
#include "fsfw/tasks/TaskFactory.h"
#include <iostream>
#include <fstream>
#include <cstdio>
@ -16,10 +18,27 @@ ReturnValue_t Q7STestTask::performOneShotAction() {
void Q7STestTask::sdCardTests() {
using namespace std;
Stopwatch stopwatch;
ofstream testFile("/tmp/test.txt");
testFile << "Hallo Welt" << endl;
testFile.close();
//FILE* testFile = popen("q7hw sd info all", "r");
int result = std::system("q7hw sd info all > /tmp/sd_status.txt");
if(result != 0) {
sif::debug << "system call failed with " << result << endl;
}
ifstream sdStatus("/tmp/sd_status.txt");
string line;
uint8_t idx = 0;
while (std::getline(sdStatus, line)) {
std::istringstream iss(line);
string word;
while(iss >> word) {
if(word == "on") {
sif::info << "SD card " << static_cast<int>(idx) << " is on" << endl;
}
else if(word == "off") {
sif::info << "SD card " << static_cast<int>(idx) << " is off" << endl;
}
}
idx++;
}
std::remove("/tmp/sd_status.txt");
//TaskFactory::delayTask(3000);
//int result = system();
//std::fstream fs(testFile);
@ -43,3 +62,13 @@ void Q7STestTask::sdCardTests() {
// system("q7hw sd set 0 off > /tmp/sd_set.txt");
// stopwatch.stop(true);
}
void Q7STestTask::fileTests() {
using namespace std;
ofstream testFile("/tmp/test.txt");
testFile << "Hallo Welt" << endl;
testFile.close();
system("echo \"Hallo Welt\" > /tmp/test2.txt");
system("echo \"Hallo Welt\"");
}

View File

@ -10,6 +10,7 @@ private:
ReturnValue_t performOneShotAction() override;
void sdCardTests();
void fileTests();
};

BIN
doc/img/ProcessSettings.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB