今天在调试一块新做的开发板,STM32F407+is61lv51216. 万万没想到竟然卡在SRAM这个地方,异常情况如下:
1. 测试SRAM时,16BIT模式的读写测试时OK的;
2. 测试8BIT模式时,一访问单字节地址时,在线调试中断(Jlink在线调试);
/* 8bit memtest */
{
unsigned char *p_extram = (unsigned char *)STM32_EXT_SRAM_BEGIN;
unsigned int temp;
for(temp = 0; temp < (STM32_EXT_SRAM_END - STM32_EXT_SRAM_BEGIN)/sizeof(unsigned char); temp++)
{
*p_extram++ = (unsigned char)temp; ===》 执行到此处Jlink连接中断
}
p_extram = (unsigned char *)STM32_EXT_SRAM_BEGIN;
for(temp = 0; temp < (STM32_EXT_SRAM_END - STM32_EXT_SRAM_BEGIN)/sizeof(unsigned char); temp++)
{
if( *p_extram++ != (unsigned char)temp )
{
while(1);
}
}
}/* memtest */
|