STM32F1 Memory & Bus

Started by tha, October 22, 2020, 08:07:25 AM

Previous topic - Next topic

tha

3.1 System architecture
ใน low-, medium-, high- and XL-density devices, the main system ประกอบด้วย :
• Four masters:
     – Cortex® -M3 core DCode bus (D-bus) และ System bus (S-bus)
     – GP-DMA1 & 2 (general-purpose(วัตถุประสงค์ทั่วไป) DMA)
• Four slaves:
     – Internal SRAM
     – Internal Flash memory
     – FSMC
     – AHB ไปยัง APBx (APB1 หรือ APB2), ซึ่งต่อ the APB peripherals ทั้งหมด
สิ่งเหล่านี้เชื่อมต่อกันโดยใช้ a multilayer AHB bus architecture ดังแสดงใน Figure 1:


tha

ใน connectivity line devices the main system ประกอบด้วย :
• Five masters:
     – Cortex® -M3 core DCode bus (D-bus) and System bus (S-bus)
     – GP-DMA1 & 2 (general-purpose DMA)
     – Ethernet DMA
• Three slaves:
     – Internal SRAM
     – Internal Flash memory
     – AHB ไปยัง APB bridges (AHB ไปยัง APBx), ซึ่งต่อ the APB peripherals ทั้งหมด
สิ่งเหล่านี้เชื่อมต่อกันโดยใช้ a multilayer AHB bus architecture ดังแสดงใน Figure 2:


tha

ICode bus
bus นี้ต่อ the Instruction bus ของ the Cortex®-M3 core ไปยัง the Flash memory instruction interface. Prefetching ถูกกระทำบน bus นี้.

DCode bus
bus นี้ต่อ the DCode bus (literal load และ debug access) ของ the Cortex®-M3 core ไปยัง the Flash memory Data interface.

System bus
bus นี้ต่อ the system bus ของ the Cortex®-M3 core (peripherals bus) ไปยัง a BusMatrix ซึ่งจัดการ the arbitration(การชี้ขาด) ระหว่าง the core และ the DMA.

DMA bus
bus นี้ต่อ the AHB master interface ของ the DMA ไปยัง the BusMatrix ซึ่งจัดการการเข้าถึงของ CPU DCode และ DMA ไปยัง SRAM, Flash memory และ peripherals.


tha

BusMatrix
The BusMatrix จัดการ the access arbitration(การตัดสินการเข้าถึง) ระหว่าง the core system bus และ the DMA master bus. The arbitration ใช้ a Round Robin algorithm. ใน connectivity line devices, the BusMatrix ประหอบด้วย 5 masters (CPU DCode, System bus, Ethernet DMA, DMA1 และ DMA2 bus) และ 3 slaves (FLITF, SRAM และ AHB2APB bridges). ใน mcu เบอร์อื่น, the BusMatrix ประกอบด้วย 4 masters (CPU DCode, System bus, DMA1 bus และ DMA2 bus) และ 4 slaves (FLITF, SRAM, FSMC and AHB2APB bridges).

AHB peripherals ถูกต่อบน system bus ผ่านทาง a BusMatrix เพื่อยอมให้ DMA access.

AHB/APB bridges (APB)
The two AHB/APB bridges จัดให้มี full synchronous connections ระหว่าง the AHB และ the 2 APB buses. APB1 ถูกจำกัดไว้ที่ 36 MHz, APB2 ทำงานที่ full speed (ขึ้นไปถึง 72 MHz ขึ้นอยู่กับเบอร์ mcu).

อ้างอิงถึง Table 3 สำหรับ the address mapping ของ the peripherals ต่อถึงแต่ละ bridge.

หลังจากแต่ละ mcu reset, peripheral clocks ทั้งหมดถูกปิดการใช้งาน (ยกเว้นสำหรับ the SRAM และ FLITF). ก่อนการใช้ a peripheral คุณต้องเปิดการใช้งาน clock ของมันใน the RCC_AHBENR, RCC_APB2ENR or RCC_APB1ENR register.

Note: เมื่อ a 16- or 8-bit access ถูกกระทำบน an APB register, การเข้าถึงถูกแปลงเป็น a 32-bit access: the bridge จะซ้ำ the 16- หรือ 8-bit data เพื่อป้อนเป็น the 32-bit vector.

tha

3.2 Memory organization
Program memory, data memory, registers and I/O ports ถูกจัดระเบียบไว้ใน the same linear 4-Gbyte address space.

The bytes เหล่านี้ถูกเข้าระหัสใน memory ใน Little Endian format. The lowest numbered byte ใน a word ถูกถือเป็น the word's least significant byte และ the highest numbered byte the most significant.

สำหรับ the detailed mapping of peripheral registers อ้างอิงถึง the related sections(ส่วนที่เกี่ยวข้อง).

The addressable memory space ถูกแบ่งออกเป็น 8 main blocks, แต่ละ main block มี 512 MB.

the memory areas ทั้งหมดที่ไม่ได้ถูกจัดสรรให้ on-chip memories และ peripherals ถูกถือเป็น "สงวนไว้"). อ้างอิงถึง the Memory map figure ใน the corresponding product datasheet.

tha

3.3 Memory map
ดู the datasheet ที่ตรงกับเบอร์ mcu ของคุณสำหรับแผนภาพที่ครอบคลุมของ the memory map. Table 3 ให้ the boundary addresses ของ the peripherals ที่มีให้ใช้ในทุก STM32F10xxx devices



ปล. ไปถึงไหนกันแล้ว ทำโปรแกรม ผมจะไม่ทำโปรแกรมนะ จะแปลอย่างเดียว ให้ทีมงานทำโปรแกรมไปนะครับ

tha


tha



1. การแชร์ SRAM นี้สามารถถูกเข้าถึงอย่างเต็มที่เพียงใน low-, medium-, high- and XL-density devices, ไม่มีใน connectivity line devices.