#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/mman.h>
+#include "mmap.h"
#include "stlink-common.h"
#include "stlink-sg.h"
_stlink_sg_write_mem8,
_stlink_sg_read_all_regs,
_stlink_sg_read_reg,
+ NULL, /* read_all_unsupported_regs */
+ NULL, /* read_unsupported_regs */
+ NULL, /* write_unsupported_regs */
_stlink_sg_write_reg,
_stlink_sg_step,
_stlink_sg_current_mode,
return NULL;
}
- stlink_reset(sl);
- stlink_load_device_params(sl);
stlink_version(sl);
if ((sl->version.st_vid != USB_ST_VID) || (sl->version.stlink_pid != USB_STLINK_PID)) {
ugly_log(UERROR, LOG_TAG,
"WTF? successfully opened, but unable to read version details. BROKEN!\n");
return NULL;
}
+
return sl;
}
}
// by now, it _must_ be fully open and in a useful mode....
stlink_enter_swd_mode(sl);
+ /* Now we are ready to read the parameters */
+ stlink_reset(sl);
+ stlink_load_device_params(sl);
ILOG("Successfully opened a stlink v1 debugger\n");
return sl;
}