UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor kiranhollag
Visitor
407 Views
Registered: ‎03-17-2017

Reading Zynq-7000 SoC's XUARTPS_FIFO_OFFSET using XSDB

Jump to solution

Hi,

In the case of Zynq-7000 SOCs, using XSDB, is it possible to read UART RX FIFO contents?

FIFO's absolute address is 0xE0001030 (considering Uart1) and read to this is resulting in following error in XSDB

"Memory read error at 0xE0001030. Blocked address 0xe0001030. Cannot access read-once register "

Regards,

Kiran

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
246 Views
Registered: ‎09-12-2007

Re: Reading Zynq-7000 SoC's XUARTPS_FIFO_OFFSET using XSDB

Jump to solution

I have updated the script to allow print, and read for the UART:

proc print {addr string} {
foreach char [split $string ""] {
scan $char %c ascii
set data "0x[format %x $ascii]"
mwr -force $addr $data
}
}

#return the decimal value in the TX FIFO
proc get_data {addr} {
set data [mrd -force $addr]
set data [lindex [split $data " "] 3]
set data 0x[string range $data 6 7]
return [expr $data]
}

proc read {addr buffer} {
set buffer_data ""
while {1} {
set data [get_data $addr]
if {$data != "00000000"} {
lappend buffer_data $data
if {[llength $buffer_data] == $buffer} {
return [binary format c* $buffer_data]
}
}
}
}

connect -url TCP:XIRSTEPHENM32:3121
targets -set -filter {name =~ "APU"}
source ps7_init.tcl
ps7_init
#print 0xe0001030 "Hello Kiran"
#read 0xe0001030 11

 

If I run the read <addr> <buffer>

This will do a while until there is data to read, and return when the amount of characters specified in buffer is fulfilled

View solution in original post

3 Replies
Moderator
Moderator
258 Views
Registered: ‎09-12-2007

Re: Reading Zynq-7000 SoC's XUARTPS_FIFO_OFFSET using XSDB

Jump to solution

You can use the -force switch.

 

For example, I created a simple demo that uses the XSCT to print to the UART1 on a ZC702:

proc print {addr string} {
foreach char [split $string ""] {
scan $char %c ascii
set data "0x[format %x $ascii]"
mwr -force $addr $data
}
}

connect -url TCP:XIRSTEPHENM32:3121
targets -set -filter {name =~ "APU"}
source ps7_init.tcl
ps7_init
print 0xe0001030 "Hello Kiran"

 

If I execute this, I see the data on the serial port:

print.png

Moderator
Moderator
247 Views
Registered: ‎09-12-2007

Re: Reading Zynq-7000 SoC's XUARTPS_FIFO_OFFSET using XSDB

Jump to solution

I have updated the script to allow print, and read for the UART:

proc print {addr string} {
foreach char [split $string ""] {
scan $char %c ascii
set data "0x[format %x $ascii]"
mwr -force $addr $data
}
}

#return the decimal value in the TX FIFO
proc get_data {addr} {
set data [mrd -force $addr]
set data [lindex [split $data " "] 3]
set data 0x[string range $data 6 7]
return [expr $data]
}

proc read {addr buffer} {
set buffer_data ""
while {1} {
set data [get_data $addr]
if {$data != "00000000"} {
lappend buffer_data $data
if {[llength $buffer_data] == $buffer} {
return [binary format c* $buffer_data]
}
}
}
}

connect -url TCP:XIRSTEPHENM32:3121
targets -set -filter {name =~ "APU"}
source ps7_init.tcl
ps7_init
#print 0xe0001030 "Hello Kiran"
#read 0xe0001030 11

 

If I run the read <addr> <buffer>

This will do a while until there is data to read, and return when the amount of characters specified in buffer is fulfilled

View solution in original post

Visitor kiranhollag
Visitor
231 Views
Registered: ‎03-17-2017

Re: Reading Zynq-7000 SoC's XUARTPS_FIFO_OFFSET using XSDB

Jump to solution

Hi Stephen,

Thanks for the quick reply and the script...

it solved our issue :)

Regards,
Kiran

0 Kudos