readme.txt 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. 两种方法编译当前bsp
  2. 编译:
  3. 1). 使用Visual Studio(2005以上版本)打开vs2005.vcproj
  4. 编译后运行
  5. 2). 使用scons编译,在当前目录中打开cmd,输入
  6. scons -j4
  7. 编译完成后会在当前目录下生成 rtthrad-win32.exe,双击即可运行。
  8. 运行:
  9. 编译后运行,会弹出CMD命令行窗口,可以看到控制台的输出信息,如下所示
  10. \ | /
  11. - RT - Thread Operating System
  12. / | \ 1.1.0 build Oct 21 2012
  13. 2006 - 2012 Copyright by rt-thread team
  14. init jffs2 lock mutex okay
  15. hello, world
  16. finsh>>fatfs initialzation failed!
  17. uffs initialzation failed!
  18. jffs2 initialzation failed!
  19. thread 29e4 exit
  20. hello, world
  21. hello, world
  22. hello, world
  23. hello, world
  24. hello, world
  25. hello, world
  26. hello, world
  27. hello, world
  28. hello, world
  29. thread 2898 exit
  30. 注意上面的信息显示,fatfs/uffs/jffs2均挂载失败,这是因为我们还没有为sd.bin创建fat分区,并且sd上也没有目录用于挂载jffs2和uffs。
  31. 并且此时当前bsp目录下,新增了三个文件用于模拟sd卡,nand flash与nor flash,它们是
  32. sd.bin--模拟SD卡,挂载fat,大小为16M
  33. nand.bin-模拟nand flash,挂载uffs,参数page=2048+64bytes,block=64pages,16M
  34. nor.bin--模拟nor flash,挂载jffs2,型号为sst25vf,2M
  35. 按下回车,出现finsh,然后输入如下命令格式化sd.bin
  36. finsh>>mkfs("elm", "sd0")
  37. 0, 0x00000000
  38. finsh>>
  39. 关闭程序重新运行,此时可以看到fatfs挂载成功,不过jffs2和uffs依然失败,如下所示。
  40. \ | /
  41. - RT - Thread Operating System
  42. / | \ 1.1.0 build Oct 21 2012
  43. 2006 - 2012 Copyright by rt-thread team
  44. init jffs2 lock mutex okay
  45. hello, world
  46. finsh>>fatfs initialized!
  47. uffs initialzation failed!
  48. jffs2 initialzation failed!
  49. 这是因为sd上还没有目录来用于挂载jffs2和uffs,在finsh中输入如下命令在sd上创建nand与nor文件夹,分别用于挂载uffs与jffs2文件系统。
  50. finsh>>mkdir("/nand")
  51. 0, 0x00000000
  52. finsh>>mkdir("/nor")
  53. 0, 0x00000000
  54. finsh>>
  55. 然后再次关闭程序后重新运行,此时可以看到jffs2与uffs挂载成功。
  56. 最终输出如下所示:
  57. \ | /
  58. - RT - Thread Operating System
  59. / | \ 1.1.0 build Oct 21 2012
  60. 2006 - 2012 Copyright by rt-thread team
  61. init jffs2 lock mutex okay
  62. hello, world
  63. finsh>>fatfs initialized!
  64. os : system memory alloc 320 bytes
  65. flsh: ECC size 24
  66. flsh: UFFS consume spare data size 34
  67. os : system memory alloc 83520 bytes
  68. os : system memory alloc 52400 bytes
  69. os : system memory alloc 2048 bytes
  70. tree: DIR 0, FILE 0, DATA 0
  71. uffs initialized!
  72. jffs2 initialized!
  73. thread 2fb4 exit
  74. hello, world
  75. hello, world
  76. hello, world
  77. hello, world
  78. hello, world
  79. hello, world
  80. hello, world
  81. hello, world
  82. hello, world
  83. thread 312c exit
  84. Ok,到现在,一个完整的文件系统测试环境就搭建完毕了,enjoy~~