2013-08-20 08:12 AM
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
2013-08-20 09:33 AM
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?
2013-08-20 01:21 PM
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.
2013-08-20 01:44 PM
Is bit-banding viable with DMA outside the core? I'm not sure I'd have to test it.