2008-03-02 04:36 AM
Urge_for_help
2011-05-17 03:25 AM
Hi,
I was attracted by the excellent STM32 and changed my product to it, but I can't flash it! I got 48pin STM32F101C8T6. I can run my program in SRAM with Ulink, but can't write the related program to flash with Ulink or Boot loader. Test conditions: MCU only power on with LDO HT7333 and add the power capacitors around MPU, not other devices connected. While using Ulink, Boot0 and Boot1 float. While using Boot loader, Boot0 10K pull up to 3.3V and Boot1 short to Gnd. Processing: Ulink: Debugger as ''ULINK Cortex Debugger'', showed : 2 JTAG Device Chain: '' 0x3BA00477, ARM Cortex-M3, 4'', '' 0x16410041, Unknown JTAG device, 5'' I can use the dubugger to debug my small gpio and uart programs running in SRAM, but can't write the related programs to Flash! My steps: 1.''Flash'' -> ''configure flash tools'' -> (ULINK Cortex Debugger)''Settings'' -> ''Add'' -> (STM32F10x128KB Flash) -> ''OK'' 2. ''Flash'' -> ''Erase'' : showed Erase done. 3. ''Flash'' -> ''Download'' : showed ''too many errors'' : verify no byte has been written. Could someone give me a clue for the problems ? Boot loader: Use window's Flash_loader unzipped from ''UM0462'' to connect my MPU through its UART1, it show PID 0(06410041) and Version (2.0), select ''STM32F10xx8xx'' and to ''Erase''/''Download''/''Upload'', problems happened: 1. Erase : If I erase ''All'' pages, it always comes out fail, if I only erase several pages( less than 20), it always comes out successful, but I upload the related page in HEX file, almost no FF inside. If I select more pages to erase, it always comes fail. 2. Download: Always fail even it's a very small program. It can't count more than 6 bytes. 3. Upload: Problems similar as ''Erase'', only successful for several pages, no more pages. IS it possible that my MPU were broken? but I tried 3 of them with the similar problems. Can somebody help? [ This message was edited by: gzxfhuang on 01-03-2008 19:03 ]2011-05-17 03:25 AM
Hi gzxfhuang,
May be you have enabled Flash protection either in Read or Write for some pages accidently. Could you please check this ? If it is the case, you should disable this protection by having a program running from RAM. Hope this helps you :) Cheers, STOne-322011-05-17 03:25 AM
Hi STOne-32,
Thank you very much for your help. It's quite possible I got the chips with protection. It seems I need some time to understand the PM0042, and write codes to disable the protection. Maybe, I could use the AN2606? Send a ''Write Unprotect(0x73)'' command or ''Readout Unprotect(0x92)'' command? Questions: 1. Does ST provide some tools for the flash protection/Unprotection? (Boot_loader(UM0462) only set the protection)? 2. Or I need to write my own tools to realize the commands in the AN2606 ? Is there the timeout limited for the command protocol? otherwise I can use some uart common tools to implement these commands? Regards Mark2011-05-17 03:25 AM
I checked the Memories by ulink. result as following:
0x40022000 : 30 00 00 00 00 00 00 00 0x40022008 : 00 00 00 00 00 00 00 00 0x40022010 : 80 00 00 00 00 00 00 00 0x40022018 : 00 00 00 00 FC FF FF 03 0X40022020 : FF FF FF FF 00 00 00 00 seems nothing wrong? [This time Boot0=1 & Boot1=0 ]