mirror of
https://github.com/openharmony/device_board_kaihong.git
synced 2026-06-30 23:27:55 -04:00
+1
-1
@@ -23,7 +23,7 @@ device/board/kaihong
|
||||
├── figures # 插图
|
||||
├── khdvk_3566b # khdvk_3566b开发板
|
||||
├── khdvk_450a # KHDVK-450A开发板
|
||||
├── xxx # 其他开发板持续开发中
|
||||
├── xxx # 其它开发板持续开发中
|
||||
```
|
||||
|
||||
## 使用说明
|
||||
|
||||
@@ -68,8 +68,8 @@
|
||||
#define DEVICE_SDRAM_NAME EXMC_SDRAM_DEVICE0
|
||||
#define SDRAM_OFFSET_ADDRESS 0x01000000
|
||||
#define SDRAM_BLOCK_ADDRESS 0xC0000000
|
||||
#define SDRAM_READ_SIZE 1 //128 /* 最小读取字节数,所有的读取操作字节数必须是它的倍数(影响内存消耗) */
|
||||
#define SDRAM_PROG_SIZE 1 //128 /* 最小写入字节数,所有的写入操作字节数必须是它的倍数(影响内存消耗) */
|
||||
#define SDRAM_READ_SIZE 1 // 128 /* 最小读取字节数,所有的读取操作字节数必须是它的倍数(影响内存消耗)*/
|
||||
#define SDRAM_PROG_SIZE 1 // 128 /* 最小写入字节数,所有的写入操作字节数必须是它的倍数(影响内存消耗)*/
|
||||
#define SDRAM_BLOCK_COUNT 2048
|
||||
#define SDRAM_BLOCK_SIZE 256 /* 擦除块字节数,不会影响内存消耗,每个文件至少占用一个块,必须是READ_SIZE/PROG_SIZE的倍数 */
|
||||
#define SDRAM_CACHE_SIZE 128 /* 块缓存的大小,缓存越大磁盘访问越小,性能越高,必须是READ_SIZE/PROG_SIZE的倍数,且是BLOCK_SIZE的因数 */
|
||||
@@ -90,7 +90,7 @@ struct fs_cfg {
|
||||
};
|
||||
static struct fs_cfg fs[LOSCFG_LFS_MAX_MOUNT_SIZE] = {0};
|
||||
|
||||
static struct PartitionCfg part_cfg[LOSCFG_LFS_MAX_MOUNT_SIZE] ={
|
||||
static struct PartitionCfg part_cfg[LOSCFG_LFS_MAX_MOUNT_SIZE] = {
|
||||
{
|
||||
.readFunc = NULL,
|
||||
.writeFunc = NULL,
|
||||
@@ -157,7 +157,8 @@ int littlefs_block_read(const struct lfs_config *c, lfs_block_t block, lfs_off_t
|
||||
switch (partNum) {
|
||||
case 1:
|
||||
addr =
|
||||
((uint32_t)((uint32_t)block * GD32F450ZIT6_FLASH_SECTOR_SIZE) + GD32F450ZIT6_FLASH_BANK1_SECTOR17_ADDR + off);
|
||||
(uint32_t)((uint32_t)block * GD32F450ZIT6_FLASH_SECTOR_SIZE)
|
||||
+ GD32F450ZIT6_FLASH_BANK1_SECTOR17_ADDR + off;
|
||||
fmc_read_8bit_data(addr, size, buffer);
|
||||
break;
|
||||
case 2:
|
||||
@@ -189,7 +190,8 @@ int littlefs_block_write(const struct lfs_config *c, lfs_block_t block, lfs_off_
|
||||
switch (partNum) {
|
||||
case 1:
|
||||
addr =
|
||||
((uint32_t)((uint32_t)block * GD32F450ZIT6_FLASH_SECTOR_SIZE) + GD32F450ZIT6_FLASH_BANK1_SECTOR17_ADDR + off);
|
||||
(uint32_t)((uint32_t)block * GD32F450ZIT6_FLASH_SECTOR_SIZE)
|
||||
+ GD32F450ZIT6_FLASH_BANK1_SECTOR17_ADDR + off;
|
||||
fmc_write_8bit_data(addr, size, buffer);
|
||||
break;
|
||||
case 2:
|
||||
@@ -226,7 +228,7 @@ int littlefs_block_erase(const struct lfs_config *c, lfs_block_t block)
|
||||
case 2:
|
||||
addr =
|
||||
((uint32_t)((uint32_t)block * SDRAM_BLOCK_SIZE) + SDRAM_OFFSET_ADDRESS + SDRAM_BLOCK_ADDRESS);
|
||||
int ret = memset_s((void *)addr,SDRAM_BLOCK_SIZE , 0xff, SDRAM_BLOCK_SIZE);
|
||||
int ret = memset_s((void *)addr,SDRAM_BLOCK_SIZE, 0xff, SDRAM_BLOCK_SIZE);
|
||||
if (ret != 0) {
|
||||
printf("The earse sdram address 0x%x is failed ret = %d",addr,ret);
|
||||
LOS_IntRestore(intlock);
|
||||
@@ -414,7 +416,7 @@ int HalFileDelete(const char *path)
|
||||
|
||||
ret = unlink(file_path);
|
||||
free(file_path);
|
||||
LOS_MDelay(0x0A);
|
||||
LOS_MDelay(0x0A);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
*Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
|
||||
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// \author (c) Marco Paland (info@paland.com)
|
||||
|
||||
@@ -45,8 +45,8 @@ void clean_bss(void)
|
||||
volatile unsigned int *start = (volatile unsigned int *)&__bss_start__;
|
||||
volatile unsigned int *end = (volatile unsigned int *)&__bss_end__;
|
||||
|
||||
printf("bss start is %p %p\n", __bss_start__, &__bss_start__);
|
||||
printf("bss end is %p %p\n", __bss_end__, &__bss_end__);
|
||||
printf("bss start is 0x%x %p\n", __bss_start__, &__bss_start__);
|
||||
printf("bss end is 0x%x %p\n", __bss_end__, &__bss_end__);
|
||||
while (start <= end) {
|
||||
*start++ = 0;
|
||||
}
|
||||
|
||||
@@ -262,8 +262,7 @@ static struct WatchdogMethod g_gd450_iwdg_ops = {.feed = GD450wdgFeed,
|
||||
.releasePriv = GD450wdgReleasePriv,
|
||||
.setTimeout = GD450wdgSetTimeout,
|
||||
.start = GD450wdgStart,
|
||||
|
||||
// stm32mp1的iwdg不支持软件停止
|
||||
// iwdg不支持软件停止
|
||||
.stop = NULL};
|
||||
|
||||
static int32_t GD450wdgReadDrs(struct GD450wdg *iwdg, const struct DeviceResourceNode *node)
|
||||
|
||||
@@ -23,10 +23,4 @@
|
||||
|
||||
#define LWIP_SOCKET_SELECT_FUNC 1
|
||||
|
||||
// #ifdef LWIP_IPV6
|
||||
// #undef LWIP_IPV6
|
||||
// #endif
|
||||
// #define LWIP_IPV6 1
|
||||
|
||||
|
||||
#endif /* GD_PORT_LWIPOPTS_H */
|
||||
|
||||
Vendored
+6
-7
@@ -88,7 +88,6 @@ static void create_dir(char *src)
|
||||
|
||||
path = strchr(src, '/');
|
||||
if (path) {
|
||||
|
||||
int ret;
|
||||
fprintf(stdout, "%s\r\n", path);
|
||||
|
||||
@@ -179,9 +178,9 @@ static void skip_direct(char *curr_path, struct dirent *ent, char *src)
|
||||
}
|
||||
void usage(void)
|
||||
{
|
||||
fprintf(stdout,
|
||||
"usage: mklfs -c <pack-dir> -b <block-size> -r <read-size> -p <prog-size> -s <filesystem-size> -n "
|
||||
"<context> -l <lookahead_size> -e <cache_size> -k <block_cycles> -i <image-file-path>\r\n");
|
||||
(void)fprintf(stdout,
|
||||
"usage: mklfs -c <pack-dir> -b <block-size> -r <read-size> -p <prog-size> -s <filesystem-size> -n "
|
||||
"<context> -l <lookahead_size> -e <cache_size> -k <block_cycles> -i <image-file-path>\r\n");
|
||||
}
|
||||
|
||||
static int is_number(const char *s)
|
||||
@@ -330,7 +329,7 @@ int main(int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
char * last_dir = strrchr(src, '/');
|
||||
char *last_dir = strrchr(src, '/');
|
||||
if (last_dir) {
|
||||
last_dir++;
|
||||
compact(last_dir);
|
||||
@@ -347,12 +346,12 @@ int main(int argc, char **argv)
|
||||
|
||||
int ret;
|
||||
ret = fwrite(data, 1, fs_size, img);
|
||||
if(ret < 0) {
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "fwrite(data, 1, fs_size, img): errno=%d (%s)\r\n", errno, strerror(errno));
|
||||
}
|
||||
|
||||
ret = fclose(img);
|
||||
if(ret < 0) {
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "fclose(img): errno=%d (%s)\r\n", errno, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user