0
\$\begingroup\$

I am confused in the bit banding of Cortex M4. I was going through the datasheet of STM32F446ZE and found in the memory map there was only written SRAM (112 kB aliased By bit-banding) What does that mean? There is nothing specified if this region is bit band region or alias region.

enter image description here

Secondly in an example shown below from the datasheet it has given a base address of 0x22000000. Where does this comes from as there is no such memory address in the memory map? Also, I have seen the datasheet states that there are two regions one for peripherals and one for the SRAM. But only the SRAM states about it not the peripherals like GPIOs, UART etc and if I were to access/change bits of peripherals, which base address to be used?

enter image description here

enter image description here

enter image description here

Kindly help me explain the bit banding as I am not able to understand its concept properly, which addresses to use and which not.

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

That area with 0x20.. start address is the actual SRAM which you access directly for reading and writing data.

The comment in parentheses simply states that this SRAM area is also available in the bit-band alias region, which allows you to access one bit at atime in the SRAM via the bit-band alias region.

0x20000000..0x200FFFFF is the 1 Mbyte SRAM region accssible with bit-banding 0x22000000..0x23FFFFFF is the 32 Mbyte region that maps to bits in the 1 Mbyte SRAM region 0x40000000..0x400FFFFF is the 1 Mbyte peripheral region accessible with bit-banding 0x42000000..0x43FFFFFF is the 32 Mbyte region that maps to bits in the 1 Mbyte peripheral region

\$\endgroup\$
7
  • \$\begingroup\$ But where is this 32MB located in the memory Map. Also I have alot of periphrals APB1,APB2 etc. Which are approximately 2-2.5 GB. So does that mean I can only use bit banding for a small region only? \$\endgroup\$
    – kam1212
    Commented Jul 22 at 7:36
  • \$\begingroup\$ @kam1212 It is in the addresses I gave you. The datasheet map is just an overview. It looks like you can bit-band access everything except AHB2 and AHB3 . The datasheet does say that for further info read the listed document. Only 1Mbyte SRAM and 1 MByte peripherals are accessible via bit-banding. And that's fine because you rarely even find any real use for bit-banding. \$\endgroup\$
    – Justme
    Commented Jul 22 at 7:41
  • \$\begingroup\$ The SRAM in the STM32F446ZE is only 128kb. from addresses 0x2000 0000 - 0x2001 BFFF and 0x2001 C000 - 0x2001 FFFF. Secondly the 0x22000000 region is present in the reserved block in the memory map. So can it go in the reserve block? \$\endgroup\$
    – kam1212
    Commented Jul 22 at 8:46
  • \$\begingroup\$ Actually in the programming manual of the cortex m4 it states that the SRAM is 1MB the way you said but in the datasheet it gives only 128kb of SRAM and remaining part is reserved. Is the reserved area used in SRAM. Can I use it for my needs? \$\endgroup\$
    – kam1212
    Commented Jul 22 at 9:00
  • 1
    \$\begingroup\$ @kam1212 I do not understand what you are not getting. If you have 128KB of RAM you can access it directly and you can access each bit separately from bit-band area. The point is you can have up to some maximum of SRAM and up to some maximum of it can be accessed via bit-band area. And you cannot access SRAM that does not exist. Same for the peripherals, some peripherals you can access via bit banding, some you can't. The CPU core is designed for up to X amount of RAM but MCUs you can buy have that CPU core with only amount of Y memory in them. \$\endgroup\$
    – Justme
    Commented Jul 22 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.