2011-05-01 10:54 AM
I am new to ARM.
I got the STM32 Discovery board. (STM32F103RGT6 chip) I made a quick code that uses the serial port.(code I copied from Keil website that uses the serial port, and just modified very slightly so it always output same char on the serial terminal) I loaded the hex via ST-Link program. It seems that the board worked, where I can see output on the serial terminal. Now for some reason, I cannot do anything with this board, it will not load any hex, well It does, but once I press the reset button, ST-Link tells me that the chip is blank, and keeps telling me this error ''Read Out Protection is Enabled'', even though I did not enable any protection that I can think off. it seems that the ''Read Out Protection'' is always enabled in the ''Options Bytes''. I disable it and do apply, and program the hex, but once I push the reset button, it seems that the code is erased, and the board does not do anything. please help me, I am very tired of this thing. In the ST-Link utility, I do connect, then program the device, then I press disconnect, then I press the reset button on the board, then when I press connect on the st-link utility, I see that the device memory blocks are all FF, even though I did not do an erase. why is that? All I want is program this thing with some code, and learn from it. I am not interested in enabling any read/write protection. I just want it to work. One thing to add, I for some reason decided to update the firmware of the ST-Link from ST site http://www.st.com/internet/evalboard/product/219866.jsp #ff-empty-memory-flash-st-link2011-05-01 01:31 PM
Well you could always download the demo/eval version of Keil uv4 and use that. Use the Build and the Debug function to download the code, rather than Flash.
It's certainly possible to brink the VL, but hard to see how some simple serial code would do it.2011-05-01 03:20 PM
Hi,
It seems that the board is not bricked after all. I did erase all blocks and deleted the old project and that seems to have fixed it. yes, I am using Keil UV4 Demo. At first I had no idea how to get this thing working with Keil. At a last resort, I tried ST-Link to download the hex. (by doing that, did I delete essential code from the demo board that needs to be there?) By the way, I am really new to this, I tried a demo program from stm32vldiscovery_package (AN3268) , the GPIO one, and I got it to work. It seems that all you do is in Keil, is build the project, then press debug and run, but how does it work, whats happening in the background, is keil loading a hex to the board or is it running code in ram with a built in bootloader and once you remove power, the code is essentially is gone Is there a book for real dummies that can teach me how to work with this thing? I am finding information to be sparse and only makes sense to an ARM coder with years of experience.2011-05-01 04:13 PM
With the VL board you typically don't use the ROM boot loader as it doesn't have a serial port attached. It's selected with the BOOT pins, and you can't erase it.
The ST-LINK firmware is on the STM32 at the USB end of the board, this is not where your code resides, that's typically the STM32F100 part (103 in your case) at the other end of the board. The demo app in Keil will build and gets downloaded to FLASH, the debug option normally has the ''update target before debugging'' checked and thus a side effect of trying to debug you code is that it is written to flash. It will be there next time you start up the board. The stand-alone Flash->Download is buggy on most versions I've checked recently, a bug in the ST-Link/Keil driver code. There is nothing useful in the flash for you to worry about. Your application or the demo goes there, the delivered demo can be recompiled in Keil. Keil generally creates an AXF file with the application in it, you can check a box for the linker to generate HEX files. The applications can also be built to run in RAM to, but that might be ahead of where you are right now. Joseph Yiu's book on the Cortex M3 is quite a good one, and certainly will have a lot of material which will be particularly useful for an STM32 user. Some of the older books dealing with ARM7 and ARM9 parts probably won't be much help as the M3 is markedly different. ARM does have a very good collection of technical documentation that is either web searchable, or available as a free PDF download.2011-05-01 04:25 PM
First Edition (2007)
http://www.alibris.com/booksearch?qisbn=9780750685344&qwork=12110762#search-anchor Second Edition (2009) http://www.alibris.com/booksearch?qisbn=9781856179638&qwork=12110762#search-anchor http://www.amazon.com/Definitive-Guide-ARM-Cortex-M3-Second/dp/185617963X/ref=sr_1_1?ie=UTF8&qid=1304292271&sr=8-12011-05-02 12:34 AM
Thank you for the book suggestions. I will get it and start reading. If you know of other references that would help me understand the big picture, that would be great too
2012-01-24 12:22 PM
I think I know what you did! It screwed me up for a bit too!
In the ST-Link utility there is a box near the top that has fields for address, size, and data width. You probably have the wrong address in the address box for some reason. That is the start address for the memory readout. If you have 0x2000 where many boot loaders end you'll be reading empty memory that is after the end of what is programmed. Empty memory will be FF, so that may be why you're seeing all FFs.You will want to start at the start of memory. So put ''0x08000000'' in the address box.