把redboot移植到s3c44b0x平台上

基本上是按照下面的步骤做的,但是遇到了一些问题。

 

以下步骤是从ecos官网上的文档中抄下来的。

Minimal requirements

These are the changes you must make before you attempt to build RedBoot. You are advised to read all the sources though.

  1. Copy an existing platform HAL from the same or another architecture. Rename the files as necessary to follow the standard: CDL and MLT related files should contain the <arch>_<variant>_<platform> triplet.

  2. Adjust CDL options. Primarily option naming, real-time clock/counter, and CYGHWR_MEMORY_LAYOUT variables, but also other options may need editing. Look through the architecture/variant CDL files to see if there are any requirements/features which where not used on the platform you copied. If so, add appropriate ones. See the Section called HAL Platform CDL for more details.

  3. Add the necessary packages and target descriptions to the top-level ecos.db file. See the Section called eCos Database . Initially, the target entry should only contain the HAL packages. Other hardware support packages will be added later.

  4. Adjust the MLT files in include/pkgconf to match the memory layout on the platform. For initial testing it should be enough to just hand edit .h and .ldi files, but eventually you should generate all files using the memory layout editor in the configuration tool. See the Section called Platform Memory Layout for more details.

  5. Edit the misc/redboot_<STARTUP>.ecm for the startup type you have chosen to begin with. Rename any platform specific options and remove any that do not apply. In the cdl_configuration section, comment out any extra packages that are added, particularly packages such as CYGPKG_IO_FLASH and CYGPKG_IO_ETH_DRIVERS . These are not needed for initial porting and will be added back later.

  6. If the default IO macros are not correct, override them in plf_io.h. This may be necessary if the platform uses a different endianness from the default for the CPU.

  7. Leave out/comment out code that enables caches and/or MMU if possible. Execution speed will not be a concern until the port is feature complete.

  8. Implement a simple serial driver (polled mode only). Make sure the initialization function properly hooks the procedures up in the virtual vector IO channel tables. RedBoot will call the serial driver via these tables.

    By copying an existing platform HAL most of this code will be already done, and will only need the platform specific hardware access code to be written.

  9. Adjust/implement necessary platform initialization. This can be found in platform.inc and platform.S files (ARM: hal_platform_setup.h and <platform>_misc.c , PowerPC: <platform>.S ). This step can be postponed if you are doing a RAM startup RedBoot first and the existing ROM monitor handles board initialization.

  10. Define HAL_STUB_PLATFORM_RESET (optionally empty) and HAL_STUB_PLATFORM_RESET_ENTRY so that RedBoot can reset-on-detach - this is very handy, often removing the need for physically resetting the board between downloads.

我遇到的第一个问题是,在进行第四步,即修改内存分布时,.h文件和.ldi文件都很容易看懂,可以顺利修改,但mlt文件看不懂,mlt文件是configtool用的,如果不改,在使用configtool配置时,做到import这一步时就会自动退出。最后我把mtl文件改成了下面的样子,可以继续使用configtool了。

 

//ram.mlt

 

version 0
region ram 0c000000 800000 0 !
section fixed_vectors 0 1 0 1 1 0 1 0 20 0c000020 !
section rom_vectors 0 1 0 1 1 1 1 1 20000 0c020000 text text !
section text 0 4 0 1 0 1 0 1 fini fini !
section fini 0 4 0 1 0 1 0 1 rodata rodata !
section rodata 0 4 0 1 0 1 0 1 rodata1 rodata1 !
section rodata1 0 4 0 1 0 1 0 1 fixup fixup !
section fixup 0 4 0 1 0 1 0 1 gcc_except_table gcc_except_table !
section gcc_except_table 0 4 0 1 0 1 0 1 data data !
section data 0 4 0 1 0 1 0 1 bss bss !
section bss 0 4 0 1 0 1 0 1 heap1 heap1 !
section heap1 0 8 0 0 0 0 0 0 !

 

//rom.mlt

 

version 0
region ram 0c000000 800000 0 !
region rom 00000000 200000 1 !
section fixed_vectors 0 1 0 1 1 0 1 0 20 0c000020 !
section data 0 1 1 1 1 1 0 0 800000 bss !
section bss 0 4 0 1 0 1 0 1 heap1 heap1 !
section heap1 0 8 0 0 0 0 0 0 !
section reserved_bootmon 20000 1 0 0 1 1 1 1 0 0 rom_vectors rom_vectors !
section rom_vectors 0 8 0 1 0 1 0 1 text text !
section text 0 1 0 1 0 1 0 1 fini fini !
section fini 0 4 0 1 0 1 0 1 rodata rodata !
section rodata 0 4 0 1 0 1 0 1 rodata1 rodata1 !
section rodata1 0 4 0 1 0 1 0 1 fixup fixup !
section fixup 0 4 0 1 0 1 0 1 gcc_except_table gcc_except_table !
section gcc_except_table 0 4 0 1 0 0 0 1 data !

 

不知道改的对不对, 但应该不会影响后续的开发。因为如果生成的工程中的memory layout不正确的话,我们可以直接去修改.h文件和.mlt文件。

 

 

我遇到的第二个问题是:

 

从串口发送数据到PC机,怎么也发不出去。从发送所用的时间看应该是对的。在波特率是19200的情况下发送10K时间用了5秒钟,但是PC机没有接收到,不知道它发到什么地方去了。

 

仔细阅读s3c44b0x的文档,tx0 和rx0都是可复用端口,我把该端口功能设置成tx0和rx0后,发送正常了。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值