cancel
Showing results for 
Search instead for 
Did you mean: 

Download and Erase don't work in Keil

taraskorzh
Associate II
Posted on September 26, 2010 at 20:13

In Keil, if I go to Flash->Download, it says ''loaded ... DISCOVER.axf'', the red COM LED blinks couple of times, and then stays red. The whole thing seems to be hanging. When I power-cycle the device, the old firmware still runs.

Same thing about Flash->Erase. The COM LED turns on, and nothing happens. Then, after power-cycle, the old firmware is still there and works.

But if I go to Debug->Start/Stop Debug Session, and then press F5, the new firmware gets uploaded fine and works OK under debugging.

How do I fix it so that the Download and Erase work too?

#bug
18 REPLIES 18
izua
Associate II
Posted on September 27, 2010 at 19:10

I believe the discovery board has some restrictions to non-development usage, and my guess is that ST limits what is possible from the IDE (they offered st-link documentation only to keil, atollic and iar). I suppose the reasoning is that if you can't download software easily to them, you won't be able to do mass manufacturing easily with them.

I ran into the same problem, because the debugger in keil made my laptop's PSU goes nuts. Same thing happens in Atollic to some extent - and if I don't want debugging my code, just running - guess what, I'm out of luck. Neither of the three IDEs allows you to execute non-debugged code.

You can try using the ''STM32 St-Link Utility'' which is a standalone programmer software over stlink, or the AN3155 USART bootloader software (''flash loader utility'') - but you'll need extra hardware for the last one.

infoinfo968
Associate II
Posted on September 27, 2010 at 20:26

''You can try using the ''STM32 St-Link Utility'' which is a standalone programmer software over stlink, or the AN3155 USART bootloader software (''flash loader utility'') - but you'll need extra hardware for the last one.''

I'm currently writing a bootloader based tutorial series at gostm32.blogspot.com.  It is frustrating beyond belief to have to set up a serial connection via a level convertor when there's already a connection there that's about 20 times faster. (I'm on Linux so I can't use STLINK). As it has a USB Memory interface in there anyway (albeit it needs fixing) why not have it so writing a file here programs the chip rather like the MBED does ?

I think ST are completely out of their tree. This board and it's predecessor are really awesome bits of kit in what you get for what it costs, but the system is trashed completely by awful software. Getting the examples to run on the ST8 board was difficult enough. Getting it to run on the STM32 is easier, but the IDEs all have either limitations on code size, or they put up a stupid reminder screen. (I'm not a novice at MCUs either) And what on earth is the EULA with the board on about ?

Why on earth they aren't pushing this as Arduino Mk II is beyond me. They may not make any sales directly, but if they opened it up just a little bit people would pour in and use it - hardware-wise it's much cheaper than an Arduino and much more powerful. If ST want people to not use it for a final system (I reckon 99% of the target market is enthusiasts anyway) just forbid it's use in multiple identical systems.

All they really need is a working reliable programming system like Arduino has. It doesn't have to be spectacular - Arduino certainly isn't, it has no debugger for example - but it does have to work and be easy enough to pick up. It wouldn't take long to code - most of the work is in GNU ARM anyway. Throw out the wordy overcomplicated to install library and replace it with something simple. It doesn't have to be open - they can still preserve the protocols. It just needs to work. Commercial developers will still need a proper IDE anyway.

Eventually surely they'd get people who are used to programming STM32 / ARM machines coming through ? I reckon Arduino, for all its faults, is producing a generation of engineers brought up on AVR Hardware.

It is so infuriating, and it's a waste of a brilliant product.

izua
Associate II
Posted on September 27, 2010 at 21:50

I've worked with other mcus quite a bit too and it's indeed infuriating how bad the 'stock' IDEs are. The EULA also made me raise an eyebrow - so they're pushing STM32s into the market - the discovery board is definitely developed with a loss - you get two stm32s and a pinout, but they won't let you make any sort of profit out of it, by pushing your end products into the market - huh?

Arduino is backed up by the newbie friendly libraries and i guess it's more targeted toward people that don't care too much about electronics and just need to get simple stuff done. With the discovery for instance - it would have been indeed great if I could just run my code with a single keypress. None of the three IDEs let you run your code, only debug it, and you need to do at least three keypresses to make the code run. Indeed, software limitations for great hardware.

Do you have any idea how to set up gcc to stm32 on windows? I have code::blocks with mingw around, and also winavr (so essentially viming some *.c and a makefile, then typing make gives a useful image).

qili
Associate II
Posted on September 28, 2010 at 02:47

first of all, my code runs fine so I have no idea what you are talking about.

[quote]

 With the discovery for instance - it would have been indeed great if I could just run my code with a single keypress. [/quote]

let me just say that if you are expecting the same learning curve as you had on an avr, you probably are underestimating those arm chips. those arm chips are considerably more complicated to set-up and to run, and require much more involvement on the part of the programmer than do those avr chips.

qili
Associate II
Posted on September 28, 2010 at 02:54

I quite frankly don't know what you guys are talking about: the board is fairly straight forward to set-up and to run, with or without the library - if anyone needs help, I am  happy to write a little FAQ to get people started.

''

Why on earth they aren't pushing this as Arduino Mk II is beyond me.''

I suspect they aren't aiming at the hobbyist market with the chip. I don't quite understand why st or nxp is producing those boards (st32 discovery + lpcxpresso) because anyone developing commercial products don't need any of those boards, and a run-off-the-mill hobbyist doesn't have enough skills to run those boards (plus they are an overkill for 99% of whatever a hobbyist will ever do).

Those chips (not those boards) are likely targeting the 8-bit market but they are overly complicated for a typical 8-bitter programmer to handle.

I do think the nxp class b library is actually a pretty good one.

taraskorzh
Associate II
Posted on September 28, 2010 at 07:51

a.richard, this manual 

http://www.st.com/stonline/products/literature/um/17877.pdf

 says it should work - page 7 fig. 9.

I believe this is some bug. Let's try to triage: my system is 64-bit (Win7 x64). a.richard, is yours 64-bit too by chance?

Those who have it working fine, is your Windows system 32-bit?

izua
Associate II
Posted on September 28, 2010 at 12:08

Confirming win7/64 bits. You might be on to something.

Posted on September 28, 2010 at 21:31

Vista Home Basic 32-bit

I haven't confirmed that it's not erasing/writing from the direct menu options, but it does exhibit the both LEDs on, nothing happening, described by the OP. The flash->configure->settings is also non-functional.

The Debug mode does download and run firmware. The single step in the uv4 eval is a little awkward with non-linear flow through the code. This could be an optimization issue, but it is very unhelpful.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
infoinfo968
Associate II
Posted on September 28, 2010 at 21:50

It does work, if you can figure it out, which bit belongs where. It's not easy to start. Partly because of all the registration and so on.

I wouldn't agree that the ARM needs to be that more complex than an AVR.  It can be, but then most of these provided IDEs are using simple wrappers - in Arduino it's simple C functions. Most everyone starts of by turning LEDs on and off, maybe reading an ADC channel.  Turning LEDs on and off in ARM is only slightly more complicated than in AVR if you hit the metal directly (you've got to turn the clock on).

An ARM allows you to do much more quicker though, and gives people more things to learn, more skills to develop.

Surely these boards are aimed at the hobbyist ? It's a loss leader to get people used to ST products, and a way of getting them in the minds of people.

Any professional development company is not going to be bothered about the difference between $10 and $250 for a development board ? It's for tinkerers like me, and people who want to learn - or possibly for colleges. There's a whole slew of these - Launchpad, Microstick, Dragon, LPCXPresso that are cheap and cheerful - produce at cost or less to 'lure' people into STM, MSP430, PIC24, AVR, NXP processors. If these are aimed at pros, then why not charge them at cost ?