cancel
Showing results for 
Search instead for 
Did you mean: 

What does "Bit-Band Operation of Different Data sizes" mean?

Junde
Senior II

Hi, 

I am reading the book <<The Definitive Guide to the ARM Cortex-M3>>, and I see some descriptions below, but I really don't know what it really means.

0693W00000bhPSYQA2.png 

Could you explain it to me?

Thanks very much.

2 REPLIES 2
FBL
ST Employee

Hello @Junde​,

Bit band accesses can use byte, halfword, or word transfers. The bit band transfer size matches the transfer size of the instruction making the bit band access.

You may refer to The Cortex-M4 processor Programming Manual section 2.2.5 Bit-banding for further details.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

@F.Belaid​ 

Thanks for your reply.

I read the programming manual, but I still can't understand that.

Let me give you an example:

// word access
int var = *(uing32_t*)(0x22000000);    // this will get the bit0 of 0x20000000 address
*(uing32_t*)(0x22000000) = 0;            // this will set the bit0 of 0x20000000 address
*(uing32_t*)(0x22000000) = 1;            // this will clear the bit0 of 0x20000000 address
 
// byte access, could you give me some examples? thanks

Thanks.