I was trying to execute the code below in S32 design studio (power2.1), which was designed in green hill, which basically fix 2bit error after ram fault injection but it seems that my compiler doen't know these assembly instructions, i also placed down below the original copied code from green hill
Thank you so much, it seems to solve the issue but now i have another issue: it seems that the compiler is complaining about undefined reference to one array that i created (test)
ps: the error is in the Fix_2bit_error_RAM_data function
it is referring to these lines:
i tried that solution but it still give me an error:
static void Fix_2bit_error_RAM_data(void)
/* load the address of the wrong data */
/* r30 and r31 are non-volatile regs, must be stored */
/* load data pattern to GPR30 and GPR31 */
/* write GPR30 and 31 to SRAM as one 64bit access */
/* restore r30 and r31 */
"se_mr %r30, %r4\n"
"se_mr %r31, %r5\n"
Yesterday I spend almost the whole day trying to solve this (also discussing with S32DS expert) trying everything possible.
In the end we agreed that there was apparently no way to achieve passing variable address to specific core register by inline assembler with using of GCC compiler. Even without direct register specification (only as general parameter %0) it did not work well, additionally in the code later you need to use explicitly r30/r31.
If you find some solution, please let us know.
Otherwise I would propose some other solutions -
- use GHS compiler in S32DS, what is possible, but you would have to pay for a license fo GHS
- to create a section in the linker command file (possibly with symbolic name for an address specified in LCF) and use it is you asm code
- or use hard-coded address