27-03-2014, 10:31 AM
A cast should not be performed between a pointer type and an integral type, this casts from type "unsigned int" to "uint32_t volatile *" (MISRA C 2004 rule 11.3)
In two cases this error occurs on my system (ARM Cortex M3 with IAR workbench and MISRA check from IAR):
1. Access to registers.
2. Access to RAM (during a cyclic RAM test).
Is there any way conform to MISRA C2004 for the following code?
In two cases this error occurs on my system (ARM Cortex M3 with IAR workbench and MISRA check from IAR):
1. Access to registers.
2. Access to RAM (during a cyclic RAM test).
Is there any way conform to MISRA C2004 for the following code?
Code:
register uint32_t address; /* during the critical section no RAM access other than the test access may occur */
register uint32_t pattern;
...
*(volatile uint32_t *)address = pattern;
<t></t>