Acess to Scratchpad

Hello everyone.

I am facing a problem to use scratchpad to share data between PRU0 and PRU1.
On PRU1 I got:

MOV R10, 11111
XOUT 10, R10, 4
// some code that will trigger PRU0
// some other code to wait for PRU0 return signal
XIN 10, R20, 4
// some code to send R20 to shared data ram
HALT

On PRU0 I got

//Some code to wait signal from PRU1
MOV R10, 12321
XOUT 10, R10, 4
// some code to signal PRU0 we are finished
HALT

In the ARM side, I can read the shared data ram but it contents is always 11111. This means that PRU0 is not updating the scratchpad, as the expected result would be 12321.
How am I supposed to access the scratch pad?

My specs are:
Beaglebone black REV A6A, running debian
pasm assembler… I had tried -V2 and -V3 as the default -V1 option complains on the XIN and XOUT instructions.

I found out… it seems that the entire register files (maybe r0 to r29) are written in the scratchpad bank and they must be read in the exact same position.
That is, PRU 1 is loading data in R20, so PRU0 must also store R20.