|
开发的硬件是mips架构的CPU~
郁闷了~在dos下编bootrom.bin,烧进flash后通过点灯观察运行状况
在romStart函数中复制rom代码到ram已经没问题,之后可以成功调用rom中的点灯程序或者已经复制到ram中的点灯程序拷贝。
但是解压缩就是过不去~
想问一下各位有没有自己调通过BSP的兄弟,这个romStart的压缩解压缩有那些需要注意的宏呢?
就是romStart中的这一段
debug_on_off_rominit();/*点灯成功*/
#if defined (UNCOMPRESS) || defined (ROM_RESIDENT)
#if (CPU_FAMILY == I960)
absEntry = (FUNCPTR)sysInitAlt; /* reinit proc tbl */
#else
absEntry = (FUNCPTR)usrInit; /* on to bootConfig */
#endif /* CPU_FAMILY == I960 */
#else
{
#if (CPU_FAMILY == MIPS)
volatile FUNCPTR absUncompress = (FUNCPTR) UNCMP_RTN;
((FUNCPTR)ROM_OFFSET(debug_on_off_rominit))();*点灯成功(读的是rom内的点灯程序)*/
if ((absUncompress) ((UCHAR *)ROM_OFFSET(binArrayStart),
(UCHAR *)K0_TO_K1(RAM_DST_ADRS),
(int)((UINT)binArrayEnd - (UINT)binArrayStart)) != OK) /*这行执行过去后就不知道怎么了,不管返回的是OK还是ERROR都不能点亮灯。*/
#elif (CPU_FAMILY == I80X86) || (CPU_FAMILY == ARM)
volatile FUNCPTR absUncompress = (FUNCPTR) UNCMP_RTN;
if ((absUncompress) ((UCHAR *)ROM_OFFSET(binArrayStart),
(UCHAR *)RAM_DST_ADRS, binArrayEnd - binArrayStart) != OK)
#else
if (UNCMP_RTN ((UCHAR *)ROM_OFFSET(binArrayStart),
(UCHAR *)RAM_DST_ADRS, binArrayEnd - binArrayStart) != OK)
#endif /* (CPU_FAMILY == MIPS) */
{
debug_on_off_rominit();/*点灯失败*/
return; /* if we return then ROM's will halt */
}
absEntry = (FUNCPTR)RAM_DST_ADRS; /* compressedEntry () */
}
#endif /* defined UNCOMPRESS || defined ROM_RESIDENT */
#if ((CPU_FAMILY == ARM) && ARM_THUMB)
absEntry = (FUNCPTR)((UINT32)absEntry | 1); /* force Thumb state */
#endif /* CPU_FAMILY == ARM */
debug_on_off_rominit();/*点灯失败*/
(absEntry) (startType);
}
#if (CPU_FAMILY==ARM) && (!defined(ROM_RESIDENT))
#undef fillLongs
#endif /* (CPU_FAMILY==ARM) */
|
|