2012-06-17 10:17 PM
Hi i have stm32f100rb mcu and i need to have custom memory map on it
it can be a virtual memory which looks like from outside like or something like memory remap i was never doing somethink like that and i dont even know if its possible.... for example - program running on pc want to read ram from 0x00000 to 0x0FFFF - but sram on the stm32f is from 0x1FFFFFFF to 0x3FFFFFFF so its there some way to have (0x00000-0x0FFFF)Block of memory on procesor sram address... the device must have this memory map 0x0 - 0x0FFFF - SRAM 0x10000-0x7FFFF - eeprom - external 0x80000 -0xEFEEE - CODE 0xF0000 - 0xFFFFF flash storage thanks for yours answers .... and have a nice day ... #stm32f #map #memory #remapping2012-06-18 05:13 AM
Basically, No.
How does the PC specify the address is wants to read, and why can't you translate that? If it is a request that the STM32 processes, just add some conversion code.2012-06-18 05:36 AM
pc send me a packet where is address Lo and adress Hi and i must send data from this part of memory or write in memory ....
soooo when i use block of ram 0x20000000-0x2000FFFF and when i will read from or write in a will be showing that is 0x00000-0x0FFFF it will be no problem .... for example monitoring program on PC want to read memory 0x00000-0x00001 - in fact i will be send what i have in processor at adress 0x20000000-0x20000001 am i right ? its sounds quite simply..... thanks for your answer ...2012-06-18 06:12 AM
just a caution, the sram will also contain your code variables. If the PC just reads, then it is fine. If you want to try Write-Read for verification, you may corrupt your code variables.
In addition, do take care that if you Read/write on an adderess which does not exist, you may encounter HardFault.2012-06-18 10:12 AM
You will probably run into problems if you can't tailor your PC application to the hardware it's attached too. It would clearly need to understand what code it is sending to an STM32 part, but you don't provide a sufficiently through context to fully understand the problem.
Simple address translation on the STM32 side could look something like this :if ((Address >= 0x00000) && (Address <= 0x0FFFF))
STM32Address = 0x20000000 + (Address - 0x00000); // RAM conversion
if ((Address >= 0xF0000) && (Address <= 0xFFFFF))
STM32Address = 0x08000000 + (Address - 0xF0000); // FLASH conversion
2012-06-25 11:07 PM
Thanks a lot ...
i use data packets to comunicate with pc and on 4. position of packet pc send me in upper byte segment part of memory and in lower byte lenght of memory block - in other positions of packet is data.... for example packet[4]=0x05 packet[5]=0x10 packet[6]=0x00 so i should start read on adress 0x01000 - 0x01005 but physicly i read from adress 0x20000000+0x01000 to 0x20000000+0x01005 if packet[4]=0xF5 packet[5]=0x10 packet[6]=0x00 so i should start read on adress 0xF1000 - 0xF1005 but physicly i read from adress 0x80000000+(0xF1000 - 0xF0000) to 0x80000000+(0xF1005 - 0xF0000) and it will be used only for read memory i think and send it for check on pc...2012-06-26 06:49 AM
use the 'address' as offset into an array
Erik