Comments and some minor fixes.
authorgkostka <kostka.grzegorz@gmail.com>
Sun, 12 Jan 2014 17:20:19 +0000 (17:20 +0000)
committergkostka <kostka.grzegorz@gmail.com>
Sun, 12 Jan 2014 17:20:19 +0000 (17:20 +0000)
demos/stm32f429_disco/config.h
demos/stm32f429_disco/hw_init.c
demos/stm32f429_disco/hw_init.h
demos/stm32f429_disco/main.c
demos/stm32f429_disco/pll.c
demos/stm32f429_disco/pll.h
demos/stm32f429_disco/syscalls.c
demos/stm32f429_disco/usb_msc_lwext4.c
toolchain/cortex-m4.cmake

index f6141c91679026a439fd6e20efcad4dd099ab172..4ad3f19456bfb20a469a93e49466ba808abfa386 100644 (file)
@@ -1,26 +1,42 @@
-/**\r
- * @file    main.c\r
- * @version 0.01\r
- * @date    Jan 2, 2014\r
- * @author  Grzegorz Kostka, kostka.grzegorz@gmail.com\r
- * @brief   ...\r
+/*\r
+ * Copyright (c) 2013 Grzegorz Kostka (kostka.grzegorz@gmail.com)\r
+ * All rights reserved.\r
  *\r
- * @note\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
  *\r
- * @addtogroup group\r
- * @{\r
- *      @addtogroup subgroup\r
- *      @{\r
- **********************************************************/\r
+ * - Redistributions of source code must retain the above copyright\r
+ *   notice, this list of conditions and the following disclaimer.\r
+ * - Redistributions in binary form must reproduce the above copyright\r
+ *   notice, this list of conditions and the following disclaimer in the\r
+ *   documentation and/or other materials provided with the distribution.\r
+ * - The name of the author may not be used to endorse or promote products\r
+ *   derived from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
 \r
 #ifndef CONFIG_H_\r
 #define CONFIG_H_\r
 \r
+\r
 /**@brief   Main clock frequency.*/\r
 #define CFG_CCLK_FREQ       168000000ul\r
 \r
+/**@brief   EXT partition block size (only when static cache on)*/\r
+#define EXT_LOGICAL_BLOCK_SIZE (1024 * 4)\r
+\r
+\r
 #endif /* CONFIG_H_ */\r
 \r
 \r
-/**     @} (end addtogroup subgroup)    */\r
-/** @} (end addtogroup group)           */\r
index 9f0ff97c5b7b2401e335423189c4e4cadc601294..e42cd1b6ea5fe2dec8f70e64c6345c1ef7e3c0ad 100644 (file)
@@ -1,17 +1,30 @@
-/**\r
- * @file    hw_init.c\r
- * @version 0.01\r
- * @date    Oct 2, 2012\r
- * @author  Grzegorz Kostka, kostka.grzegorz@gmail.com\r
- * @brief   ...\r
+/*\r
+ * Copyright (c) 2013 Grzegorz Kostka (kostka.grzegorz@gmail.com)\r
+ * All rights reserved.\r
  *\r
- * @note\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
  *\r
- * @addtogroup group\r
- * @{\r
- *      @addtogroup subgroup\r
- *      @{\r
- **********************************************************/\r
+ * - Redistributions of source code must retain the above copyright\r
+ *   notice, this list of conditions and the following disclaimer.\r
+ * - Redistributions in binary form must reproduce the above copyright\r
+ *   notice, this list of conditions and the following disclaimer in the\r
+ *   documentation and/or other materials provided with the distribution.\r
+ * - The name of the author may not be used to endorse or promote products\r
+ *   derived from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
 \r
 #include <config.h>\r
 #include <stm32f4xx.h>\r
@@ -62,7 +75,7 @@ void hw_init(void)
     LCD_SetLayer(LCD_FOREGROUND_LAYER);\r
     LCD_LOG_Init();\r
 \r
-    LCD_LOG_SetHeader((uint8_t *)"LWEXT4 DEMO");\r
+    LCD_LOG_SetHeader((uint8_t *)"STM32 LWEXT4 DEMO");\r
 }\r
 \r
 void hw_usb_process(void)\r
@@ -94,3 +107,11 @@ uint32_t hw_get_ms(void)
 {\r
     return _systick_;\r
 }\r
+\r
+void hw_wait_ms(uint32_t ms)\r
+{\r
+    volatile uint32_t t = _systick_;\r
+\r
+    while((t + ms) > _systick_)\r
+        ;\r
+}\r
index 6b7890c7979ad75869952bf9f5c623bc31ad6e26..11e5d91f9438462b7df2988b3f3f772167059c77 100644 (file)
@@ -1,17 +1,31 @@
-/**\r
- * @file    hw_init.h\r
- * @version 0.01\r
- * @date    Oct 2, 2012\r
- * @author  Grzegorz Kostka, kostka.grzegorz@gmail.com\r
- * @brief   ...\r
+/*\r
+ * Copyright (c) 2013 Grzegorz Kostka (kostka.grzegorz@gmail.com)\r
+ * All rights reserved.\r
  *\r
- * @note\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
  *\r
- * @addtogroup group\r
- * @{\r
- *      @addtogroup subgroup\r
- *      @{\r
- **********************************************************/\r
+ * - Redistributions of source code must retain the above copyright\r
+ *   notice, this list of conditions and the following disclaimer.\r
+ * - Redistributions in binary form must reproduce the above copyright\r
+ *   notice, this list of conditions and the following disclaimer in the\r
+ *   documentation and/or other materials provided with the distribution.\r
+ * - The name of the author may not be used to endorse or promote products\r
+ *   derived from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
 \r
 #ifndef HW_INIT_H_\r
 #define HW_INIT_H_\r
@@ -27,6 +41,8 @@ bool hw_usb_enum_done(void);
 \r
 void hw_led_red(bool on);\r
 void hw_led_green(bool on);\r
+\r
 uint32_t hw_get_ms(void);\r
+void hw_wait_ms(uint32_t ms);\r
 \r
 #endif /* HW_INIT_H_ */\r
index d2f1b0752e80098d15ccab82548df277a65e93e3..f72ef04e411a02ba30eca4e93248b4e3672ef145 100644 (file)
 #include <usb_msc_lwext4.h>\r
 #include <ext4.h>\r
 \r
-/**@brief   Input stream name.*/\r
-char input_name[128] = "ext2";\r
-\r
 /**@brief   Read-write size*/\r
 #define READ_WRITE_SZIZE 1024 * 8\r
 \r
+/**@brief   Delay test (slower LCD scroll)*/\r
+#define TEST_DELAY_MS    2000\r
+\r
+/**@brief   Input stream name.*/\r
+char input_name[128] = "ext2";\r
+\r
 /**@brief   Read-write size*/\r
 static int rw_szie  = READ_WRITE_SZIZE;\r
 \r
 /**@brief   Read-write size*/\r
-static int rw_count = 1000;\r
+static int rw_count = 100;\r
 \r
 /**@brief   Directory test count*/\r
 static int dir_cnt  = 10;\r
@@ -346,7 +349,7 @@ static void cleanup(void)
 \r
 \r
     printf("cleanup: remove /mp/dir1\n");\r
-    start =get_ms();\r
+    start = get_ms();\r
     ext4_dir_rm("/mp/dir1");\r
     stop = get_ms();\r
     diff = stop - start;\r
@@ -423,48 +426,56 @@ int main(void)
     printf("RW count: %d\n", rw_count);\r
     printf("Cache mode: %s\n", cache_mode ? "dynamic" : "static");\r
 \r
+\r
+    hw_wait_ms(TEST_DELAY_MS);\r
     if(!mount())\r
         return EXIT_FAILURE;\r
 \r
-\r
     cleanup();\r
 \r
-    if(sbstat)\r
+    if(sbstat){\r
+        hw_wait_ms(TEST_DELAY_MS);\r
         mp_stats();\r
+    }\r
 \r
+    hw_wait_ms(TEST_DELAY_MS);\r
     dir_ls("/mp/");\r
     if(!dir_test(dir_cnt))\r
         return EXIT_FAILURE;\r
 \r
+    hw_wait_ms(TEST_DELAY_MS);\r
     if(!file_test())\r
         return EXIT_FAILURE;\r
 \r
     dir_ls("/mp/");\r
 \r
-    if(sbstat)\r
+    if(sbstat){\r
+        hw_wait_ms(TEST_DELAY_MS);\r
         mp_stats();\r
+    }\r
 \r
-    if(cleanup_flag)\r
+    if(cleanup_flag){\r
+        hw_wait_ms(TEST_DELAY_MS);\r
         cleanup();\r
+    }\r
 \r
-    if(bstat)\r
+    if(bstat){\r
+        hw_wait_ms(TEST_DELAY_MS);\r
         block_stats();\r
+    }\r
 \r
     if(!umount())\r
         return EXIT_FAILURE;\r
 \r
-    printf("Test finish: OK\n");\r
+    printf("\nTest finished: OK\n");\r
     printf("Press RESET to restart\n");\r
-    while (1)\r
-    {\r
-        volatile int count;\r
-        for (count = 0; count < 1000000; count++);\r
+\r
+    while (1) {\r
+        hw_wait_ms(500);\r
         hw_led_green(1);\r
-        for (count = 0; count < 1000000; count++);\r
+        hw_wait_ms(500);\r
         hw_led_green(0);\r
 \r
     }\r
 }\r
 \r
-/**     @} (end addtogroup subgroup)    */\r
-/** @} (end addtogroup group)           */\r
index 9f15632d79fb3995ee277f253234b230d00302ed..ec67ffa6a3781d46f753771fe0a761274881141c 100644 (file)
@@ -1,17 +1,31 @@
-/**\r
- * @file       pll.c\r
- * @version 0.01\r
- * @date       Oct 2, 2012\r
- * @author     Grzegorz Kostka, kostka.grzegorz@gmail.com\r
- * @brief      ...\r
+/*\r
+ * Copyright (c) 2013 Grzegorz Kostka (kostka.grzegorz@gmail.com)\r
+ * All rights reserved.\r
  *\r
- * @note\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
  *\r
- * @addtogroup group\r
- * @{\r
- *             @addtogroup subgroup\r
- *             @{\r
- **********************************************************/\r
+ * - Redistributions of source code must retain the above copyright\r
+ *   notice, this list of conditions and the following disclaimer.\r
+ * - Redistributions in binary form must reproduce the above copyright\r
+ *   notice, this list of conditions and the following disclaimer in the\r
+ *   documentation and/or other materials provided with the distribution.\r
+ * - The name of the author may not be used to endorse or promote products\r
+ *   derived from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
 #include <config.h>\r
 #include <pll.h>\r
 \r
@@ -112,10 +126,3 @@ void pll_init(void)
        while (((RCC->CFGR) & RCC_CFGR_SWS) != RCC_CFGR_SWS_PLL)\r
                ;\r
 }\r
-\r
-\r
-/**    @} (end addtogroup subgroup)    */\r
-/** @} (end addtogroup group)                  */\r
-\r
-\r
-\r
index d8c7bb07b955985dc2ad229ff99e61e1ab3d4938..d77f58065d9725a00317fe7b302791604a6644f4 100644 (file)
@@ -1,31 +1,39 @@
-/**\r
- * @file       pll.h\r
- * @version 0.01\r
- * @date       Oct 2, 2012\r
- * @author     Grzegorz Kostka, kostka.grzegorz@gmail.com\r
- * @brief      ...\r
+/*\r
+ * Copyright (c) 2013 Grzegorz Kostka (kostka.grzegorz@gmail.com)\r
+ * All rights reserved.\r
  *\r
- * @note\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
  *\r
- * @addtogroup group\r
- * @{\r
- *             @addtogroup subgroup\r
- *             @{\r
- **********************************************************/\r
+ * - Redistributions of source code must retain the above copyright\r
+ *   notice, this list of conditions and the following disclaimer.\r
+ * - Redistributions in binary form must reproduce the above copyright\r
+ *   notice, this list of conditions and the following disclaimer in the\r
+ *   documentation and/or other materials provided with the distribution.\r
+ * - The name of the author may not be used to endorse or promote products\r
+ *   derived from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
 \r
 #ifndef PLL_H_\r
 #define PLL_H_\r
 \r
 #include <config.h>\r
 \r
-\r
 /**@brief      Clock initialization.*/\r
 void pll_init(void);\r
 \r
-\r
-\r
-\r
 #endif /* PLL_H_ */\r
 \r
-/**    @} (end addtogroup subgroup)    */\r
-/** @} (end addtogroup group)                  */\r
index 38c684f8b292690879043d3ee78292cf6e6c8f9d..40aee0c90b03dd3f2e1e33edfac5e1c358b7b9cb 100644 (file)
@@ -1,3 +1,30 @@
+/*\r
+ * Copyright (c) 2013 Grzegorz Kostka (kostka.grzegorz@gmail.com)\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ *\r
+ * - Redistributions of source code must retain the above copyright\r
+ *   notice, this list of conditions and the following disclaimer.\r
+ * - Redistributions in binary form must reproduce the above copyright\r
+ *   notice, this list of conditions and the following disclaimer in the\r
+ *   documentation and/or other materials provided with the distribution.\r
+ * - The name of the author may not be used to endorse or promote products\r
+ *   derived from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
 \r
 #include <sys/stat.h>\r
 #include <stdlib.h>\r
index 181ff63b2c528c01111fd667babf3c3c4fee7561..a897a18abbcd8c56876f7273667d7112055013eb 100644 (file)
@@ -1,3 +1,30 @@
+/*\r
+ * Copyright (c) 2013 Grzegorz Kostka (kostka.grzegorz@gmail.com)\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ *\r
+ * - Redistributions of source code must retain the above copyright\r
+ *   notice, this list of conditions and the following disclaimer.\r
+ * - Redistributions in binary form must reproduce the above copyright\r
+ *   notice, this list of conditions and the following disclaimer in the\r
+ *   documentation and/or other materials provided with the distribution.\r
+ * - The name of the author may not be used to endorse or promote products\r
+ *   derived from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
 \r
 #include <ext4_config.h>\r
 #include <ext4_blockdev.h>\r
 #include <usbh_msc_core.h>\r
 #include <usbh_usr.h>\r
 \r
-\r
 /**@brief   Block size.*/\r
 #define USB_MSC_BLOCK_SIZE          512\r
 \r
-extern USB_OTG_CORE_HANDLE          USB_OTG_Core;\r
-extern USBH_HOST                    USB_Host;\r
-\r
 /**@brief   MBR_block ID*/\r
 #define MBR_BLOCK_ID                0\r
 #define MBR_PART_TABLE_OFF          446\r
 \r
+extern USB_OTG_CORE_HANDLE          USB_OTG_Core;\r
+extern USBH_HOST                    USB_Host;\r
+\r
 struct part_tab_entry {\r
     uint8_t  status;\r
     uint8_t  chs1[3];\r
@@ -55,7 +81,7 @@ EXT4_BLOCKDEV_STATIC_INSTANCE(
 );\r
 \r
 /******************************************************************************/\r
-EXT4_BCACHE_STATIC_INSTANCE(_usb_msc_cache, CONFIG_BLOCK_DEV_CACHE_SIZE, 1024);\r
+EXT4_BCACHE_STATIC_INSTANCE(_usb_msc_cache, CONFIG_BLOCK_DEV_CACHE_SIZE, EXT_LOGICAL_BLOCK_SIZE);\r
 \r
 /******************************************************************************/\r
 \r
index d4c8d7fef3c3a658392dd61eb915a615c3a2ac27..c4b097a8810687b4aa138c9e9340a6947af2198f 100644 (file)
@@ -18,8 +18,8 @@ set(CMAKE_EXE_LINKER_FLAGS "-nostartfiles -Wl,--gc-sections -mthumb -mcpu=cortex
 \r
 \r
 \r
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -ggdb3" CACHE INTERNAL "c debug compiler flags")\r
-SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb3" CACHE INTERNAL "cxx debug compiler flags")\r
+SET(CMAKE_C_FLAGS_DEBUG "-O2 -g -ggdb3" CACHE INTERNAL "c debug compiler flags")\r
+SET(CMAKE_CXX_FLAGS_DEBUG "-O2 -g -ggdb3" CACHE INTERNAL "cxx debug compiler flags")\r
 SET(CMAKE_ASM_FLAGS_DEBUG "-g -ggdb3" CACHE INTERNAL "asm debug compiler flags")\r
 \r
 SET(CMAKE_C_FLAGS_RELEASE "-Os" CACHE INTERNAL "c release compiler flags")\r