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.
Hello,
I'm trying to create my own analog for __delay__cycles() for am335x PRU with a variable argument not a constant as it is in original function.
I wrote the following code but the compilation gives me some error.
void delay(register uint32_t x) { __asm__ __volatile__ ( " WAIT: \n" " SUB r14, r14, 1 \n" " QBNE WAIT, r14, 0 \n" ); }
and hereare errors:
ERROR! at line 1043: [E0003] Invalid instruction
WAIT:
ERROR! at EOF: [E0300] The following symbols are undefined:
WAIT
I didn't found the right way of using labels in inline asm in datasheets.
How to make it?
A label must start on column 1 of a line, since leading white-space causes a token to be treated as an instruction. i.e. try:Gigo Dret said:I didn't found the right way of using labels in inline asm in datasheets.
void delay(register uint32_t x) { __asm__ __volatile__ ( "WAIT: \n" " SUB r14, r14, 1 \n" " QBNE WAIT, r14, 0 \n" ); }
See section 4.5 Source Statement Format of PRU Assembly Language Tools v2.1 User's Guide SPRUHV6A for more details.
Consider using the compiler intrinsic __delay_cycles instead. Search for it in the PRU compiler manual.
Thanks and regards,
-George