STM32F1 Memory & Bus

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

Previous topic - Next topic

tha

3.3.1 Embedded SRAM
The STM32F10xxx มีคุณสมบัติมากถึง 96 Kbytes ของ static SRAM. มันสามารถถูกเข้าถึงได้เป็นแบบ bytes, half-words (16 bits) หรือ full words (32 bits). The SRAM start address คือ 0x2000 0000.

3.3.2 Bit banding
The Cortex®-M3 memory map ประกอบด้วย two bit-band regions. regions เหล่านี้ map แต่ละ word ใน an alias region ของ memory ไปยัง a bit ใน a bit-band region ของ memory. การเขียนไปยัง a word ใน the alias region มีผลเดียวกันกับ a read-modify-write operation บน the targeted bit ใน the bit-band region.

ใน the STM32F10xxx ทั้ง peripheral registers และ SRAM ถูก mapped ใน a bit-band region. นี้ยอมให้ single bit-band write และ read operations ถูกปฏิบัติ. The operations นี้มีให้ใช้สำหรับเพียง Cortex®-M3 accesses เท่านั้น, ไม่มีจาก bus masters อื่นๆ (e.g. DMA).

A mapping formula แสดงวิธีการอ้างอิงแต่ละ word ใน the alias region ไปยังบิตที่ตรงกันใน the bit-band region. The mapping formula เป็นดังนี้ :

bit_word_addr = bit_band_base + (byte_offset x 32) + (bit_number × 4)

ที่:
bit_word_addr คือ the address ของ the word ใน the alias memory region ที่ maps ไปยัง the targeted bit.
bit_band_base คือ the starting address ของ the alias region
byte_offset คือจำนวนของ the byte ใน the bit-band region ที่บรรจุ the targeted bit
bit_number คือ the bit position (0-7) ของ the targeted bit.

Example:
ตัวอย่างดังต่อไปนี้แสดงวิธีทำแผนที่ถึงกัน(map) bit 2 ของ the byte ตำแหน่งอยู่ที่ SRAM address 0x20000300 ใน the alias region:

0x22006008 = 0x22000000 + (0x300*32) + (2*4).

การเขียนไปยัง address 0x22006008 มีผลเดียวกันกับ a read-modify-write operation บน bit 2 ของ the byte ที่ SRAM address 0x20000300.

การอ่าน address 0x22006008 คืนค่า (0x01 หรือ 0x00) ของ bit 2 ของ the byte ที่ SRAM address 0x20000300 (0x01: bit set; 0x00: bit reset).

สำหรับข้อมูลที่มากขึ้นบน Bit-Banding อ้างอิงถึง the Cortex®-M3 Technical Reference Manual.

tha

อันนี้มีรูปให้ดูด้วย พอจะเข้าใจดีขึ้นหรือเปล่า https://os.mbed.com/cookbook/bit-banding

tha

3.3.3 Embedded Flash memory
The high-performance Flash memory module มีคุณสมบัติหลักดังต่อไปนี้:
• สำหรับ XL-density devices: ความหนาแน่นขึ้นไปถึง 1 Mbyte พร้อมด้วย dual bank architecture สำหรับความสามารถ read-while-write (RWW) :
     – bank 1: ขนาดคงที่ 512 Kbytes
     – bank 2: ขึ้นไปถึง 512 Kbytes
• สำหรับ mcu เบอร์อื่นๆ : ความหนาแน่นขึ้นไปถึง 512 Kbytes
• Memory organization: the Flash memory ถูกจัดระเบียบเป็น a main block และ an information block:
     – Main memory block มีขนาด :
        ขึ้นไปถึง 128 Kbytes × 64 bits แบ่งออกเป็น 512 หน้าๆละ 2 Kbytes (ดู Table 8 ) สำหรับ XL-density devices
        ขึ้นไปถึง 4 Kb × 64 bits แบ่งออกเป็น 32 หน้าๆละ 1 Kbyte สำหรับ low-density devices (ดู Table 4)
        ขึ้นไปถึง 16 Kb × 64 bits แบ่งออกเป็น 128 หน้าๆละ 1 Kbyte สำหรับ medium-density devices (ดู Table 5)
        ขึ้นไปถึง 64 Kb × 64 bits แบ่งออกเป็น 256 หน้าๆละ 2 Kbytes (ดู Table 6) สำหรับ high-density devices
        ขึ้นไปถึง 32 Kbit × 64 bits แบ่งออกเป็น 128 หน้าๆละ 2 Kbytes (ดู Table 7) สำหรับ connectivity line devices
     – Information block of size:
        770 × 64 bits for XL-density devices (see Table 8 )
        2360 × 64 bits for connectivity line devices (see Table 7)
        258 × 64 bits for other devices (see Table 4, Table 5 and Table 6)

The Flash memory interface (FLITF) features:
• Read interface with prefetch buffer (2x64-bit words)
• Option byte Loader
• Flash Program / Erase operation
• Read / Write protection


tha


tha


tha


tha


tha





Note: สำหรับข้อมูลเพิ่มเติมเกี่ยวกับ the Flash memory interface registers, อ้างอิงถึง the:"STM32F10xxx XL-density Flash programming manual" (PM0068) สำหรับ XL-density devices, "STM32F10xxx Flash programming manual" (PM0075) สำหรับ mcu เบอร์อื่นๆ.