示例#1
0
stlink_t* stlink_v1_open(const int verbose) {
    stlink_t *sl = stlink_v1_open_inner(verbose);
    if (sl == NULL) {
        fputs("Error: could not open stlink device\n", stderr);
        return NULL;
    }
    // by now, it _must_ be fully open and in a useful mode....
    stlink_enter_swd_mode(sl);
    stlink_load_device_params(sl);
    ILOG("Successfully opened a stlink v1 debugger\n");
    return sl;
}
示例#2
0
文件: stlink-sg.c 项目: BG2BKK/stlink
stlink_t* stlink_v1_open(const int verbose, int reset) {
    stlink_t *sl = stlink_v1_open_inner(verbose);
    if (sl == NULL)
        return NULL;

    // 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  */
    if (reset) {
        stlink_reset(sl);
    }
    stlink_load_device_params(sl);
    ILOG("Successfully opened a stlink v1 debugger\n");
    return sl;
}