http://stm32asm.ru/407/new_clear_ram.htmlz tego co wyczytałem autor napisał ze na 300mhz raz poraz sie "zamrarza" ale przy 280mhz pracuje stabilnie
pozwoliem sobie przetłumaczyc na eng:
ps. za chwile spróbuje przetestować na zywym organizmie
Cytuj:
280 MHz Myth or Reality?
On the site I was told how quick Start from scratch. The program is written in assembler
and poured into a USB flash drive.
But!
At Pebble has a general-purpose RAM, from perfectly executed code. And I'll tell you more - it runs a little bit faster, especially when there is frequent use of FLASH memory for all sorts of constants.
But not the main thing.
USB flash drive - it's good. But it was slow. And besides, subject to zapilivanija. Imagine, if you want to correct only a single line of code and immediately see the result? And if it must be done very often? You know, if you pour into a USB flash drive tens of kilobytes of code several times a minute, once you get tired of it. Debugging code in RAM is best. This is significantly faster. A compilation of the project and fill in a few tens of thousands of lines takes fractions of seconds! Believe me, it's cool, develop code in an environment.
So let's leave the stick alone and move on to the full RAM! By the way, ARM code is by its nature completely portable. It is not tied to the absolute addresses, all addressing in it relative. You can move and move the executable code anywhere. And it certainly pleases! Now, how quick Start RAM-design from scratch! Certainly, assembly language !!
It's simple. Step one. Configure the pins BOOT0 / BOOT1 in state 11. Pull them both to positive. This will cause the stone after a reset to start with 0x00000000 address.
Step Two. Take a clean design, honed under the stick. Extract. Go Daddy in exe and open for editing stm32.ld file.
We find him in line:
ROM: ORIGIN = 0x08000000, LENGTH = 1024K
Change it to:
ROM: ORIGIN = 0x00000000, LENGTH = 1024K
So, what we are made: we tell the compiler that our executable code starts at 0x00 address.
Why do we do it? It is only one purpose: Intel's hex format will now be generated by the start address of 0x00, and when you fill in the code in the stone (obviously using the ST-Link, from the command line), it will automatically be placed in RAM at the address 0x00. Stone is reset and begins execution of code! All!
See how easy. You can still improve LENGTH, if not difficult. Although....
Vkusnyatinaa !!!
And now the surprise. Dispersal of stone up to 280 MHz. Due to the location code in RAM and the option to disable USB flash drive, it is possible to disperse the stone to a staggering frequency! First of all, you need a standard initialization code scheme of the microcontroller clock. This code displays the MC on regular 168 MHz. Not much ..
And now we will do so: the string with the configuration of PLL replace this:
MOV32 R1, + 4 (280 << 6) + (((2 >> 1) -1) << 16) + RCC_PLLCFGR_PLLSRC_HSE + (24 << 7)
A fragment of the setting instruction cache, data cache, and wait state, consisting of 4 rows, change to the line 2
@ Adjust the instruction cache, data cache, and wait state
CLR R1
STR R1, [R2]
That is, turn off the flash drive. At this frequency, the reference to it is simply a veil of stone, and it is not the gut.
That's it. Check. Kamenyuki flailed like a madman! And if you hang, reduce the frequency. My copy STM32F407V clocked up to 300 MHz with a periodic freezes and 280 MHz was already working steadily.
Of course, this mode is non-standard, and its compatibility with peripherals not been tested. But if readjust dividers system bus, then why is not it? Peripherals will work, where it go away!
p.s. in liquid hydrogen to lower fees have not tried. Stone powered by 4.5 volts - the same .. And you do not advise!