X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Fhla_target.c;h=60ed7d64df1749014ff8d83b4466333d36181b6c;hb=16065e06adac25953a63bceb0fe5bf4f2c75d6ce;hp=567a61dc355602257cca9a087b37dfd277601da8;hpb=5c941edc7b0d6e0bed596293d81867453d1462e9;p=openocd.git diff --git a/src/target/hla_target.c b/src/target/hla_target.c index 567a61dc35..60ed7d64df 100644 --- a/src/target/hla_target.c +++ b/src/target/hla_target.c @@ -346,7 +346,8 @@ static int adapter_init_arch_info(struct target *target, armv7m->examine_debug_reason = adapter_examine_debug_reason; armv7m->stlink = true; - target_register_timer_callback(hl_handle_target_request, 1, 1, target); + target_register_timer_callback(hl_handle_target_request, 1, + TARGET_TIMER_TYPE_PERIODIC, target); return ERROR_OK; } @@ -366,12 +367,14 @@ static int adapter_target_create(struct target *target, { LOG_DEBUG("%s", __func__); struct adiv5_private_config *pc = target->private_config; - struct cortex_m_common *cortex_m = calloc(1, sizeof(struct cortex_m_common)); - if (!cortex_m) - return ERROR_COMMAND_SYNTAX_ERROR; - if (pc != NULL && pc->ap_num > 0) { LOG_ERROR("hla_target: invalid parameter -ap-num (> 0)"); + return ERROR_COMMAND_SYNTAX_ERROR; + } + + struct cortex_m_common *cortex_m = calloc(1, sizeof(struct cortex_m_common)); + if (cortex_m == NULL) { + LOG_ERROR("No memory creating target"); return ERROR_FAIL; } @@ -470,6 +473,9 @@ static int adapter_poll(struct target *target) if (prev_target_state == state) return ERROR_OK; + if (prev_target_state == TARGET_DEBUG_RUNNING && state == TARGET_RUNNING) + return ERROR_OK; + target->state = state; if (state == TARGET_HALTED) {