Hi,
Does anyone know the MISRA way to call a NOP?
will produce the MISRA error:Code:asm("NOP;");
A null statements shall only occur on a line by itself, and shall not have any other text on the same line
thanks for any help,
Matt
Hi,
Does anyone know the MISRA way to call a NOP?
will produce the MISRA error:Code:asm("NOP;");
A null statements shall only occur on a line by itself, and shall not have any other text on the same line
thanks for any help,
Matt
Doesn't
work?Code:asm("nop");
doesn't appear to no
Code:syntax error is at or near text '.LN1'. Attempting error recovery by ignoring text until the ';' Previous errors prevent assembly
apologies,
I should have said i was working on VDSP5+ on a blackfin processor (bf561)
The 'C' language 'nop' is a ;
As in (in MISRA terms)
But that won't create a single "nop" instruction in the assembler, it will simply be removed.Code:while ( 1 ) ;
It's been a while since I last looked at MISRA, but aren't assembler inserts forbidden?
If you're trying to inject a small delay into the code, then you might have to do something else (call some external function outside the scope of your MISRA checked code).
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
how about
Code:asm("nop;");
i believe the double ";" on the same line is the issue.
I am using nops to reserve a large chunk of instruction memory. I think instead i'll have to do this through the linker and remove my need for asm.
thanks for any help,
Matt
> I am using nops to reserve a large chunk of instruction memory.
If your next comment is "I want to put some code there later", then why are you bothering checking with MISRA if you're going to resort to that kind of underhand programming?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
well we're hoping to get as close to MISRA with future projects as possible.
This project requires run-time loading and execution of software functions from flash, so yeah, I doubt I could ever claim to have fully MISRA compliant code.