diff --git a/bootloader/bootloader-usb.c b/bootloader/bootloader-usb.c index b6b3924ee98efcd988de648a93123e958f9f4375..6dad89b3f88aa57099cd393af39dee6f34bf235b 100644 --- a/bootloader/bootloader-usb.c +++ b/bootloader/bootloader-usb.c @@ -35,12 +35,7 @@ */ /** - * @file main.c - * @brief USB Mass Storage Class example - * @details This project creates a mass storage device using either on-board RAM or - * external SPI flash memory. Load the project, connect a cable from the PC - * to the USB connector. A new external drive should appear than can be read - * and written. + * @brief USB Mass Storage Class */ #include <stdio.h> diff --git a/bootloader/main.c b/bootloader/main.c index 3ef22f0c9b40784dbf1909b63e883cd710bb3d12..e2ecaa14398c27fc7d724ef6c5b447fe566051fe 100644 --- a/bootloader/main.c +++ b/bootloader/main.c @@ -1,48 +1,3 @@ -/******************************************************************************* - * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES - * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of Maxim Integrated - * Products, Inc. shall not be used except as stated in the Maxim Integrated - * Products, Inc. Branding Policy. - * - * The mere transfer of this software does not imply any licenses - * of trade secrets, proprietary technology, copyrights, patents, - * trademarks, maskwork rights, or any other form of intellectual - * property whatsoever. Maxim Integrated Products, Inc. retains all - * ownership rights. - * - * $Id: main.c 31505 2017-10-20 21:16:29Z zach.metzinger $ - * - ******************************************************************************* - */ - -/** - * @file main.c - * @brief USB Mass Storage Class example - * @details This project creates a mass storage device using either on-board RAM or - * external SPI flash memory. Load the project, connect a cable from the PC - * to the USB connector. A new external drive should appear than can be read - * and written. - */ - #include <stdio.h> #include <stddef.h> #include <stdbool.h> @@ -69,7 +24,8 @@ //#define PARTITION_END (0x10000000 + 1024 * 1024 - 1) extern void run_usbmsc(void); -DIR dir; /* Directory object */ + +DIR dir; FATFS FatFs; bool mount(void) @@ -156,7 +112,6 @@ bool is_update_needed(void) f_close(&file); - //different = true; return different; } @@ -204,30 +159,6 @@ void flash_partition(void) f_close(&file); } -#if 0 -void test(void) -{ - FRESULT res; - FIL file; - UINT readbytes; - char *filename = "card10.bin"; - int len = 512; - char data[512]; - - res=f_open(&file, filename, FA_OPEN_EXISTING|FA_READ); - if(res != FR_OK) printf("f_open error %d\n", res); - - res = f_read(&file, data, len, &readbytes); - if(res != FR_OK) printf("f_read error %d\n", res); - - f_close(&file); - - data[readbytes] = 0; - - printf("data: %s\n", data); -} -#endif - static inline void boot(const void * vtable){ SCB->VTOR = (uintptr_t) vtable; diff --git a/bootloader/mscmem.c b/bootloader/mscmem.c index 70f2429d5ce5da372316a915d972dd8dc7cb6474..a042190a11e9158feb5f202198246163069b6e11 100644 --- a/bootloader/mscmem.c +++ b/bootloader/mscmem.c @@ -1,64 +1,8 @@ -/******************************************************************************* - * Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES - * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of Maxim Integrated - * Products, Inc. shall not be used except as stated in the Maxim Integrated - * Products, Inc. Branding Policy. - * - * The mere transfer of this software does not imply any licenses - * of trade secrets, proprietary technology, copyrights, patents, - * trademarks, maskwork rights, or any other form of intellectual - * property whatsoever. Maxim Integrated Products, Inc. retains all - * ownership rights. - * - * Description: Communications Device Class ACM (Serial Port) over USB - * $Id: descriptors.h 31172 2017-10-05 19:05:57Z zach.metzinger $ - * - ******************************************************************************* - */ - -/** - * @file mscmem.h - * @brief Memory routines used by the USB Mass Storage Class example. - * See the msc_mem_t structure in msc.h for function details. - * @details Functions are provided for using the internal RAM of the - * device or the external SPI flash memory. Use the SPIXF_DISK - * and RAM_DISK defines to select the desired memory at compile - * time. - */ - #include "mscmem.h" #include <string.h> #include <stdio.h> #include "mx25lba.h" -/***** Definitions *****/ - -/***** Global Data *****/ - -/***** File Scope Variables *****/ - -//static int initialized = 0; -//static int running = 0; - /******************************************************************************/ int mscmem_init() { diff --git a/bootloader/mscmem.h b/bootloader/mscmem.h index 681e95e5d740092116c1362be227cfe14d8b57be..9d4a6e943ecf5614c16e2ea4626d19baf34a23ef 100644 --- a/bootloader/mscmem.h +++ b/bootloader/mscmem.h @@ -34,21 +34,18 @@ * ******************************************************************************* */ - + /** * @file mscmem.h - * @brief Memory routines used by the USB Mass Storage Class example. + * @brief Memory routines used by the USB Mass Storage Class example. * See the msc_mem_t structure in msc.h for function details. */ - + #ifndef __MSC_MEM_H__ #define __MSC_MEM_H__ #include <stdint.h> -#define ERASE_MEMORY_ON_INIT 1 /* Configuration option to clear the memory (to 0s) on initialization. */ - /* Use 1 to clear or 0 to leave untouched. */ - int mscmem_init(void); int mscmem_start(void); int mscmem_stop(void);