在官网下载“rtthread-nano-master”安装后,选择bsp中的“stm32f103-blink”项目,在main.c中屏蔽其它代码,输入以下代码即可复现上面描述的问题,即数组变量不能正常读写!
若不方便用硬件开发板的话,建议用单步软仿真进行测试
rt_uint8_t test_array[5] = {1,2,3,4,5};
rt_uint8_t test_data;
int main(void)
{
test_data = test_array[0];
test_array[0] = 0x55;
test_data = test_array[0];
test_array[0] = 0xaa;
test_data = test_array[0];
test_data = 1;
}
你的回复有理有据,严谨详实,我验证了,确实是这样的,按你的方法问题解决了。下次有问题,我会按你说的这种方式,图文并茂,将问题描述清楚。RTT一直没让我失望过!非常感谢😄
@二牛哥 哈哈,赞👍!