目前使用21489和外部SDRAM问题较多总结如下:
问题1.使用Memory -> External Byte参看SDRAM空间数据,ldf文件中定义如下:
// ------------------------- SDRAM -------------------------------------------
// 0x00200000 to 0x009FFFFF Normal word (32) Space (32MB RAM) as found on the
// ADSP-21489 Ez-Board.
//
// Notes:
// 1) For Code accesses, which are only supported in Bank 0 of External
// port, address range is:
// - For VISA code (i.e 16bit accesses) : 0x600000 - 0xFFFFFF
// - For NonVISA code (i.e 48 bit access) : 0x200000 - 0x5FFFFF
//
// 2) The linker does not understand address translation so does not detect
// overlaps correctly which means that errors can be issued for non-
// overlapping sections and also that no errors are issued for overlapping
// sections. (TAR-43296)
seg_ext_swco { TYPE(SW RAM) START(0x00600000) END(0x0065FFFF) WIDTH(16) }
seg_ext_nwco { TYPE(PM RAM) START(0x00220000) END(0x0043FFFF) WIDTH(16) }
seg_ext_dmda { TYPE(DM RAM) START(0x00660000) END(0x009FFFFF) WIDTH(16) }
seg_ext_pmda { TYPE(DM RAM) START(0x00A00000) END(0x00AFFFFF) WIDTH(16) }
运行SDRAM初始化后,在External Data Byte memory窗口显示均为0x00,手工修改后仍然是0x00,为何?
问题2:查看seg_ext_dmda空间0x00660000,有数据,手工修改后无论是写入0xFF,0x00,0x55,0xAA均正确。
但使用代码:
unsigned int *p_sdram;
int value;
int i;
p_sdram = 0x00660000;//&tst_sdram_buf[0];
for (i = 0; i < 1024*1024; i++) {
*p_sdram++ = 0xEFFF0000 + i; //运行此代码后memroy 窗口0x660000 处并没有变化
}
p_sdram = 0x00660000;
for (i = 0; i < 1024; i++) {
value = 0x00;
value = *p_sdram++; //运行此代码还均可以获取前面代码的正确值
}
单步运行后,0x660000 通过memroy窗口观察,但回读数据代码困可以得到正确的结果?同时使用expressions窗口查看p_sdram的值,是步进1的,为啥?
问题3:使用如下代码测试:
p_sdram = 0x2000000;
for (i = 0; i < 1024*1024; i++) {
*p_sdram++ = 0xEFFF0000 + i; //操作后[2000000] 00 FF 0 FF 02 FF 03 FF 04 FF ..............,
}
p_sdram = 0x2000000;
for (i = 0; i < 1024; i++) {
value = 0x00;
value = *p_sdram++; //此处还能正确获取上面代码的正确值
}
在memory窗口0x2000000处可以看到数据变化,但均是16bit操作,上述操作后数据为:
[2000000] 00 FF 0 FF 02 FF 03 FF 04 FF ............
使用dump memory数据时,dump后的数据和窗口查看的数据一致,为何?如何通过memory窗口查看SDRAM?
问题3:在程序中指定将数组链接到外部存储空间:
section("bss_external") unsigned short tst_sdram_buf[1024];
编译后产生:
[Warning li2060] The following input section(s) that contain program code
and/or data have not been placed into the executable for processor 'P0'
as there are no relevant commands specified in the LDF:
.\Debug\srw_basic.doj(bss_external)
[Error li1060] The following symbols are referenced, but not mapped:
'_tst_sdram_buf' referenced from .\Debug\srw_basic.doj(seg_swco)
这个错误如何处理?