xFSTK  0.0.0
Intel SoC Cross Platform Firmware & Software Tool Kit
Functions
xfstk-dldr-example-serial.cpp File Reference
#include <QtCore/QCoreApplication>
#include "xfstkdldrapi.h"
#include <stdlib.h>
#include <stdio.h>
Include dependency graph for xfstk-dldr-example-serial.cpp:

Functions

void status (char *message, void *clientdata)
 
int main (int argc, char *argv[])
 

Function Documentation

◆ status()

void status ( char *  message,
void *  clientdata 
)

Referenced by main().

23 {
24  printf(message);
25 }
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

References xfstkdldrapi::downloadfwos(), xfstkdldrapi::registerstatuscallback(), xfstkdldrapi::settargetretrycount(), and status().

27 {
28  QCoreApplication a(argc, argv);
29  xfstkdldrapi test;
30  int numtargets = 0;
31  int retrycount = 0;
32 
33 
34  if(argc > 1) {
35  numtargets = atoi(argv[1]);
36  printf("BEGIN PROVISION - ################# %d TARGETS #################\n",numtargets);
37  if(argc > 2) {
38  retrycount = atoi(argv[2]);
39  printf("RETRY COUNT - ################# %d RETRIES #################\n",retrycount);
40  }
41  }
42  else {
43  printf("XFSTK: xfstk-api-example-serial performs multi-target provisioning of both fw and os in a serial raound robin fashion. This approach is useful when dealing with unreliable USB connectivity.\n\n");
44  printf("Usage: xfstk-api-example-serial.exe <number of targets> <number of retries>\n");
45  printf("\nExample: xfstk-api-example-serial.exe 8 1000\n");
46  printf("\nThe above commandline will perform provisoning for 8 targets and retry 1000 times on I/O error.\n");
47  }
48 
49  bool provisioningok = false;
50  xfstkstatuspfn mystatusfn = &status;
52  if(retrycount > 0) {
53  test.settargetretrycount(retrycount);
54  }
55 
56  int targetcounter = 0;
57  int provpass = 0;
58  int provfail = 0;
59  int sanity = 0;
60  while(targetcounter < numtargets) {
61  provisioningok = test.downloadfwos("//tmp//fwdnx.bin", "//tmp//fwimage.bin", "//tmp//osdnx.bin", "//tmp//osimage.bin", "0x80000001");
62  if(provisioningok) {
63  printf("TARGET: %d - ################# SUCCESS!!! ###############\n",targetcounter);
64  provpass++;
65  }
66  else {
67  printf("TARGET: %d - !!!!!!!!!!!!!!!!! FAILURE... !!!!!!!!!!!!!!!\n",targetcounter);
68  printf("\nXFSTK: SUMMARY - TOTAL PASS = 0 - TOTAL FAIL = %d\n", numtargets);
69  printf("\nXFSTK: Programming NOT completed for all %d targets - FAIL\n",numtargets);
70  exit(0);
71  provfail++;
72  }
73  sanity++;
74  provisioningok = false;
75  targetcounter++;
76  if(sanity > 2*numtargets) {
77  printf("\nXFSTK: SUMMARY - TOTAL PASS = 0 - TOTAL FAIL = %d\n", numtargets);
78  printf("\nXFSTK: Programming NOT completed for all %d targets - FAIL\n",numtargets);
79  exit(0);
80  }
81 
82  }
83  printf("\nXFSTK: SUMMARY - TOTAL PASS = %d - TOTAL FAIL = %d\n", provpass, provfail);
84  if(provfail > 0) {
85  printf("\nXFSTK: Programming NOT completed for all %d targets - FAIL\n",numtargets);
86  }
87  else {
88  printf("\nXFSTK: Programming completed for all %d targets - PASS!\n",numtargets);
89  }
90  exit(0);
91 }
virtual bool downloadfwos(char *fwdnx, char *fwimage, char *osdnx, char *osimage, char *gpflags)
Performs single shot firmware and operating system download.
virtual bool registerstatuscallback(xfstkstatuspfn statuspfn, void *clientdata)
Registers a callback with the xfstk api in order to obtain download status information.
void status(char *message, void *clientdata)
Definition: xfstk-dldr-example-serial.cpp:22
virtual void settargetretrycount(int retries)
Sets the number of retries to perform during faulty USB I/O.
void(* xfstkstatuspfn)(char *status, void *)
Represents an optional status callback function that can be provided to xfstk API to obtain status in...
Definition: xfstkdldrapi.h:113
This interface enables the development of Intel SoC firmware/operating system provisioning applicatio...
Definition: xfstkdldrapi.h:124
Here is the call graph for this function: