|
最近自己画了一块板子,配制是:
AM29LV641D NOR flash 8M Byte
IS61LV51216 SRAM 1M Byte
外部存储器的地址线和片选信号线都是按官方电路图接的,只是用的nor flash型号不同,自己移植了官方提供的例程后支持了自己板子上的AM29LV641D的8M flash,可以正常下载而且能将程序放到外部的flash和SRAM中运行?我按官方uclinux on stm32文档步骤操作,将镜像下载到外部NOR flash中但uclinux起动不了,一条打印信息都没有。我对uclinux内核起动的汇编文件单独调试,STM32 CPU ID检测能通过,但是平台检测就不通过了 这段汇编如下:
/*
* Lookup machine architecture in the linker-build list of architectures.
* Note that we can't use the absolute addresses for the __arch_info
* lists since we aren't running with the MMU on (and therefore, we are
* not in the correct address space). We have to calculate the offset.
*
* r1 = machine architecture number
* Returns:
* r3, r4, r6 corrupted
* r5 = mach_info pointer in physical address space
*/
__lookup_machine_type:
adr r3, 3b
ldmia r3, {r4, r5, r6}
sub r3, r3, r4 @ get offset between virt&phys
add r5, r5, r3 @ convert virt addresses to
add r6, r6, r3 @ physical address space
1: ldr r3, [r5, #MACHINFO_TYPE] @ get machine type
teq r3, r1 @ matches loader number?(我屏蔽了这句之后,一会儿就发生硬异常了)
beq 2f @ found
add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
cmp r5, r6
blo 1b
mov r5, #0 @ unknown machine 我的板子执行了这句
2: mov pc, lr
ENDPROC(__lookup_machine_type)
r5=0了之后就跳到了 __error_a /* __error_a是一个死循环 */
我想可能是flash型号不同缘故,所以想看ST官方发布的uclinux on stm32的an3012包中的“kernel_boot_loader.hex”的源码,看看它是怎么引导内核的,但“kernel_boot_loader.hex”的源码找不到地方下载。我有个想法就是移植uboot,ST发布的uclinux方案是在NOR flash上运行的内核不需要自解压也不需要拷贝到内存当中运行,这样不是不省去了很多麻烦。不知可不可行。有没有人做过呢?这是我QQ 461207084。
支持自己的板子上的NOR flash下载,并且可以在NOR中运行程序,但不能起动uclinux (原文件名:sdf.JPG)
下载官方的kernel_boot_loader.hex或Tiny_kernel_boot_loader.hex的官方开发板上的flash (原文件名:guan.JPG)
keil中也制作了自己板子flash算法,可正常下载运行程序。 (原文件名:k.JPG)
这是ST官方发布的uclinux开发包,但在我的板子上运行不起来ourdev_607549Z0NA4G.rar(文件大小:2.82M) (原文件名:an3012.rar) |
阿莫论坛20周年了!感谢大家的支持与爱护!!
一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。
|