cancel
Showing results for 
Search instead for 
Did you mean: 

bit banding warning #170

Posted on November 04, 2010 at 12:16

bit banding warning #170

2 REPLIES 2
picguy2
Associate II
Posted on May 17, 2011 at 14:13

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.
Posted on May 17, 2011 at 14:13

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.