Open source *nix based flasher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2010-06-29 4:54 AM
Open source *nix based flasher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:56 AM
I've read your code, here is some recommendation:
1. don't put everything in main.c 2. setup abstract layer for com port so that it can simply have a version for windows, here is an example:http://code.google.com/p/vsprog/source/browse/trunk/src/driver/comport/comport.c
3. setup a file-parser module to parse files(bin, hex......). 4. you can use getopt.h to process input parameters 5. I find malloc in read_str, but no free() found. Of course, you don't call read_str. 6. you can add an option to define the address to execute after programming.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:56 AM
Thanks for the feedback,
I have begun making the changes you suggested, the code is still in its infancy and priority was to just get it to read/write successfully. It now has an abstracted serial interface and I am still cleaning up the stm32 code. The new serial interface has not been tested yet and requires someone to write a windows implementation for it, I don't use windows thus the need to write this program.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:56 AM
- Now has a -g option to start execution, can be combined with any other options.
- Uses getopt now
- Replaced atoi with strtoul
- Added examples to help text
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:56 AM
Don't want to rain or your parade, but you know there are existing projects?
http://mercurial.intuxication.org/hg/stm32loader http://sourceforge.net/projects/sloadhost/files/- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:56 AM
I had found stm32loader, but it is written in perl and I do not use perl at all on my systems.
As for sloadhost, after a quick look at it's code base, it is messy, does not configure the serial port properly, and is targeting more then just the stm32. Eg: ''bzero (&serialport1.newtio...'' that should never be done as it can/will clobber kernel parameters/flags set by the driver.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:56 AM
New Features
- Can resume an already initialized connection
- Detects Intel HEX or raw binary input
- Can parse Intel HEX and verify checksums
- Modular parser API so support for other formats can be added.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:56 AM
Another new feature
- Software reset from the bootloader when finished (this makes it possible to re-use the flash utility without physically re-setting the device, or specifying the -c swith)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:56 AM
Hi,
I could fix the bzeroing business if it's a problem. I got it from one of the Linux Documentation Project Howtos: I suppose I could copy the old termios into the new one, then make changes??? I do save and restore original serial port configuration on close. Too bad ST didn't release portable source code for their flash loader host. I wonder how that looks? Cheers, Alex- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:56 AM
Hi Alex,
bzeroing is a major issue, it can and will stomp on driver flags that may/will be set by the serial driver in the kernel, you should AND/OR the existing values to setup the structure. Have a look at serial_linux.c in stm32flash for an example of how to properly configure the device.
I am also restoring the old configuration on close, but that does not fix the problem, your code may fail to run on some systems as you are stomping on flags in the structure you don't know about.
I found this site much more complete and up to date:
, that howto you linked is very old.