add log binary data from UART. all Works
This commit is contained in:
21
python/iar_parser/BadBlockMapType.json
Normal file
21
python/iar_parser/BadBlockMapType.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "BadBlockMapType",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"name": "numBadBlock",
|
||||||
|
"offset": 0,
|
||||||
|
"size": 2,
|
||||||
|
"type": "uint16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "badList",
|
||||||
|
"offset": 4,
|
||||||
|
"size": 400,
|
||||||
|
"array": true,
|
||||||
|
"count": 100,
|
||||||
|
"elem_size": 4,
|
||||||
|
"elem_type": "uint32"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"size": 2
|
||||||
|
}
|
||||||
5
python/iar_parser/BuffU8Type.json
Normal file
5
python/iar_parser/BuffU8Type.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"name": "BuffU8Type",
|
||||||
|
"fields": [],
|
||||||
|
"size": 0
|
||||||
|
}
|
||||||
@@ -308,24 +308,24 @@ if __name__ == "__main__":
|
|||||||
# usage example:
|
# usage example:
|
||||||
# python elf_parser.py -f "C:\Danila\work\sputnik_test\src\sputnik\Debug\c.out" -t "Snapshot_HK_t"
|
# python elf_parser.py -f "C:\Danila\work\sputnik_test\src\sputnik\Debug\c.out" -t "Snapshot_HK_t"
|
||||||
|
|
||||||
argparser = argparse.ArgumentParser("elf_parser.py")
|
# argparser = argparse.ArgumentParser("elf_parser.py")
|
||||||
|
#
|
||||||
argparser.add_argument('-f', '--elf_file', required=True,
|
# argparser.add_argument('-f', '--elf_file', required=True,
|
||||||
help='specify path to elf-file')
|
# help='specify path to elf-file')
|
||||||
argparser.add_argument('-t', '--struct_name', required=True,
|
# argparser.add_argument('-t', '--struct_name', required=True,
|
||||||
help='specify structure name (\"UART_t\" for example')
|
# help='specify structure name (\"UART_t\" for example')
|
||||||
argparser.add_argument('-o', '--out_path', required=True,
|
# argparser.add_argument('-o', '--out_path', required=True,
|
||||||
help='specify out path with map data file in json format (\"C:/data/\" for example)')
|
# help='specify out path with map data file in json format (\"C:/data/\" for example)')
|
||||||
|
#
|
||||||
args = argparser.parse_args()
|
# args = argparser.parse_args()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# elf_file = "C:\Danila\work\sputnik_test\src\sputnik\Debug\c.out"
|
elf_file = "C:/Danila/work/1892VM12/boot2/MultiCore_Configuration_Debug/boot2.elf"
|
||||||
# struct_name = "NANDctrlOper_t"
|
struct_name = "BuffU8Type"
|
||||||
# out_path = "./"
|
out_path = "./"
|
||||||
# parser = DWARFstructParser(elf_file, struct_name, out_path)
|
parser = DWARFstructParser(elf_file, struct_name, out_path)
|
||||||
|
|
||||||
parser = DWARFstructParser(args.elf_file, args.struct_name, args.out_path)
|
# parser = DWARFstructParser(args.elf_file, args.struct_name, args.out_path)
|
||||||
json_struct = parser.get_struct()
|
json_struct = parser.get_struct()
|
||||||
parser.save_struct_to_json(json_struct)
|
parser.save_struct_to_json(json_struct)
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ void Logger::write(const QString& file, const QString& text)
|
|||||||
f.close();
|
f.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Logger::saveTestLog(const QString& filename, const QJsonObject& cfg,
|
void Logger::saveTestLog(const QString& filename, const QByteArray& rx, const QJsonObject& cfg,
|
||||||
bool passed, QString& error, QString mismatches)
|
bool passed, QString& error, QString mismatches)
|
||||||
{
|
{
|
||||||
QString log;
|
QString log;
|
||||||
@@ -47,6 +47,11 @@ void Logger::saveTestLog(const QString& filename, const QJsonObject& cfg,
|
|||||||
log += "\n";
|
log += "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log += "\n--- FULL LOG ---\n";
|
||||||
|
|
||||||
|
log += QString::fromUtf8(rx.toHex(' '));
|
||||||
|
log += "\n";
|
||||||
|
|
||||||
log += "<<<TEST_END>>>\n";
|
log += "<<<TEST_END>>>\n";
|
||||||
|
|
||||||
write(filename, log);
|
write(filename, log);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public:
|
|||||||
const QString& error = "");
|
const QString& error = "");
|
||||||
|
|
||||||
|
|
||||||
static void saveTestLog(const QString& filename, const QJsonObject& cfg,
|
static void saveTestLog(const QString& filename, const QByteArray &rx, const QJsonObject& cfg,
|
||||||
bool passed, QString &error, QString mismatches);
|
bool passed, QString &error, QString mismatches);
|
||||||
|
|
||||||
static void appendSummary(
|
static void appendSummary(
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
QCoreApplication app(argc, argv);
|
QCoreApplication app(argc, argv);
|
||||||
|
|
||||||
printf("Embedded test stand. (Version 1.3, 25.05.2026)\n");
|
printf("Embedded test stand. (Version 1.4, 29.05.2026)\n");
|
||||||
|
|
||||||
g_options = CLIParser::parse(argc, argv);
|
g_options = CLIParser::parse(argc, argv);
|
||||||
|
|
||||||
|
|||||||
@@ -549,7 +549,7 @@ bool UARTFixture::validateBinaryResponse(const QByteArray& rx, const QJsonObject
|
|||||||
if (!passed) { writeToLog(QString("%1\n%2").arg(err, errMsgMismatch) , false); break; }
|
if (!passed) { writeToLog(QString("%1\n%2").arg(err, errMsgMismatch) , false); break; }
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::saveTestLog(logFile, cfg, passed, err, errMsgMismatch);
|
Logger::saveTestLog(logFile, rx, cfg, passed, err, errMsgMismatch);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user