cancel
Showing results for 
Search instead for 
Did you mean: 

Programming Algorithm

charlie23
Associate
Posted on August 03, 2009 at 20:31

Programming Algorithm

2 REPLIES 2
charlie23
Associate
Posted on May 17, 2011 at 13:19

Hi,

I have been working for a while with the Keil development board for the STM32F10x microcontrollers. I have just had some hardware manufactured but required more pins so have used a STM32F103ZC high density micro. I wrote a small test program and managed to program it initially first time. After that though it will not program or erase. I have worked out that the programming algorithm within uvision is for a 512K device. Initially i manually changed the address range within the device options. This caused a long list of errors. I then followed the instructions to write a programming algorithm and added the following code into the project:

#ifdef STM32F10x_256

struct FlashDevice const FlashDevice = {

FLASH_DRV_VERS, // Driver Version, do not modify!

''STM32F10x High-density Flash'',// Device Name (512kB/384kB/256kB)

ONCHIP, // Device Type

0x08000000, // Device Start Address

0x00040000, // Device Size in Bytes (256kB)

1024, // Programming Page Size

0, // Reserved, must be 0

0xFF, // Initial Content of Erased Memory

100, // Program Page Timeout 100 mSec

500, // Erase Sector Timeout 500 mSec

// Specify Size and Address of Sectors

0x0800, 0x000000, // Sector Size 2kB (128 Sectors)

SECTOR_END

};

#endif

I followed the instructions to build it, but now it will only load a low density device algorith, and gives an error message saying programming algorithm cannot be found.

Any light on this would be very helpful,

Thanks very much,

Charlie

mvi
Associate II
Posted on May 17, 2011 at 13:19

Hello Charlie,

I found a thread in the forum explain the configuration of keil. But for me it didn't work even if I set the correct RAM sizes.

I simply chose another, i. e. I chose STM32F103CB when creating the project and then change it to STM32F101CB when compiling. Its not the best solution, but it works fine for me.

-Mad