当前位置:网站首页>Wildfire stm32f407zgt6 learning notes beginner level chapter basic knowledge points

Wildfire stm32f407zgt6 learning notes beginner level chapter basic knowledge points

2022-06-22 06:45:00 A week of studying hard to buy

Some conversion relations of memory , To understand .

1GB=1073741824 byte .

1KB=1024 byte

1M=1024KB

1G=1024MB

AHB and APB

AHB Means system bus .AHB Mainly used for high performance modules ( Such as CPU、DMA and DSP etc. ) Connection between .

APB Means peripheral bus .APB It is mainly used for the connection between peripheral peripherals with low bandwidth . stay APB The only main module inside is APB Bridge .

How to assign the address value

int *k=0x2489;// Here is an address value . The pointer k Point to 0x2489 The address of 

*k = 1;// assignment 

It should be noted that , When the pointer gives an address that is not pointed to , Cannot assign . This kind of pointer has a name “ Floating pointer ”, It cannot be assigned a value .

Register mapping

Register mapping is simple , In fact, it is the process of naming a memory unit with specific functions .

Assigning addresses to memory is called memory mapping , Reassigning an address is called remapping .//( You don't understand , Um. , I don't quite understand , Remember the concept first ~)

How to translate the address you think into the address recognized by the compiler ? By positioning the data to a pointer , Select the number of digits as required int Or some other type .

*(unsigned int *)(0x40020800+0x14) &=~(0x01<<2);

ST It provides a very convenient development library for developers . up to now , There is a standard peripheral Library (STD library )、HAL library 、LL library Three .

Address translation between the peripheral bit band and the peripheral bit alias band :

AliasAddr = 0x4200 0000 +(A-0x4000 0000)*8*4+n*4

SRAM Bit band region and SRM Address translation of bit aliased area A:

AliasAddr = 0x2200 0000 +(A-0x2000 0000)*8*4+n*4

A : Indicates address of the register where bit we want to operate is located .

n: Tag number .

One bit of the bit band area will expand into four bytes in the bit band alias area .

Peripherals and SRAM The address of the bit band alias region of the bit band region agrees to be expressed by a formula

((addr&0xF000 0000)+0x0200 0000+((addr & 0x00FF FFFF)<<5)+(bitnum<<2))

addr: Address of the register where the bit to be operated is located .

bitnum: Tag number , Which bit of the register .

原网站

版权声明
本文为[A week of studying hard to buy]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202220547565851.html