This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CoreSight Components Technical Reference Manual (Assembly code for Stimulus Registers)

Hi,

on page 310 of the CoreSight Components Technical Reference Manual (ARM DDI 0314H),
there is this assembly snippet which is showing how to do an exclusive write to the stimulus port.

When I'm trying the code, the assembler complains about 'branch out of range'
which seems to come from CZBEQ and CZBNE.

The branch destination of CZBEQ and CZBNE must be within 4 to 130 bytes after
the instruction and in the same execution state, while in the snippet, the destination is before the instruction.
Is there another version of the example?
Thanks!
---------------8<------------

; R0 = FIFO-full/exclusive status
; R1 = base of ITM stimulus ports
; R2 = value to write
retry
LDREX R0,[R1,#??]
; read FIFO status and request excl lock
CZBEQ R0,retry
; FIFO not ready, try again
STREX R0,R2,[R1,#??] ; store if FIFO !Full and excl lock
CZBNE R0,retry
; excl lock failed, try again