I read AN3784 and I have to do the following:
"
Variables in Banked RAM
Before accessing a banked RAM location, the compiler needs to insert instructions that write an appropriate
value into the RPAGE register. The syntax to instruct the compiler to do this is:
#pragma DATA_SEG __RPAGE_SEG PAGED_RAM
"
I tried with this correction and it's working now.
Regards