This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2632: PRU Hex Utility output / enforce 4-byte-alignment of generated aPRU_DATA_RAM-array

Part Number: AM2632

Tool/software:

Hello,

we are using AM2632.
For both PRU0-cores we have written our own small firmware in c-code, which uses some "global" variables, These firmware files are converted to two include files, which we include in our R5-core project.
In the genertaed h-files, I get two arrays, one with the instructions and one with the data.

Loading and running of the PRU firmwares functions with the SDK-driver-lib in debug-mode without any problems. 
If I build my R5-firmware in relase mode, I always get a adat handler interrupot, when I want to load the data ram array from the pru include file to the PRU data memory.

I tried to debug this behavoir and found out, that the SDK-Lib (in release version) uses optimizer. I recompiled the SDK without optimizer, then the loading of the data array works.
But I don't want to rebuild the SDK driver library.

So I tried to understand the problem and made some further investigations.
I found out, the the data array in the generated hex file is not 4-byte-aligned in the R5-memory, in my release-configuration. And without 4-byte-allignment of the data array, SDK driver library (release-lib) fails to load data to PRU_DATA_RAM;.

So I added the the "align attribute" to the data array in the include file, like this:

const uint8_t pru0_image_1[] __attribute__((aligned(4))) = {

With the align attribute, my release configuration works fine.

Now my question:

Is it possible, to configure the PRU hex utility, to add the alignment attribute automatically?

Best regards
Jo