From b2fef14aefd592fbc2042cfcf368c3149b046991 Mon Sep 17 00:00:00 2001 From: wgzAIIT <820906721@qq.com> Date: Mon, 20 Nov 2023 20:23:46 +0800 Subject: [PATCH 1/3] Update flash_for_ota.h --- .../xidatong-arm32/third_party_driver/include/flash_for_ota.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/flash_for_ota.h b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/flash_for_ota.h index 020e8fa23..cf74484f4 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/flash_for_ota.h +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/flash_for_ota.h @@ -1,6 +1,6 @@ /** -* @file flash.h -* @brief support flexspi norflash function +* @file flash_for_ota.h +* @brief support flash function * @version 2.0 * @author AIIT XUOS Lab * @date 2023-11-20 From d0bf9c956454f91c6f1e71e2597b10e024955324 Mon Sep 17 00:00:00 2001 From: wgz <820906721@qq.com> Date: Mon, 20 Nov 2023 21:11:55 +0800 Subject: [PATCH 2/3] add Mulan PSL v2 --- .../third_party_driver/common/flash.c | 2 +- .../third_party_driver/include/boot_for_ota.h | 16 ++++++++++++++-- .../third_party_driver/include/flash_for_ota.h | 17 +++++++++++++++-- .../third_party_driver/ota/boot_for_ota.c | 14 +++++++++++++- .../third_party_driver/ota/flash_for_ota.c | 16 ++++++++++++++-- .../XiZi_IIoT/tool/bootloader/flash/flash_ops.h | 15 ++++++++++----- 6 files changed, 67 insertions(+), 13 deletions(-) diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/common/flash.c b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/common/flash.c index 00af3765d..d755b4fd9 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/common/flash.c +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/common/flash.c @@ -6,7 +6,7 @@ */ /** -* @file fsl_flash.c +* @file flash.c * @brief support flexspi norflash function * @version 2.0 * @author AIIT XUOS Lab diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/boot_for_ota.h b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/boot_for_ota.h index d3bb55912..c3fdd09d0 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/boot_for_ota.h +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/boot_for_ota.h @@ -1,3 +1,15 @@ +/* +* Copyright (c) 2020 AIIT XUOS Lab +* XiUOS is licensed under Mulan PSL v2. +* You can use this software according to the terms and conditions of the Mulan PSL v2. +* You may obtain a copy of Mulan PSL v2 at: +* http://license.coscl.org.cn/MulanPSL2 +* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +* See the Mulan PSL v2 for more details. +*/ + /** * @file boot_for_ota.h * @brief support bootloader function @@ -6,8 +18,8 @@ * @date 2023-11-20 */ -#ifndef __MCUBOOT_H__ -#define __MCUBOOT_H__ +#ifndef __BOOT_FOR_OTA_H__ +#define __BOOT_FOR_OTA_H__ #include "fsl_common.h" #include "board.h" diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/flash_for_ota.h b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/flash_for_ota.h index cf74484f4..485df16da 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/flash_for_ota.h +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/flash_for_ota.h @@ -1,3 +1,16 @@ +/* +* Copyright (c) 2020 AIIT XUOS Lab +* XiUOS is licensed under Mulan PSL v2. +* You can use this software according to the terms and conditions of the Mulan PSL v2. +* You may obtain a copy of Mulan PSL v2 at: +* http://license.coscl.org.cn/MulanPSL2 +* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +* See the Mulan PSL v2 for more details. +*/ + + /** * @file flash_for_ota.h * @brief support flash function @@ -6,8 +19,8 @@ * @date 2023-11-20 */ -#ifndef __FLASH_H__ -#define __FLASH_H__ +#ifndef __FLASH_FOR_OTA_H__ +#define __FLASH_FOR_OTA_H__ #include #include diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/boot_for_ota.c b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/boot_for_ota.c index 53fa98dad..139e0645b 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/boot_for_ota.c +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/boot_for_ota.c @@ -1,5 +1,17 @@ +/* +* Copyright (c) 2020 AIIT XUOS Lab +* XiUOS is licensed under Mulan PSL v2. +* You can use this software according to the terms and conditions of the Mulan PSL v2. +* You may obtain a copy of Mulan PSL v2 at: +* http://license.coscl.org.cn/MulanPSL2 +* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +* See the Mulan PSL v2 for more details. +*/ + /** -* @file mucboot.c +* @file boot_for_ota.c * @brief support bootloader function * @version 2.0 * @author AIIT XUOS Lab diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/flash_for_ota.c b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/flash_for_ota.c index 914934b66..01a28710b 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/flash_for_ota.c +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/flash_for_ota.c @@ -1,6 +1,18 @@ +/* +* Copyright (c) 2020 AIIT XUOS Lab +* XiUOS is licensed under Mulan PSL v2. +* You can use this software according to the terms and conditions of the Mulan PSL v2. +* You may obtain a copy of Mulan PSL v2 at: +* http://license.coscl.org.cn/MulanPSL2 +* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +* See the Mulan PSL v2 for more details. +*/ + /** -* @file fsl_flash.c -* @brief support flexspi norflash function +* @file flash_for_ota.c +* @brief support flash function * @version 2.0 * @author AIIT XUOS Lab * @date 2023-11-20 diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.h b/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.h index e75abcd2e..dfcc3ef97 100644 --- a/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.h +++ b/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.h @@ -1,9 +1,14 @@ /* - * Copyright 2018-2020 NXP - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ +* Copyright (c) 2020 AIIT XUOS Lab +* XiUOS is licensed under Mulan PSL v2. +* You can use this software according to the terms and conditions of the Mulan PSL v2. +* You may obtain a copy of Mulan PSL v2 at: +* http://license.coscl.org.cn/MulanPSL2 +* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +* See the Mulan PSL v2 for more details. +*/ /** * @file flash_ops.h From a92dc71ce42da2648a567895cab5c4fdf27aaebb Mon Sep 17 00:00:00 2001 From: wgzAIIT <820906721@qq.com> Date: Tue, 21 Nov 2023 08:40:57 +0800 Subject: [PATCH 3/3] Modify the header file to include --- .../xidatong-arm32/third_party_driver/common/ymodem.c | 2 +- .../xidatong-arm32/third_party_driver/include/flash.h | 7 ------- .../xidatong-arm32/third_party_driver/ota/boot_for_ota.c | 2 +- .../xidatong-arm32/third_party_driver/ota/flash_for_ota.c | 1 - Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.h | 4 +--- 5 files changed, 3 insertions(+), 13 deletions(-) diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/common/ymodem.c b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/common/ymodem.c index 5eb8b728a..bbbbe3790 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/common/ymodem.c +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/common/ymodem.c @@ -20,7 +20,7 @@ #include #include "ymodem.h" #include "string.h" -#include "flash.h" +#include "flash_for_ota.h" uint8_t tab_1024[1024] ={0}; uint8_t FileName[FILE_NAME_LENGTH]; diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/flash.h b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/flash.h index a71feeceb..5c28bff17 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/flash.h +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/flash.h @@ -20,7 +20,6 @@ #include #include "fsl_romapi.h" -#define USE_HIGHT_SPEED_TRANS 1 #define SECTOR_SIZE 0x1000 #define FLASH_PAGE_SIZE 256 @@ -72,11 +71,5 @@ status_t Flash_Write(uint32_t WriteAddr, uint8_t *pBuffer, uint32_t NumByteToWri status_t Flash_Read(uint32_t addr, uint8_t *buf, uint32_t len); status_t Flash_Copy(uint32_t srcAddr,uint32_t dstAddr, uint32_t imageSize); -#ifndef USE_HIGHT_SPEED_TRANS -status_t NOR_FLASH_Write(uint32_t* FlashAddress, uint8_t* Data ,uint16_t DataLength); -#else -status_t NOR_FLASH_Write(uint32_t* FlashAddress, uint8_t* Data ,uint16_t DataLength,uint8_t doneFlag); -#endif - #endif diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/boot_for_ota.c b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/boot_for_ota.c index 139e0645b..2d467453a 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/boot_for_ota.c +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/boot_for_ota.c @@ -22,7 +22,7 @@ #include #include "common.h" #include "boot_for_ota.h" -#include "flash.h" +#include "flash_for_ota.h" #ifdef TOOL_USING_OTA diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/flash_for_ota.c b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/flash_for_ota.c index 01a28710b..8ab6be25d 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/flash_for_ota.c +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ota/flash_for_ota.c @@ -19,7 +19,6 @@ */ #include -#include "flash.h" #include "flash_for_ota.h" #include "MIMXRT1052.h" diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.h b/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.h index dfcc3ef97..a212f86aa 100644 --- a/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.h +++ b/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.h @@ -20,9 +20,7 @@ #ifndef __FLASH_OPS_H__ #define __FLASH_OPS_H__ - -#include - +#include "flash_for_ota.h" typedef struct { /* board init function*/