2008-12-04 02:57 AM
Unique device ID
2011-05-17 03:54 AM
Hi
I am trying to get information about the unique device ID of the STM32. Is it possible to get the type of STM32 out of the ID? Actually I only need to know the SRAM-size while running. Are there any other possibilities to get the SRAM-size in a running programm when the current target is unknown?2011-05-17 03:54 AM
Hi,
I use this in my code: ---------- #define FLASH_SIZE_IN_K_ADDRESS 0x1FFFF7E0 #define RAM_SIZE_IN_K_ADDRESS 0x1FFFF7E2 printf( ''%uk Flash\r\n%uk RAM\r\n'', *(u16*)FLASH_SIZE_IN_K_ADDRESS, *(u16*)RAM_SIZE_IN_K_ADDRESS ); ---------- ST have stated that the ram size location should not be used any more -- see this thread: Indeed some of the old development boards incorrectly report a size of 64k when they are actually 20k. Knowing the flash size is very useful for making code work on all devices e.g. allows you to know if flash pages are 1k or 2k. Hope this helps Trevor[ This message was edited by: trevor on 03-12-2008 10:58 ]2011-05-17 03:54 AM
Hi
Thanks for the answer. Meanwhile I found those registers by myself. But the link you posted does not work. Is there an official statement that the RAM-SIZE-LOCATION should not be used?2011-05-17 03:54 AM
Hi dschneeweis;
Try this link: www.st.com/mcu/forums-cat-7623-23.html B.R. M3allem2011-05-17 03:54 AM
@M3allem: Thanks for the link.
I can't understand why they removed the RAM-SIZE-Location. How can I get the RAM-Size while running? I have to do an startup-test over the entire RAM. To keep this test compatible to all STM32 devices I n2011-05-17 03:54 AM
Because you can find out the flash size you know the ram size (as long as you know whether you are on a ''performance line'' or ''access line'' device). e.g.
// performance line int get_ram_size_in_k( int flash_size_in_k) { switch (flash_size_in_k) { case: 512: case: 384: return 64; case: 256: return 48; case: 128: case: 64: return 20; } return -1; // error } [ This message was edited by: trevor on 04-12-2008 16:36 ]