diff --git a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/ALIENTEK_Aploo_STM32F767/TencentOS_tiny.sct b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/ALIENTEK_Aploo_STM32F767/TencentOS_tiny.sct
deleted file mode 100644
index 31c4ac5a..00000000
--- a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/ALIENTEK_Aploo_STM32F767/TencentOS_tiny.sct
+++ /dev/null
@@ -1,16 +0,0 @@
-; *************************************************************
-; *** Scatter-Loading Description File generated by uVision ***
-; *************************************************************
-
-LR_IROM1 0x08000000 0x00100000 { ; load region size_region
- ER_IROM1 0x08000000 0x00100000 { ; load address = execution address
- *.o (RESET, +First)
- *(InRoot$$Sections)
- .ANY (+RO)
- .ANY (+XO)
- }
- RW_IRAM1 0x20000000 0x00080000 { ; RW data
- .ANY (+RW +ZI)
- }
-}
-
diff --git a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/DebugConfig/TencentOS_tiny_STM32F767IGTx_2.0.0.dbgconf b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/DebugConfig/TencentOS_tiny_STM32F767IGTx_2.0.0.dbgconf
deleted file mode 100644
index 5cba73ae..00000000
--- a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/DebugConfig/TencentOS_tiny_STM32F767IGTx_2.0.0.dbgconf
+++ /dev/null
@@ -1,77 +0,0 @@
-// File: STM32F76x_77x.dbgconf
-// Version: 1.0.0
-// Note: refer to STM32F76xxx STM32F77xxx reference manual (RM0410)
-// refer to STM32F76xxx STM32F77xxx datasheets
-
-// <<< Use Configuration Wizard in Context Menu >>>
-
-// Debug MCU configuration register (DBGMCU_CR)
-// DBG_STANDBY Debug standby mode
-// DBG_STOP Debug stop mode
-// DBG_SLEEP Debug sleep mode
-//
-DbgMCU_CR = 0x00000007;
-
-// Debug MCU APB1 freeze register (DBGMCU_APB1_FZ)
-// Reserved bits must be kept at reset value
-// DBG_CAN2_STOP Debug CAN2 stopped when core is halted
-// DBG_CAN1_STOP Debug CAN1 stopped when core is halted
-// DBG_I2C4_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted
-// DBG_I2C3_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted
-// DBG_I2C2_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted
-// DBG_I2C1_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted
-// DBG_CAN3_STOP Debug CAN3 stopped when core is halted
-// DBG_IWDG_STOP Debug independent watchdog stopped when core is halted
-// DBG_WWDG_STOP Debug window watchdog stopped when core is halted
-// DBG_RTC_STOP RTC stopped when core is halted
-// DBG_LPTIM1_STOP LPTMI1 counter stopped when core is halted
-// DBG_TIM14_STOP TIM14 counter stopped when core is halted
-// DBG_TIM13_STOP TIM13 counter stopped when core is halted
-// DBG_TIM12_STOP TIM12 counter stopped when core is halted
-// DBG_TIM7_STOP TIM7 counter stopped when core is halted
-// DBG_TIM6_STOP TIM6 counter stopped when core is halted
-// DBG_TIM5_STOP TIM5 counter stopped when core is halted
-// DBG_TIM4_STOP TIM4 counter stopped when core is halted
-// DBG_TIM3_STOP TIM3 counter stopped when core is halted
-// DBG_TIM2_STOP TIM2 counter stopped when core is halted
-//
-DbgMCU_APB1_Fz = 0x00000000;
-
-// Debug MCU APB2 freeze register (DBGMCU_APB2_FZ)
-// Reserved bits must be kept at reset value
-// DBG_TIM11_STOP TIM11 counter stopped when core is halted
-// DBG_TIM10_STOP TIM10 counter stopped when core is halted
-// DBG_TIM9_STOP TIM9 counter stopped when core is halted
-// DBG_TIM8_STOP TIM8 counter stopped when core is halted
-// DBG_TIM1_STOP TIM1 counter stopped when core is halted
-//
-DbgMCU_APB2_Fz = 0x00000000;
-
-// TPIU Pin Routing (TRACECLK fixed on Pin PE2)
-// TRACECLK: Pin PE2
-// TRACED0
-// ETM Trace Data 0
-// <0x00040003=> Pin PE3
-// <0x00020001=> Pin PC1
-// <0x0006000D=> Pin PG13
-// TRACED1
-// ETM Trace Data 1
-// <0x00040004=> Pin PE4
-// <0x00020008=> Pin PC8
-// <0x0006000E=> Pin PG14
-// TRACED2
-// ETM Trace Data 2
-// <0x00040005=> Pin PE5
-// <0x00030002=> Pin PD2
-// TRACED3
-// ETM Trace Data 3
-// <0x00040006=> Pin PE6
-// <0x0002000C=> Pin PC12
-//
-TraceClk_Pin = 0x00040002;
-TraceD0_Pin = 0x00040003;
-TraceD1_Pin = 0x00040004;
-TraceD2_Pin = 0x00040005;
-TraceD3_Pin = 0x00040006;
-
-// <<< end of configuration section >>>
diff --git a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/RTE/_TencentOS_tiny/RTE_Components.h b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/RTE/_TencentOS_tiny/RTE_Components.h
deleted file mode 100644
index 7b1f3fc8..00000000
--- a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/RTE/_TencentOS_tiny/RTE_Components.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-/*
- * Auto generated Run-Time-Environment Component Configuration File
- * *** Do not modify ! ***
- *
- * Project: 'TencentOS_tiny'
- * Target: 'TencentOS_tiny'
- */
-
-#ifndef RTE_COMPONENTS_H
-#define RTE_COMPONENTS_H
-
-
-/*
- * Define the Device Header File:
- */
-#define CMSIS_device_header "stm32f7xx.h"
-
-
-#endif /* RTE_COMPONENTS_H */
diff --git a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/TencentOS_tiny.uvoptx b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/TencentOS_tiny.uvoptx
index 8ce2ba4d..2cc21915 100644
--- a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/TencentOS_tiny.uvoptx
+++ b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/TencentOS_tiny.uvoptx
@@ -154,7 +154,7 @@
0
14
1
-
134233172
+ 134233412
0
0
0
@@ -168,18 +168,18 @@
1
0
- 3229
+ 15
1
- 134242152
+ 134233424
0
0
0
0
0
1
- ..\..\..\..\components\fs\fatfs\3rdparty\ff.c
+ ..\..\..\..\examples\fatfs\fatfs_sample.c
- \\TencentOS_tiny\../../../../components/fs/fatfs/3rdparty/ff.c\3229
+ \\TencentOS_tiny\../../../../examples/fatfs/fatfs_sample.c\15
@@ -1063,7 +1063,7 @@
0
0
0
- ..\..\..\..\platform\hal\st\stm32f7xx\tos_hal_sd.c
+ ..\..\..\..\platform\hal\st\stm32f7xx\src\tos_hal_sd.c
tos_hal_sd.c
0
0
diff --git a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/TencentOS_tiny.uvprojx b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/TencentOS_tiny.uvprojx
index 24f0ca08..6b0d1d4b 100644
--- a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/TencentOS_tiny.uvprojx
+++ b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs/TencentOS_tiny.uvprojx
@@ -735,7 +735,7 @@
tos_hal_sd.c
1
- ..\..\..\..\platform\hal\st\stm32f7xx\tos_hal_sd.c
+ ..\..\..\..\platform\hal\st\stm32f7xx\src\tos_hal_sd.c
diff --git a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/ALIENTEK_Aploo_STM32F767/TencentOS_tiny.sct b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/ALIENTEK_Aploo_STM32F767/TencentOS_tiny.sct
deleted file mode 100644
index 31c4ac5a..00000000
--- a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/ALIENTEK_Aploo_STM32F767/TencentOS_tiny.sct
+++ /dev/null
@@ -1,16 +0,0 @@
-; *************************************************************
-; *** Scatter-Loading Description File generated by uVision ***
-; *************************************************************
-
-LR_IROM1 0x08000000 0x00100000 { ; load region size_region
- ER_IROM1 0x08000000 0x00100000 { ; load address = execution address
- *.o (RESET, +First)
- *(InRoot$$Sections)
- .ANY (+RO)
- .ANY (+XO)
- }
- RW_IRAM1 0x20000000 0x00080000 { ; RW data
- .ANY (+RW +ZI)
- }
-}
-
diff --git a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/DebugConfig/TencentOS_tiny_STM32F767IGTx_2.0.0.dbgconf b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/DebugConfig/TencentOS_tiny_STM32F767IGTx_2.0.0.dbgconf
deleted file mode 100644
index 5cba73ae..00000000
--- a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/DebugConfig/TencentOS_tiny_STM32F767IGTx_2.0.0.dbgconf
+++ /dev/null
@@ -1,77 +0,0 @@
-// File: STM32F76x_77x.dbgconf
-// Version: 1.0.0
-// Note: refer to STM32F76xxx STM32F77xxx reference manual (RM0410)
-// refer to STM32F76xxx STM32F77xxx datasheets
-
-// <<< Use Configuration Wizard in Context Menu >>>
-
-// Debug MCU configuration register (DBGMCU_CR)
-// DBG_STANDBY Debug standby mode
-// DBG_STOP Debug stop mode
-// DBG_SLEEP Debug sleep mode
-//
-DbgMCU_CR = 0x00000007;
-
-// Debug MCU APB1 freeze register (DBGMCU_APB1_FZ)
-// Reserved bits must be kept at reset value
-// DBG_CAN2_STOP Debug CAN2 stopped when core is halted
-// DBG_CAN1_STOP Debug CAN1 stopped when core is halted
-// DBG_I2C4_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted
-// DBG_I2C3_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted
-// DBG_I2C2_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted
-// DBG_I2C1_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted
-// DBG_CAN3_STOP Debug CAN3 stopped when core is halted
-// DBG_IWDG_STOP Debug independent watchdog stopped when core is halted
-// DBG_WWDG_STOP Debug window watchdog stopped when core is halted
-// DBG_RTC_STOP RTC stopped when core is halted
-// DBG_LPTIM1_STOP LPTMI1 counter stopped when core is halted
-// DBG_TIM14_STOP TIM14 counter stopped when core is halted
-// DBG_TIM13_STOP TIM13 counter stopped when core is halted
-// DBG_TIM12_STOP TIM12 counter stopped when core is halted
-// DBG_TIM7_STOP TIM7 counter stopped when core is halted
-// DBG_TIM6_STOP TIM6 counter stopped when core is halted
-// DBG_TIM5_STOP TIM5 counter stopped when core is halted
-// DBG_TIM4_STOP TIM4 counter stopped when core is halted
-// DBG_TIM3_STOP TIM3 counter stopped when core is halted
-// DBG_TIM2_STOP TIM2 counter stopped when core is halted
-//
-DbgMCU_APB1_Fz = 0x00000000;
-
-// Debug MCU APB2 freeze register (DBGMCU_APB2_FZ)
-// Reserved bits must be kept at reset value
-// DBG_TIM11_STOP TIM11 counter stopped when core is halted
-// DBG_TIM10_STOP TIM10 counter stopped when core is halted
-// DBG_TIM9_STOP TIM9 counter stopped when core is halted
-// DBG_TIM8_STOP TIM8 counter stopped when core is halted
-// DBG_TIM1_STOP TIM1 counter stopped when core is halted
-//
-DbgMCU_APB2_Fz = 0x00000000;
-
-// TPIU Pin Routing (TRACECLK fixed on Pin PE2)
-// TRACECLK: Pin PE2
-// TRACED0
-// ETM Trace Data 0
-// <0x00040003=> Pin PE3
-// <0x00020001=> Pin PC1
-// <0x0006000D=> Pin PG13
-// TRACED1
-// ETM Trace Data 1
-// <0x00040004=> Pin PE4
-// <0x00020008=> Pin PC8
-// <0x0006000E=> Pin PG14
-// TRACED2
-// ETM Trace Data 2
-// <0x00040005=> Pin PE5
-// <0x00030002=> Pin PD2
-// TRACED3
-// ETM Trace Data 3
-// <0x00040006=> Pin PE6
-// <0x0002000C=> Pin PC12
-//
-TraceClk_Pin = 0x00040002;
-TraceD0_Pin = 0x00040003;
-TraceD1_Pin = 0x00040004;
-TraceD2_Pin = 0x00040005;
-TraceD3_Pin = 0x00040006;
-
-// <<< end of configuration section >>>
diff --git a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/RTE/_TencentOS_tiny/RTE_Components.h b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/RTE/_TencentOS_tiny/RTE_Components.h
deleted file mode 100644
index 7b1f3fc8..00000000
--- a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/RTE/_TencentOS_tiny/RTE_Components.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-/*
- * Auto generated Run-Time-Environment Component Configuration File
- * *** Do not modify ! ***
- *
- * Project: 'TencentOS_tiny'
- * Target: 'TencentOS_tiny'
- */
-
-#ifndef RTE_COMPONENTS_H
-#define RTE_COMPONENTS_H
-
-
-/*
- * Define the Device Header File:
- */
-#define CMSIS_device_header "stm32f7xx.h"
-
-
-#endif /* RTE_COMPONENTS_H */
diff --git a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/TencentOS_tiny.uvoptx b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/TencentOS_tiny.uvoptx
index ecf5cc2a..3c6c71ef 100644
--- a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/TencentOS_tiny.uvoptx
+++ b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/TencentOS_tiny.uvoptx
@@ -1063,7 +1063,7 @@
0
0
0
- ..\..\..\..\platform\hal\st\stm32f7xx\tos_hal_sd.c
+ ..\..\..\..\platform\hal\st\stm32f7xx\src\tos_hal_sd.c
tos_hal_sd.c
0
0
diff --git a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/TencentOS_tiny.uvprojx b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/TencentOS_tiny.uvprojx
index c23b5c13..f9611af7 100644
--- a/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/TencentOS_tiny.uvprojx
+++ b/board/ALIENTEK_Apollo_STM32F767/KEIL/fatfs_through_vfs/TencentOS_tiny.uvprojx
@@ -735,7 +735,7 @@
tos_hal_sd.c
1
- ..\..\..\..\platform\hal\st\stm32f7xx\tos_hal_sd.c
+ ..\..\..\..\platform\hal\st\stm32f7xx\src\tos_hal_sd.c
diff --git a/platform/hal/st/stm32f4xx/src/tos_hal_sd.c b/platform/hal/st/stm32f4xx/src/tos_hal_sd.c
index eb954101..038b90f9 100644
--- a/platform/hal/st/stm32f4xx/src/tos_hal_sd.c
+++ b/platform/hal/st/stm32f4xx/src/tos_hal_sd.c
@@ -28,7 +28,7 @@ __API__ int tos_hal_sd_read(hal_sd_t *sd, uint8_t *buf, uint32_t blk_addr, uint3
}
sd_handle = sd->private_sd;
- hal_status = HAL_SD_ReadBlocks(sd_handle, buf, blk_addr, blk_num, timeout);
+ hal_status = HAL_SD_ReadBlocks(sd_handle, buf, blk_addr / 0x200, blk_num, timeout);
if (hal_status != HAL_OK) {
return -1;
}
@@ -53,7 +53,7 @@ __API__ int tos_hal_sd_write(hal_sd_t *sd, const uint8_t *buf, uint32_t blk_addr
}
sd_handle = sd->private_sd;
- hal_status = HAL_SD_WriteBlocks(sd_handle, (uint8_t *)buf, blk_addr, blk_num, timeout);
+ hal_status = HAL_SD_WriteBlocks(sd_handle, (uint8_t *)buf, blk_addr / 0x200, blk_num, timeout);
if (hal_status != HAL_OK) {
return -1;
}
@@ -78,7 +78,7 @@ __API__ int tos_hal_sd_read_dma(hal_sd_t *sd, uint8_t *buf, uint32_t blk_addr, u
}
sd_handle = sd->private_sd;
- hal_status = HAL_SD_ReadBlocks_DMA(sd_handle, buf, blk_addr, blk_num);
+ hal_status = HAL_SD_ReadBlocks_DMA(sd_handle, buf, blk_addr / 0x200, blk_num);
if (hal_status != HAL_OK) {
return -1;
}
@@ -99,7 +99,7 @@ __API__ int tos_hal_sd_write_dma(hal_sd_t *sd, const uint8_t *buf, uint32_t blk_
}
sd_handle = sd->private_sd;
- hal_status = HAL_SD_WriteBlocks_DMA(sd_handle, (uint8_t *)buf, blk_addr, blk_num);
+ hal_status = HAL_SD_WriteBlocks_DMA(sd_handle, (uint8_t *)buf, blk_addr / 0x200, blk_num);
if (hal_status != HAL_OK) {
return -1;
}
@@ -116,7 +116,7 @@ __API__ int tos_hal_sd_erase(hal_sd_t *sd, uint32_t blk_add_start, uint32_t blk_
}
sd_handle = sd->private_sd;
- hal_status = HAL_SD_Erase(sd_handle, blk_add_start, blk_addr_end);
+ hal_status = HAL_SD_Erase(sd_handle, blk_add_start / 0x200, blk_addr_end / 0x200);
if (hal_status != HAL_OK) {
return -1;
}
diff --git a/platform/hal/st/stm32f7xx/tos_hal_sd.c b/platform/hal/st/stm32f7xx/src/tos_hal_sd.c
similarity index 93%
rename from platform/hal/st/stm32f7xx/tos_hal_sd.c
rename to platform/hal/st/stm32f7xx/src/tos_hal_sd.c
index e925bfba..c2a9bd6b 100644
--- a/platform/hal/st/stm32f7xx/tos_hal_sd.c
+++ b/platform/hal/st/stm32f7xx/src/tos_hal_sd.c
@@ -28,7 +28,7 @@ __API__ int tos_hal_sd_read(hal_sd_t *sd, uint8_t *buf, uint32_t blk_addr, uint3
}
sd_handle = sd->private_sd;
- hal_status = HAL_SD_ReadBlocks(sd_handle, buf, blk_addr, blk_num, timeout);
+ hal_status = HAL_SD_ReadBlocks(sd_handle, buf, blk_addr / 0x200, blk_num, timeout);
if (hal_status != HAL_OK) {
return -1;
}
@@ -53,7 +53,7 @@ __API__ int tos_hal_sd_write(hal_sd_t *sd, const uint8_t *buf, uint32_t blk_addr
}
sd_handle = sd->private_sd;
- hal_status = HAL_SD_WriteBlocks(sd_handle, (uint8_t *)buf, blk_addr, blk_num, timeout);
+ hal_status = HAL_SD_WriteBlocks(sd_handle, (uint8_t *)buf, blk_addr / 0x200, blk_num, timeout);
if (hal_status != HAL_OK) {
return -1;
}
@@ -78,7 +78,7 @@ __API__ int tos_hal_sd_read_dma(hal_sd_t *sd, uint8_t *buf, uint32_t blk_addr, u
}
sd_handle = sd->private_sd;
- hal_status = HAL_SD_ReadBlocks_DMA(sd_handle, buf, blk_addr, blk_num);
+ hal_status = HAL_SD_ReadBlocks_DMA(sd_handle, buf, blk_addr / 0x200, blk_num);
if (hal_status != HAL_OK) {
return -1;
}
@@ -99,7 +99,7 @@ __API__ int tos_hal_sd_write_dma(hal_sd_t *sd, const uint8_t *buf, uint32_t blk_
}
sd_handle = sd->private_sd;
- hal_status = HAL_SD_WriteBlocks_DMA(sd_handle, (uint8_t *)buf, blk_addr, blk_num);
+ hal_status = HAL_SD_WriteBlocks_DMA(sd_handle, (uint8_t *)buf, blk_addr / 0x200, blk_num);
if (hal_status != HAL_OK) {
return -1;
}
@@ -116,7 +116,7 @@ __API__ int tos_hal_sd_erase(hal_sd_t *sd, uint32_t blk_add_start, uint32_t blk_
}
sd_handle = sd->private_sd;
- hal_status = HAL_SD_Erase(sd_handle, blk_add_start, blk_addr_end);
+ hal_status = HAL_SD_Erase(sd_handle, blk_add_start / 0x200, blk_addr_end / 0x200);
if (hal_status != HAL_OK) {
return -1;
}