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

« Back to documentation index

Show/hide line numbers flash_blob.h Source File

flash_blob.h

Go to the documentation of this file.
00001 /**
00002  * @file    flash_blob.h
00003  * @brief
00004  *
00005  * DAPLink Interface Firmware
00006  * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
00007  * Copyright 2019, Cypress Semiconductor Corporation 
00008  * or a subsidiary of Cypress Semiconductor Corporation.
00009  * SPDX-License-Identifier: Apache-2.0
00010  *
00011  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00012  * not use this file except in compliance with the License.
00013  * You may obtain a copy of the License at
00014  *
00015  * http://www.apache.org/licenses/LICENSE-2.0
00016  *
00017  * Unless required by applicable law or agreed to in writing, software
00018  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00019  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00020  * See the License for the specific language governing permissions and
00021  * limitations under the License.
00022  */
00023 
00024 #ifndef FLASH_BLOB_H
00025 #define FLASH_BLOB_H
00026 
00027 #include <stdint.h>
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032 
00033 // Flags for program_target
00034 enum { 
00035     kAlgoVerifyReturnsAddress  = (1u << 0u),     /*!< Verify function returns address if bit set */
00036     kAlgoSingleInitType  =       (1u << 1u),     /*!< The init function ignores the function code. */
00037     kAlgoSkipChipErase  =        (1u << 2u),     /*!< Skip region when erase.act action triggers. */
00038 };
00039 
00040 typedef struct __attribute__((__packed__)) {
00041     uint32_t breakpoint;
00042     uint32_t static_base;
00043     uint32_t stack_pointer;
00044 } program_syscall_t;
00045 
00046 typedef struct __attribute__((__packed__)) {
00047     const uint32_t  init;
00048     const uint32_t  uninit;
00049     const uint32_t  erase_chip;
00050     const uint32_t  erase_sector;
00051     const uint32_t  program_page;
00052     const uint32_t  verify;
00053     const program_syscall_t sys_call_s;
00054     const uint32_t  program_buffer;
00055     const uint32_t  algo_start;
00056     const uint32_t  algo_size;
00057     const uint32_t *algo_blob;
00058     const uint32_t  program_buffer_size;
00059     const uint32_t  algo_flags;         /*!< Combination of kAlgoVerifyReturnsAddress, kAlgoSingleInitType and kAlgoSkipChipErase*/
00060 } program_target_t;
00061 
00062 typedef struct __attribute__((__packed__)) {
00063     const uint32_t start;
00064     const uint32_t size;
00065 } sector_info_t;
00066 
00067 #ifdef __cplusplus
00068 }
00069 #endif
00070 
00071 #endif