我已按照回复进行操作,
以下是我裸机和linux的所有配置:
#include
#include "platform.h"
#include "xil_printf.h"
#include "sleep.h"
#include "xil_io.h"
#include "xil_mmu.h"
int main()
{
//Disable cache on OCM
// S=b1 TEX=b100 AP=b11, Domain=b1111, C=b0, B=b0
Xil_SetTlbAttributes(0xFFFF0000,0x14de2);
Xil_Out32(0xFFFF0000,0xaabbccdd);
while(1){
xil_printf("uart1:Hello World\n\r");
sleep(2);
}
return 0;
}
网口登陆后的操作,接收不到裸机串口发出的信息:root@xc7z035amp0829uart:~# poke 0xfffffff0 0x20000000
root@xc7z035amp0829uart:~# peek 0xffff0000
0xaabbccdd
root@xc7z035amp0829uart:~# cat /dev/ttyPS0
设备树:/include/ "system-conf.dtsi"
/ {
memory { device_type = "memory"; reg = <0x00000000 0x20000000>; };
};
&uart1 {
device_type = "serial";
port-number = <1>;
status = "desable";
};
所以,我操作哪里有什么问题?你那边是成功的吗?