Skip to content

Commit dfcace7

Browse files
committed
Working fatfs (ls command)
Bigger stack for default task in FreeRTOS reslove problem.
1 parent de28b37 commit dfcace7

File tree

7 files changed

+99
-484
lines changed

7 files changed

+99
-484
lines changed

.mxproject

Lines changed: 13 additions & 13 deletions
Large diffs are not rendered by default.

Inc/fatfs.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,41 @@
55
******************************************************************************
66
* This notice applies to any and all portions of this file
77
* that are not between comment pairs USER CODE BEGIN and
8-
* USER CODE END. Other portions of this file, whether
8+
* USER CODE END. Other portions of this file, whether
99
* inserted by the user or by software development tools
1010
* are owned by their respective copyright owners.
1111
*
12-
* Copyright (c) 2018 STMicroelectronics International N.V.
12+
* Copyright (c) 2018 STMicroelectronics International N.V.
1313
* All rights reserved.
1414
*
15-
* Redistribution and use in source and binary forms, with or without
15+
* Redistribution and use in source and binary forms, with or without
1616
* modification, are permitted, provided that the following conditions are met:
1717
*
18-
* 1. Redistribution of source code must retain the above copyright notice,
18+
* 1. Redistribution of source code must retain the above copyright notice,
1919
* this list of conditions and the following disclaimer.
2020
* 2. Redistributions in binary form must reproduce the above copyright notice,
2121
* this list of conditions and the following disclaimer in the documentation
2222
* and/or other materials provided with the distribution.
23-
* 3. Neither the name of STMicroelectronics nor the names of other
24-
* contributors to this software may be used to endorse or promote products
23+
* 3. Neither the name of STMicroelectronics nor the names of other
24+
* contributors to this software may be used to endorse or promote products
2525
* derived from this software without specific written permission.
26-
* 4. This software, including modifications and/or derivative works of this
26+
* 4. This software, including modifications and/or derivative works of this
2727
* software, must execute solely and exclusively on microcontroller or
2828
* microprocessor devices manufactured by or for STMicroelectronics.
29-
* 5. Redistribution and use of this software other than as permitted under
30-
* this license is void and will automatically terminate your rights under
31-
* this license.
29+
* 5. Redistribution and use of this software other than as permitted under
30+
* this license is void and will automatically terminate your rights under
31+
* this license.
3232
*
33-
* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
34-
* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
35-
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
33+
* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
34+
* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
35+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
3636
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
37-
* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
37+
* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
3838
* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
3939
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
41-
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42-
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
40+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
41+
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
4343
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
4444
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4545
*

JtagProgrammer.ioc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
ETH.IPParameters=MediaInterface,PhyAddress
33
ETH.MediaInterface=ETH_MEDIA_INTERFACE_RMII
44
ETH.PhyAddress=0
5-
FREERTOS.IPParameters=Tasks01
6-
FREERTOS.Tasks01=defaultTask,0,128,StartDefaultTask,Default,NULL
5+
FREERTOS.FootprintOK=true
6+
FREERTOS.IPParameters=Tasks01,configMINIMAL_STACK_SIZE,FootprintOK
7+
FREERTOS.Tasks01=defaultTask,0,1024,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL
8+
FREERTOS.configMINIMAL_STACK_SIZE=128
79
File.Version=6
810
KeepUserPlacement=false
911
LWIP.Version=v2.0.3_Cube
@@ -205,8 +207,9 @@ RCC.HCLKFreq_Value=120000000
205207
RCC.HSE_VALUE=8000000
206208
RCC.HSI_VALUE=16000000
207209
RCC.I2SClocksFreq_Value=192000000
208-
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LCDTFTFreq_Value,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQ,PLLQCLKFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SAI_AClocksFreq_Value,SAI_BClocksFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAIOutputFreq_Value,VCOSAIOutputFreq_ValueQ,VCOSAIOutputFreq_ValueR,VcooutputI2S,VcooutputI2SQ
210+
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LCDTFTFreq_Value,LSE_VALUE,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQ,PLLQCLKFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SAI_AClocksFreq_Value,SAI_BClocksFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAIOutputFreq_Value,VCOSAIOutputFreq_ValueQ,VCOSAIOutputFreq_ValueR,VcooutputI2S,VcooutputI2SQ
209211
RCC.LCDTFTFreq_Value=24500000
212+
RCC.LSE_VALUE=32768
210213
RCC.LSI_VALUE=32000
211214
RCC.MCO2PinFreq_Value=120000000
212215
RCC.PLLCLKFreq_Value=120000000

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##########################################################################################################################
2-
# File automatically-generated by tool: [projectgenerator] version: [2.30.0] date: [Thu Sep 20 22:32:43 CEST 2018]
2+
# File automatically-generated by tool: [projectgenerator] version: [2.30.0] date: [Sat Sep 29 11:39:00 CEST 2018]
33
##########################################################################################################################
44

55
# ------------------------------------------------
@@ -36,14 +36,11 @@ BUILD_DIR = build
3636
######################################
3737
# C sources
3838
C_SOURCES = \
39-
Src/main.c \
4039
Src/usbh_diskio.c \
4140
Src/fatfs.c \
4241
Src/freertos.c \
4342
Src/usb_host.c \
4443
Src/usbh_conf.c \
45-
Src/stm32f4xx_it.c \
46-
Src/stm32f4xx_hal_msp.c \
4744
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_eth.c \
4845
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c \
4946
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c \
@@ -83,8 +80,6 @@ Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_pipes.c \
8380
Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc.c \
8481
Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_bot.c \
8582
Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_scsi.c \
86-
Src/lwip.c \
87-
Src/ethernetif.c \
8883
Src/syscalls.c \
8984
Middlewares/Third_Party/LwIP/src/netif/ppp/auth.c \
9085
Middlewares/Third_Party/LwIP/src/netif/ppp/ccp.c \
@@ -158,7 +153,12 @@ Middlewares/Third_Party/LwIP/src/core/ipv6/dhcp6.c \
158153
Middlewares/Third_Party/LwIP/src/core/ipv6/nd6.c \
159154
Middlewares/Third_Party/LwIP/system/OS/sys_arch.c \
160155
Middlewares/Third_Party/LwIP/src/apps/mqtt/mqtt.c \
161-
Src/stm32f4xx_hal_timebase_TIM.c
156+
Src/stm32f4xx_hal_timebase_TIM.c \
157+
Src/main.c \
158+
Src/lwip.c \
159+
Src/ethernetif.c \
160+
Src/stm32f4xx_it.c \
161+
Src/stm32f4xx_hal_msp.c
162162

163163
# ASM sources
164164
ASM_SOURCES = \
@@ -217,27 +217,27 @@ AS_INCLUDES = \
217217
# C includes
218218
C_INCLUDES = \
219219
-IInc \
220-
-IDrivers/STM32F4xx_HAL_Driver/Inc \
221-
-IDrivers/STM32F4xx_HAL_Driver/Inc/Legacy \
222220
-IMiddlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F \
223221
-IMiddlewares/ST/STM32_USB_Host_Library/Core/Inc \
224222
-IMiddlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc \
225-
-IDrivers/CMSIS/Device/ST/STM32F4xx/Include \
226223
-IMiddlewares/Third_Party/FatFs/src \
227224
-IMiddlewares/Third_Party/FreeRTOS/Source/include \
228225
-IMiddlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS \
229-
-IDrivers/CMSIS/Include \
230226
-IMiddlewares/Third_Party/LwIP/src/include \
231227
-IMiddlewares/Third_Party/LwIP/system \
228+
-IDrivers/STM32F4xx_HAL_Driver/Inc \
229+
-IDrivers/STM32F4xx_HAL_Driver/Inc/Legacy \
232230
-IMiddlewares/Third_Party/LwIP/src/include/netif/ppp \
231+
-IDrivers/CMSIS/Device/ST/STM32F4xx/Include \
233232
-IMiddlewares/Third_Party/LwIP/src/include/lwip \
234233
-IMiddlewares/Third_Party/LwIP/src/include/lwip/apps \
235234
-IMiddlewares/Third_Party/LwIP/src/include/lwip/priv \
236235
-IMiddlewares/Third_Party/LwIP/src/include/lwip/prot \
237236
-IMiddlewares/Third_Party/LwIP/src/include/netif \
238237
-IMiddlewares/Third_Party/LwIP/src/include/posix \
239238
-IMiddlewares/Third_Party/LwIP/src/include/posix/sys \
240-
-IMiddlewares/Third_Party/LwIP/system/arch
239+
-IMiddlewares/Third_Party/LwIP/system/arch \
240+
-IDrivers/CMSIS/Include
241241

242242

243243
# compile gcc flags

Src/fatfs.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,41 @@
55
******************************************************************************
66
* This notice applies to any and all portions of this file
77
* that are not between comment pairs USER CODE BEGIN and
8-
* USER CODE END. Other portions of this file, whether
8+
* USER CODE END. Other portions of this file, whether
99
* inserted by the user or by software development tools
1010
* are owned by their respective copyright owners.
1111
*
12-
* Copyright (c) 2018 STMicroelectronics International N.V.
12+
* Copyright (c) 2018 STMicroelectronics International N.V.
1313
* All rights reserved.
1414
*
15-
* Redistribution and use in source and binary forms, with or without
15+
* Redistribution and use in source and binary forms, with or without
1616
* modification, are permitted, provided that the following conditions are met:
1717
*
18-
* 1. Redistribution of source code must retain the above copyright notice,
18+
* 1. Redistribution of source code must retain the above copyright notice,
1919
* this list of conditions and the following disclaimer.
2020
* 2. Redistributions in binary form must reproduce the above copyright notice,
2121
* this list of conditions and the following disclaimer in the documentation
2222
* and/or other materials provided with the distribution.
23-
* 3. Neither the name of STMicroelectronics nor the names of other
24-
* contributors to this software may be used to endorse or promote products
23+
* 3. Neither the name of STMicroelectronics nor the names of other
24+
* contributors to this software may be used to endorse or promote products
2525
* derived from this software without specific written permission.
26-
* 4. This software, including modifications and/or derivative works of this
26+
* 4. This software, including modifications and/or derivative works of this
2727
* software, must execute solely and exclusively on microcontroller or
2828
* microprocessor devices manufactured by or for STMicroelectronics.
29-
* 5. Redistribution and use of this software other than as permitted under
30-
* this license is void and will automatically terminate your rights under
31-
* this license.
29+
* 5. Redistribution and use of this software other than as permitted under
30+
* this license is void and will automatically terminate your rights under
31+
* this license.
3232
*
33-
* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
34-
* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
35-
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
33+
* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
34+
* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
35+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
3636
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
37-
* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
37+
* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
3838
* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
3939
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
41-
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42-
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
40+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
41+
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
4343
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
4444
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4545
*
@@ -55,9 +55,9 @@ FIL USBHFile; /* File object for USBH */
5555

5656
/* USER CODE BEGIN Variables */
5757

58-
/* USER CODE END Variables */
58+
/* USER CODE END Variables */
5959

60-
void MX_FATFS_Init(void)
60+
void MX_FATFS_Init(void)
6161
{
6262
/*## FatFS: Link the USBH driver ###########################*/
6363
retUSBH = FATFS_LinkDriver(&USBH_Driver, USBHPath);
@@ -68,15 +68,15 @@ void MX_FATFS_Init(void)
6868
}
6969

7070
/**
71-
* @brief Gets Time from RTC
71+
* @brief Gets Time from RTC
7272
* @param None
7373
* @retval Time in DWORD
7474
*/
7575
DWORD get_fattime(void)
7676
{
7777
/* USER CODE BEGIN get_fattime */
7878
return 0;
79-
/* USER CODE END get_fattime */
79+
/* USER CODE END get_fattime */
8080
}
8181

8282
/* USER CODE BEGIN Application */

0 commit comments

Comments
 (0)