diff --git a/bsp/mini2440/application.c b/bsp/mini2440/application.c index ad2529d50b741096491f0ab569ab9ecd4e989158..6234b6ce16d96d0c0909179eff9c15bbb4ac7762 100644 --- a/bsp/mini2440/application.c +++ b/bsp/mini2440/application.c @@ -76,7 +76,7 @@ void rt_init_thread_entry(void* parameter) #ifdef RT_USING_RTGUI { - rt_hw_key_init(); + //rt_hw_key_init(); } #endif diff --git a/bsp/mini2440/board.c b/bsp/mini2440/board.c index cba3915356d14cb8f6f4d6c269970315da21b72f..231812b82e51ffa36f8ef9fb16b28fe2985e0720 100644 --- a/bsp/mini2440/board.c +++ b/bsp/mini2440/board.c @@ -88,7 +88,7 @@ void rt_hw_uart_init(void) GPHUP |= 0xF; /* FIFO enable, Tx/Rx FIFO clear */ - uart0.uart_device->ufcon = 0x1; + uart0.uart_device->ufcon = 0x0; /* disable the flow control */ uart0.uart_device->umcon = 0x0; /* Normal,No parity,1 stop,8 bit */ diff --git a/bsp/mini2440/debug.Opt b/bsp/mini2440/debug.Opt index 0c291ea0b7e07c2f424133d8a14c7ba2b1d369a6..462fb93fa5256af57ebb2c875d8c5df94a9a6068 100644 --- a/bsp/mini2440/debug.Opt +++ b/bsp/mini2440/debug.Opt @@ -13,7 +13,13 @@ Target (RT-Thread Debug), 0x0004 // Tools: 'ARM-ADS' -ExtF 118,127,0,{ 44,0,0,0,2,0,0,0,3,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,44,0,0,0,58,0,0,0,113,2,0,0,32,1,0,0 } +ExtF 49,56,0,{ 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,22,0,0,0,29,0,0,0,188,2,0,0,7,1,0,0 } +ExtF 47,54,0,{ 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,66,0,0,0,87,0,0,0,236,2,0,0,66,1,0,0 } +ExtF 602,602,0,{ 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,0,0,0,0,0,0,0,0,57,3,0,0,190,0,0,0 } +ExtF 844,848,0,{ 44,0,0,0,2,0,0,0,3,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,66,0,0,0,87,0,0,0,201,2,0,0,128,1,0,0 } +ExtF 124,135,0,{ 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,88,0,0,0,116,0,0,0,223,2,0,0,157,1,0,0 } +ExtF 80,84,0,{ 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,44,0,0,0,58,0,0,0,179,2,0,0,82,1,0,0 } +ExtF 56,66,0,{ 44,0,0,0,0,0,0,0,1,0,0,0,255,255,255,255,255,255,255,255,252,255,255,255,226,255,255,255,44,0,0,0,58,0,0,0,179,2,0,0,82,1,0,0 } TARGOPT 1, (RT-Thread Debug) ADSCLK=12000000 @@ -25,15 +31,15 @@ TARGOPT 1, (RT-Thread Debug) OPTXL 1,1,1,1,1,1,1,0,0 OPTFL 1,0,1 OPTAX 255 - OPTBL 0,(User's Manual) - OPTDL (SARM.DLL)()(DARMSS9.DLL)(-pS3C2410A)(SARM.DLL)()(TARMSS9.DLL)(-pS3C2410A) + OPTBL 0,(User's Manual) + OPTDL (SARM.DLL)()(DARMSS9.DLL)(-pS3C2440A)(SARM.DLL)()(TARMSS9.DLL)(-pS3C2440A) OPTDBG 47614,6,()()()()()()()()()(.\Ext_RAM.ini) (Segger\JLTAgdi.dll)()()() OPTKEY 0,(DLGTARM)((113=-1,-1,-1,-1,0)(100=90,124,666,445,0)(102=-1,-1,-1,-1,0)(103=-1,-1,-1,-1,0)(104=-1,-1,-1,-1,0)(105=-1,-1,-1,-1,0)(106=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)(108=-1,-1,-1,-1,0)(109=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(112=-1,-1,-1,-1,0)) - OPTKEY 0,(JLTAgdi)(-O1070 -J1 -Y1000 -Z1 -FO7 -FD40000000 -FC800 -FN0) + OPTKEY 0,(JLTAgdi)(-O1070 -J1 -Y800 -Z4 -FO7 -FD30000000 -FC8000 -FN1 -FF0S3C2440_NAND_SP -FS030000000 -FL08000000) OPTKEY 0,(JLTDLG)() OPTKEY 0,(DLGDARM)((113=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(102=-1,-1,-1,-1,0)(103=-1,-1,-1,-1,0)(104=-1,-1,-1,-1,0)(105=-1,-1,-1,-1,0)(106=-1,-1,-1,-1,0)(107=-1,-1,-1,-1,0)(108=-1,-1,-1,-1,0)(109=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(112=-1,-1,-1,-1,0)) OPTKEY 0,(ARMDBGFLAGS)(-T5F) - OPTMM 1,2,(0) + OPTMM 1,2,(0x3020000) OPTDF 0x86 OPTLE <> OPTLC <> diff --git a/bsp/mini2440/debug.Uv2 b/bsp/mini2440/debug.Uv2 index 01e8ac5e7cb3b1a72a1c78637abaa61470330d19..fee07fcfcc23427c99db4e91d544f4d73f9ef52a 100644 --- a/bsp/mini2440/debug.Uv2 +++ b/bsp/mini2440/debug.Uv2 @@ -7,14 +7,14 @@ Target (RT-Thread Debug), 0x0004 // Tools: 'ARM-ADS' Options 1,0,0 // Target 'RT-Thread Debug' - Device (S3C2410A) + Device (S3C2440A) Vendor (Samsung) - Cpu (IRAM(0x40000000-0x40001FFF) CLOCK(12000000) CPUTYPE(ARM920T)) + Cpu (IRAM(0x40000000-0x40000FFF) CLOCK(12000000) CPUTYPE(ARM920T)) FlashUt () - StupF ("STARTUP\Samsung\S3C2410A.s" ("Samsung S3C2410A Startup Code")) - FlashDR () - DevID (4252) - Rgf (S3C2410A.H) + StupF ("STARTUP\Samsung\S3C2440.s" ("Samsung S3C2440 Startup Code")) + FlashDR (UL2ARM(-UV2077N9E -O40 -S0 -C0 -N00("ARM920T Core") -D00(0032409D) -L00(4) -FO7 -FD40000000 -FC1000 -FN1 -FF0S3C2440_NAND_SP -FS030000000 -FL07FFC000)) + DevID (4277) + Rgf (S3C2440.H) Mem () C () A () @@ -55,10 +55,10 @@ Options 1,0,0 // Target 'RT-Thread Debug' RVDEV () ADSTFLGA { 0,8,64,0,96,0,64,64,0,0,0,0,0,0,0,0,0,0,0,0 } OCMADSOCM { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } - OCMADSIRAM { 0,0,0,0,64,0,32,0,0 } + OCMADSIRAM { 0,0,0,0,64,0,16,0,0 } OCMADSIROM { 0,0,0,0,0,0,0,0,0 } OCMADSXRAM { 0,0,0,0,0,0,0,0,0 } - OCR_RVCT { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,32,0,0,0,0,0,0,0,0,0,0,0 } + OCR_RVCT { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,16,0,0,0,0,0,0,0,0,0,0,0 } RV_STAVEC () ADSCCFLG { 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } ADSCMISC () @@ -88,10 +88,10 @@ Options 1,0,0 // Target 'RT-Thread Debug' ADSLDMC () ADSLDIF () ADSLDDW () - OPTDL (SARM.DLL)()(DARMSS9.DLL)(-pS3C2410A)(SARM.DLL)()(TARMSS9.DLL)(-pS3C2410A) + OPTDL (SARM.DLL)()(DARMSS9.DLL)(-pS3C2440A)(SARM.DLL)()(TARMSS9.DLL)(-pS3C2440A) OPTDBG 47614,6,()()()()()()()()()(.\Ext_RAM.ini) (Segger\JLTAgdi.dll)()()() - FLASH1 { 1,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0 } - FLASH2 () + FLASH1 { 1,0,0,0,1,0,0,0,4,16,0,0,0,0,0,0,0,0,0,0 } + FLASH2 (Segger\JLTAgdi.dll) FLASH3 ("" ()) FLASH4 () EndOpt diff --git a/bsp/mini2440/sdcard.c b/bsp/mini2440/sdcard.c index 8aeb9062d5037726feff08ad8d0fa89bd216a518..764d96d97bd8c9e7c7da75b8c929ba4ddaef6ecd 100644 --- a/bsp/mini2440/sdcard.c +++ b/bsp/mini2440/sdcard.c @@ -74,8 +74,8 @@ static int sd_cmd_end(int cmd, int be_resp) { if( (finish0&0x1f00) != 0xa00 ) { - rt_kprintf("CMD%d:SDICSTA=0x%x, SDIRSP0=0x%x\n", - cmd, SDICSTA, SDIRSP0); + rt_kprintf("CMD%d:SDICSTA=0x%x, SDIRSP0=0x%x\n", + cmd, SDICSTA, SDIRSP0); SDICSTA=finish0; if(((finish0&0x400)==0x400)) @@ -100,7 +100,7 @@ static int sd_data_end(void) finish=SDIDSTA; while( !( ((finish&0x10)==0x10) | ((finish&0x20)==0x20) )) - { rt_kprintf("data end\n"); + { finish=SDIDSTA; } @@ -139,7 +139,10 @@ static int sd_cmd55(void) SDICCON = (0x1 << 9) | (0x1 << 8) | 0x77; if(sd_cmd_end(55, 1) == RT_ERROR) + { + rt_kprintf("CMD55 error\n"); return RT_ERROR; + } SDICSTA=0xa00; return RT_EOK; @@ -197,34 +200,6 @@ static void sd_setbus(void) SDICSTA=0xa00; /* Clear cmd_end(with rsp) */ } -/** - * This function will set a hook function, which will be invoked when a memory - * block is allocated from heap memory. - * - * @param hook the hook function - */ -int sd_mmc_ocr(void) -{ - int i; - - /* Negotiate operating condition for MMC, it makes card ready state */ - for(i=0; i<100; i++) - { - SDICARG = 0xff8000; - SDICCON = (0x1<<9)|(0x1<<8)|0x41; - - /* Check end of CMD1 */ - if((sd_cmd_end(1, 1) == RT_EOK) && (SDIRSP0>>16)==0x80ff) - { - SDICSTA=0xa00; - return RT_EOK; - } - } - SDICSTA=0xa00; - - return RT_ERROR; -} - /** * This function will set a hook function, which will be invoked when a memory * block is allocated from heap memory. @@ -271,7 +246,7 @@ rt_uint8_t sd_init(void) /* Important notice for MMC test condition */ /* Cmd & Data lines must be enabled by pull up resister */ SDIPRE = PCLK/(INICLK)-1; - SDICON = (1<<4) | 1; // Type B, clk enable + SDICON = (0<<4) | 1; // Type A, clk enable SDIFSTA = SDIFSTA | (1<<16); SDIBSIZE = 0x200; /* 512byte per one block */ SDIDTIMER=0x7fffff; /* timeout count */ @@ -280,13 +255,6 @@ rt_uint8_t sd_init(void) for(i=0; i<0x1000; i++); sd_cmd0(); - /* Check MMC card OCR */ - if(sd_mmc_ocr() == RT_EOK) - { - rt_kprintf("In MMC ready\n"); - goto RECMD2; - } - rt_kprintf("MMC check end!!\n"); /* Check SD card OCR */ if(sd_ocr() == RT_EOK) @@ -362,19 +330,7 @@ RERDCMD: status = SDIFSTA; if((status & 0x1000) == 0x1000) { -#if 1 - register rt_uint32_t value; - - value = SDIDAT; - - /* swap 4 bytes */ - buf[0] = (value >> 24) & 0xff; - buf[1] = (value >> 16) & 0xff; - buf[2] = (value >> 8) & 0xff; - buf[3] = value & 0xff; -#else *(rt_uint32_t *)buf = SDIDAT; -#endif rd_cnt++; buf += 4; } @@ -422,7 +378,7 @@ REWTCMD: { SDIDAT=*(rt_uint32_t*)buf; wt_cnt++; - buf += 4; + buf += 4; } } if(sd_data_end() == RT_ERROR) @@ -564,8 +520,8 @@ void rt_hw_sdcard_init() CLKCON |= 1 << 9; /* Setup GPIO as SD and SDCMD, SDDAT[3:0] Pull up En */ - GPEUP = GPEUP & (~(0x3f << 5)) | (0x01 << 5); - GPECON = GPECON & (~(0xfff << 10)) | (0xaaa << 10); + GPEUP = GPEUP & (~(0x3f << 5)) | (0x01 << 5); + GPECON = GPECON & (~(0xfff << 10)) | (0xaaa << 10); RCA = 0; diff --git a/bsp/mini2440/touch.c b/bsp/mini2440/touch.c index 64b97461dcd6c76041ab975b14414188a10bdc31..8b3d84ecff6af5f7b3fd863e2b105d706be7942a 100644 --- a/bsp/mini2440/touch.c +++ b/bsp/mini2440/touch.c @@ -103,7 +103,7 @@ void report_touch_input(int updown) emouse.button |= RTGUI_MOUSE_BUTTON_LEFT; - rtgui_server_post_event((&emouse.parent), sizeof(emouse)); + //rtgui_server_post_event((&emouse.parent), sizeof(emouse)); } #endif diff --git a/filesystem/dfs/filesystems/efsl/src/fs/vfat/ui.c b/filesystem/dfs/filesystems/efsl/src/fs/vfat/ui.c index b37e0397e2da5b2f577c896ae49af2d3e0fd4e44..c8e1027219ef6a369f929f2e8dfffeb8b685aca3 100644 --- a/filesystem/dfs/filesystems/efsl/src/fs/vfat/ui.c +++ b/filesystem/dfs/filesystems/efsl/src/fs/vfat/ui.c @@ -35,7 +35,7 @@ /*****************************************************************************/ #include "ui.h" #include "ls.h" -#include "efs.h" +#include "efs.h" /*****************************************************************************/ /* **************************************************************************** @@ -65,12 +65,13 @@ esint16 un_link(FileSystem *fs,euint8* filename) firstCluster <<= 16; firstCluster += ex_getb16(buf+loc.Offset*32+26); attr = ex_getb16(buf+loc.Offset*32+11); + part_relSect(fs->part,buf); + if(attr == ATTR_DIRECTORY) { dlist = (DirList *)rt_malloc(sizeof(DirList)); if(dlist == RT_NULL) { - part_relSect(fs->part,buf); dfs_log(DFS_DEBUG_INFO, ("Memory alloc failed")); return -DFS_STATUS_ENOMEM; @@ -91,9 +92,7 @@ esint16 un_link(FileSystem *fs,euint8* filename) { /* '.' and '..' */ if(dlist->currentEntry.FileName[0] == '.') continue; - - part_relSect(fs->part,buf); - + dfs_log(DFS_DEBUG_INFO, ("Directory not empty")); return -DFS_STATUS_ENOTEMPTY; } @@ -101,7 +100,8 @@ esint16 un_link(FileSystem *fs,euint8* filename) } } } - + + buf = part_getSect(fs->part,loc.Sector,IOM_MODE_READWRITE); memClr(buf+(loc.Offset*32),32); part_relSect(fs->part,buf); cache.DiscCluster = cache.LastCluster = cache.Linear = cache.LogicCluster = 0; diff --git a/tools/SDCARD.zip b/tools/SDCARD.zip new file mode 100644 index 0000000000000000000000000000000000000000..ae473982d4fd915266bb8aaeaab9e28665c5a091 Binary files /dev/null and b/tools/SDCARD.zip differ diff --git a/tools/SDL.dll b/tools/SDL.dll new file mode 100644 index 0000000000000000000000000000000000000000..49f8aa008fbfe6722d8a9bf0824c72c6ed074197 Binary files /dev/null and b/tools/SDL.dll differ diff --git a/tools/libz-1.dll b/tools/libz-1.dll new file mode 100644 index 0000000000000000000000000000000000000000..9e2ef127696b439b097fd7503f67cb13145ce2a6 Binary files /dev/null and b/tools/libz-1.dll differ diff --git a/tools/qemu-system-arm.exe b/tools/qemu-system-arm.exe new file mode 100644 index 0000000000000000000000000000000000000000..4126925e7998f163816ea2fb8cd30fbb288f8f1a Binary files /dev/null and b/tools/qemu-system-arm.exe differ diff --git a/tools/run-mini2440-net-sdcard.bat b/tools/run-mini2440-net-sdcard.bat new file mode 100644 index 0000000000000000000000000000000000000000..40de983181de1d3672902f632ee79970defea585 --- /dev/null +++ b/tools/run-mini2440-net-sdcard.bat @@ -0,0 +1 @@ +qemu-system-arm.exe -M mini2440 -kernel ..\bsp\mini2440\rtthread-mini2440.axf -show-cursor -serial telnet:127.0.0.1:1200,server -net nic -net tap,ifname=virtual -sd SDCARD