summaryrefslogtreecommitdiff
path: root/src/flash/nor/stm32x.c
Commit message (Collapse)AuthorAgeFilesLines
* stm32x : always use valid flash base addressSpencer Oliver2010-12-231-0/+3
| | | | | | | This change matches the previous behaviour of using the known flash address. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* stm32: fix reversed option byte writeSpencer Oliver2010-12-231-4/+4
| | | | | | This has been a long standing bug that has never been spotted. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* stm32: update option bytes for stm32xl familySpencer Oliver2010-12-231-8/+79
| | | | | | | add supoort for xl family boot bank option. The option byte handling will be cleaned up in a later patch. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* stm32: add stm32 xl family flash supportSpencer Oliver2010-12-231-1/+45
| | | | Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* stm32: add dual flash bank supportSpencer Oliver2010-12-231-26/+37
| | | | | | | This patch adds the initial dual flash bank support for devices such as the stm32xl family. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* stm32: fix unprotectØyvind Harboe2010-12-151-4/+11
| | | | | | | | | the unprotect fn in stm32 needs to unprotect more sectors than was requested aligned to some boundary. Print warning when this happens. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* FLASH/NOR: Remove useless file stm32x.hAntonio Borneo2010-11-171-1/+74
| | | | Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* Add comments and tiny improvements to STM32 flash loader algorithmFreddie Chopin2010-11-151-16/+17
| | | | | | | | Add comments to assembly flash loader for STM32. Add tiny improvement in size of the algorithm (40 vs 48 bytes) and tiny speed improvement (~1.5%, as time is wasted on waiting for end of operation anyway). Signed-off-by: Freddie Chopin <freddie_chopin@op.pl>
* stm32: return early upon block write failureØyvind Harboe2010-11-091-0/+3
| | | | | | only if we do not have enough ram do we continue. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* stm32: return error when failing to readØyvind Harboe2010-11-091-9/+25
| | | | | | | | | add missing error handling. Output warning when assuming maximum flash size in the family when failing to read. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* stm32: add error propagation on writesØyvind Harboe2010-11-091-42/+111
| | | | | | catch problems earlier. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* stm32: sharpen error handling for timeoutsØyvind Harboe2010-11-091-108/+69
| | | | | | delete lots of crud by handling this all in one spot. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* src: add loader src descriptionSpencer Oliver2010-10-281-0/+3
| | | | | | - add comment where to find the various loaders src files. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* flash: remove algorithm exit_point address for supported targetsSpencer Oliver2010-07-201-1/+1
| | | | | | | | | For the above targets the exit_point is optional when used with run_algorithm, so remove it. This makes updating the algorithm less error prone. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* stm32x: -Wshadow warning fixesØyvind Harboe2010-06-161-2/+2
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* stm32 : change returned value of mass_erase functiongcembed2010-06-031-4/+5
| | | | | | | | | | | | | | Hello, "stm32x mass_erase" return ERROR_OK even if something goes wrong. Here is a summary of changes : * in stm32x_mass_erase : return ERROR_FLASH_OPERATION_FAILED when error detected in FLASH_SR register; * in COMMAND_HANDLER(stm32x_handle_mass_erase_command) : return the returned value of stm32x_mass_erase(). I don't know if there is reason to always return ERROR_OK ? Gaëtan
* nor: fix memory leaks during probeSpencer Oliver2010-05-291-0/+6
| | | | | | | Fix similar memory leaks as per commit: ef72484b785ec7462a0415afea679d08b864c7fb Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* NOR: add read() callback to struct flash_driverAntonio Borneo2010-05-161-0/+1
| | | | | | | | | | | | | | Final target is to force bus_width size during CFI flash read. In this first step I need to replace default flash read with flash specific implementation. This patch introduces: - flash_driver_read() layer; - default_flash_read(), backward compatible; - read() callback in struct flash_driver; - proper initialization in every flash_driver instance. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* flash: less bogus errorsØyvind Harboe2010-05-041-1/+1
| | | | | | | Removed bogus errors when trying to allocate a large a target memory buffer as possible. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* STM32 flash erase timeout fixTobias Ringström2010-05-031-2/+2
| | | | | | | | | | | | | | | The current timeout for STM32 flash block erase and flash mass erase is 10 (ms), which is too tight, and fails around 50% of the time for me. The data sheet for STM32F107VC specifies a maximum erase time of 40 ms (for both operations). I'd also consider it a bug that the code does not detect a timeout, but just assumes that the operation has completed. The attached patch does not address this bug. The attached patch increases the timeouts from 10 to 100 ms. Please apply. /Tobias
* stm32x: allow flash probe on a running targetAndreas Fritiofson2010-04-201-6/+0
| | | | | | | | | | | | | | | If the flash has not yet been probed and GDB connects while the target is running, the flash probe triggered by GDB's memory map read will fail. In that case the returned memory map will be empty, causing a subsequent load from within GDB to fail. There's not much you can do from GDB to recover, other than a restart; a 'mon reset init' and manual 'mon flash probe' won't help since GDB has already made up its mind about the memory map. It seems there's no reason to require the target to be halted when probing the flash. Remove the check to let a valid memory map be provided to GDB even when connecting to a running target. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
* STM32: flash loader cleanupSpencer Oliver2010-03-101-12/+25
| | | | | | - make algorithm array static const. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* STM32: Add Value Line Flash Programming SupportSpencer Oliver2010-03-031-0/+36
| | | | Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* ARMv7M: use software breakpoints for algorithmsSpencer Oliver2010-02-281-2/+1
| | | | | | | | - armv7m_run_algorithm now requires all algorithms to use a software breakpoint at their exit address - updated all algorithms to support this Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* STM32x: issue warning when unlocking device (bug #16)Spencer Oliver2010-02-121-2/+6
| | | | | | | Issue warning to user when unlocking or writing the option bytes. The new settings will not take effect until a target reset. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* NOR: cleanup driver declsDavid Brownell2010-01-291-17/+17
| | | | | | Fix goofy struct indents. Function names *are* their addresses. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* src/flash/nor: usage/help/doc updatesDavid Brownell2010-01-091-13/+22
| | | | | | | | | | | | | Make "usage" messages use the same EBNF as the User's Guide; no angle brackets. Improve and correct various helptexts. Don't use "&function"; a function's name is its address. Remove a couple instances of pointless whitespace; shrink a few overlong lines; fix some bad indents. Add TODO list entry re full support for NAND/NOR bank names. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* stm32x commands get "usage"Freddie Chopin2009-12-281-0/+5
| | | | | | | | Add .usage fields to stm32x command_registration, so that "help stm32x" shows required parameters. Signed-off-by: Freddie Chopin <freddie_chopin@op.pl> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* remove target.h from flash.hZachary T Welch2009-12-041-1/+2
| | | | | The flash.h header does not require the target.h header file, but its implementation source files do. Move it to flash/nor/imp.h.
* change #include "armv7m.h" to <target/armv7m.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "armv7m.h" the following form should be used. #include <target/armv7m.h> The exception is from .c files in the same directory.
* change #include "algorithm.h" to <target/algorithm.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "algorithm.h" the following form should be used. #include <target/algorithm.h> The exception is from .c files in the same directory.
* change #include "binarybuffer.h" to <helper/binarybuffer.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "binarybuffer.h" the following form should be used. #include <helper/binarybuffer.h> The exception is from .c files in the same directory.
* move nor drivers to src/flash/norZachary T Welch2009-12-021-0/+1240
Moves NOR flash drivers to 'src/flash/nor/'. Adds 'src/flash/nor/Makefile.am'. Builds 'libocdflashnor.la'.