2010-11-04 04:16 AM
bit banding warning #170
2011-05-17 05:13 AM
Because your program works perfectly I would not worry. (Else I would have asked you to carefully inspect the generated code - stepping one assembly instruction at a time.) Although I use IAR tools and do not know for sure, I suspect that the compiler knows that addresses in the 0x22000000 range are not valid addresses.
Guessing here but you *may* have two ways of getting rid of the message. Disable warning: #170-D or find out (and correct) where the compiler the compiler “knows�? about valid RAM and I/O addresses.2011-05-17 05:13 AM
I got a solution by KEIL support which works
unsigned long bf; #define BITBAND_SRAM(a,b) ((SRAM_BB_BASE + (a-SRAM_BASE)*32 + (b*4))) #define _bf0 *((volatile unsigned int *)(BITBAND_SRAM((unsigned long)(unsigned char*)&bf,0))) #define _bf1 *((volatile unsigned int *)(BITBAND_SRAM((unsigned long)(unsigned char*)&bf,1))) I cannot see too much differences - but no more warnings and it still works solid.