Arrow / Mbed OS DAPLink Reset
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers target_reset.c Source File

target_reset.c

00001 /**
00002  * @file    target_reset.c
00003  * @brief   Target reset for the MAX32620
00004  *
00005  * DAPLink Interface Firmware
00006  * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
00007  * SPDX-License-Identifier: Apache-2.0
00008  *
00009  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00010  * not use this file except in compliance with the License.
00011  * You may obtain a copy of the License at
00012  *
00013  * http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing, software
00016  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00017  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00018  * See the License for the specific language governing permissions and
00019  * limitations under the License.
00020  */
00021 
00022 #include "swd_host.h"
00023 
00024 void target_before_init_debug(void)
00025 {
00026     // any target specific sequences needed before attaching
00027     // to the DAP across JTAG or SWD
00028     return;
00029 }
00030 
00031 uint8_t target_unlock_sequence(void)
00032 {
00033     // if the device can secure the flash and there is a way to
00034     //  erase all it should be implemented here.
00035     return 1;
00036 }
00037 
00038 uint8_t target_set_state(target_state_t state)
00039 {
00040     // invoke reset by sw (VECT_REQ or SYS_REQ) or hw (hardware IO toggle)
00041     // return swd_set_target_state_sw(state);
00042     //or
00043     return swd_set_target_state_hw(state);
00044 }
00045 
00046 uint8_t security_bits_set(uint32_t addr, uint8_t *data, uint32_t size)
00047 {
00048     // if there are security bits in the programmable flash region
00049     //  a check should be performed. This method is used when programming
00050     //  by drag-n-drop and should refuse to program an image requesting
00051     //  to set the device security. This can be performed with the debug channel
00052     //  if needed.
00053     return 0;
00054 }