/** ************************************************************************** * @file iap.h * @brief iap header file ************************************************************************** * Copyright notice & Disclaimer * * The software Board Support Package (BSP) that is made available to * download from Artery official website is the copyrighted work of Artery. * Artery authorizes customers to use, copy, and distribute the BSP * software and its related documentation for the purpose of design and * development in conjunction with Artery microcontrollers. Use of the * software is governed by this copyright notice and the following disclaimer. * * THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES, * GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS, * TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR * STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS, * INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. * ************************************************************************** */ #ifndef __IAP_H__ #define __IAP_H__ #ifdef __cplusplus extern "C" { #endif #include "at32f421_board.h" /** @addtogroup UTILITIES_examples * @{ */ /** @addtogroup USART_iap_bootloader * @{ */ /** @defgroup bootloader_definition * @{ */ /* app starting address */ #define APP_START_ADDR 0x08003400 /* the previous sector of app starting address is iap upgrade flag */ #define IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800) #define UPGRADE_DAT_START_ADDR APP_START_ADDR //0x0800A000 // 0x0804B000 // 0x08080000 /* when app received cmd 0x5aa5 from pc-tool, will set up the flag, indicates that an app upgrade will follow, see iap application note for more details */ #define IAP_UPGRADE_FLAG 0x41544B38 #define IAP_UPGRADE_FLAG_9F 0x444C4439 //0x41544B39 //use 9F Protocol #define IAP_UPGRADE_TYPE_DEFAULT 0 #define IAP_UPGRADE_TYPE_9F 1 #define IAP_CMD_READY 0xA5 #define IAP_CMD_ADDR_START 0xA6 #define IAP_CMD_TRAN_PKG_WITH_BACK 0xA7 #define IAP_CMD_TRAN_PKG_WITHOUT_OKBACK 0xA8 #endif