Okay I tried your advise. As you said it was the compiler not the driver who zero-initializied the RAM.
volatile uint32_t shared_mem_array[1024] __arttribute__((section“.my_pru_sec“)))
Linkerfile:
SECTIONS{
…
.my_pru_sec(NOLOAD) > PRU_SHAREDMEM,PAGE2
...
}
This link helped me with this problem:
https://mcuoneclipse.com/2014/04/19/gnu-linker-can-you-not-initialize-my-variable/
Thanks for your help