cancel
Showing results for 
Search instead for 
Did you mean: 

Bit Band access to AHB2 Peripherals on STM32F373

omri
Associate
Posted on August 20, 2013 at 17:12

Hello,

I am trying to access GPIOB registers on STM32F373 using bit banding memory access. Per the documentation, all the peripheral registers are mapped to bid-band memory locations. While it is easy to access most peripherals using bit-banding, I am unable to find any specification that maps AHB2 locations to bid-banded memory locations. for STM32F373, AHB2 is mapped to 0x48000000 which is above the peripheral bit band base at 0x42000000 from stm32f37x.h:

#define FLASH_BASE ((uint32_t)0x08000000) 
/*!< FLASH base address in the alias region */
#define SRAM_BASE ((uint32_t)0x20000000) 
/*!< SRAM base address in the alias region */
#define PERIPH_BASE ((uint32_t)0x40000000) 
/*!< Peripheral base address in the alias region */
#define SRAM_BB_BASE ((uint32_t)0x22000000) 
/*!< SRAM base address in the bit-band region */
#define PERIPH_BB_BASE ((uint32_t)0x42000000) 
/*!< Peripheral base address in the bit-band region */
/*!< Peripheral memory map */
#define APB1PERIPH_BASE PERIPH_BASE
#define APB2PERIPH_BASE (PERIPH_BASE + 0x00010000)
#define AHB1PERIPH_BASE (PERIPH_BASE + 0x00020000)
#define AHB2PERIPH_BASE (PERIPH_BASE + 0x08000000)

Any idea how I can access GPIOB using bit banding ? Thanks, Omri #stm32f37x #bit-banding
3 REPLIES 3
Posted on August 20, 2013 at 18:33

I don't think you can, but why do you need too? Don't the GPIO control registers allow bit level manipulation with a single WRITE, rather than a RMW that bit-banding would cause?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
omri
Associate
Posted on August 20, 2013 at 22:21

I am trying to move bits from memory to the GPIO using DMA, I am doing that today with BSRR set and get registers, but it's wasteful in terms of memory as I need to maintain a full byte in memory to control one bit (minimum size for DMA). with bit-banding, I'll be able to transfer one bit from memory to GPIOB using the remapped memory and registers so that i use one bit in memory for one bit in GPIO.

Posted on August 20, 2013 at 22:44

Is bit-banding viable with DMA outside the core? I'm not sure I'd have to test it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..