Posted on May 17, 2011 at 13:50 The Flash Size Infomation At 0x1ffff7e0 contain the KB size of Flash, if Flash>=128KB,then FLASH PAGE size is 2KB if not , page size is 1KB
Unfortunately DBGMCU_IDCODE is not reliable on all devices.On some it is 0 out of reset.
See the ''device limitations'' PDF's. e.g. ''Debug registers cannot be read by user software Description The DBGMCU_IDCODE and DBGMCU_CR debug registers are accessible only in debug mode (not accessible by the user software). When these registers are read in user mode, the returned value is 0x00. Workaround None.''
I thought I'd be able to use that, but the ST web site shows Connectivity Line devices, such as the STM32F105V8, with 64K of FLASH. PM0042 reads: ''The memory organization is based on a main memory block containing 32 pages of 1 Kbyte (for low-density devices), 128 pages of 1 Kbyte (for medium-density devices), 128 pages of 2 Kbyte (for connectivity line devices) or 256 pages of 2 Kbyte (for high-density devices), ...'' I take from this that the Connectivity Line devices are available with as little as 64K of FLASH, but that the page size is still 2K. This tells me that the memory size, in itself, does not imply a page size. ST has NOT done a good job documenting this. It doesn't have to be this ambiguous! Justin
''The memory organization is based on a main memory block containing 32 pages of 1 Kbyte (for low-density devices), 128 pages of 1 Kbyte (for medium-density devices), 128 pages of 2 Kbyte (for connectivity line devices) or 256 pages of 2 Kbyte (for high-density devices), ...''
I take from this that the Connectivity Line devices are available with as little as 64K of FLASH, but that the page size is still 2K. This tells me that the memory size, in itself, does not imply a page size.
It tells you the 256KB version has 128 x 2KB pages, it makes no reference to your 64KB version. You would be better served looking in the ''Flash Loader Demonstrator'' application and it's MAP files, which does appear to confirm your belief that they all have 2KB pages. [Product] Name=STM32_Connectivity-line_64K FlashSize=0040 ;;ADDR_FLASH_SIZE=1FFFF7E0; RAMSize=0014 ;;ADDR_RAM_SIZE =1FFFF7E2; PacketSize=FF ACKVAL=79 MAPNAME=Pages PagesPerSector=2 family = 1; [Page0] Name=Page0 Index=00 Address=08000000 Size=00000800 Type=111 UFO=111 ... [Product] Name=STM32_Connectivity-line_128K FlashSize=0080 ;;ADDR_FLASH_SIZE=1FFFF7E0; RAMSize=0020 ;;ADDR_RAM_SIZE =1FFFF7E2; PacketSize=FF ACKVAL=79 MAPNAME=Pages PagesPerSector=2 family = 1; [Page0] Name=Page0 Index=00 Address=08000000 Size=00000800 Type=111 UFO=111 ... [Product] Name=STM32_Connectivity-line_256K FlashSize=0100 ;;ADDR_FLASH_SIZE=1FFFF7E0; RAMSize=0040 ;;ADDR_RAM_SIZE =1FFFF7E2; PacketSize=FF ACKVAL=79 MAPNAME=Pages PagesPerSector=2 family = 1; [Page0] Name=Page0 Index=00 Address=08000000 Size=00000800 Type=111 UFO=111
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..