aboutsummaryrefslogtreecommitdiff
path: root/src/flash
AgeCommit message (Collapse)Author
2013-09-25build: fix NetBSD build warningPetri Laakso
Seems NetBSD does like the name reboot, so rename to keep happy. Change-Id: I60ada9d217c4a8386a8d1ff1c88db7335451794e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1623 Tested-by: jenkins Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2013-09-13flash: add Nuvoton NUC910 series supportNemui Trinomius
Not tested, adapted from http://tech.groups.yahoo.com/group/versaloon/message/391 Change-Id: Ic3273e64fd99bffab16764b06227e09a05d07c8f Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1510 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
2013-09-08fm3: add Fujitsu MB9Ax family supportNemui Trinomius
Not tested, adapted from http://tech.groups.yahoo.com/group/versaloon/message/391 Change-Id: I52048f6e8e66b38087fa249eb66ceab6801d07d5 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1506 Tested-by: jenkins
2013-09-08atmega: add new target supportNemui Trinomius
Not tested, adapted from http://tech.groups.yahoo.com/group/versaloon/message/391 Change-Id: I6d6af10fb07ea43cc1196a90d8738957f8266938 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1507 Tested-by: jenkins
2013-09-08flash: add NXP LPC800 supportNemui Trinomius
Not tested, adapted from http://tech.groups.yahoo.com/group/versaloon/message/391 Change-Id: I142fa6f29e66fd334baca14217aca97e1fc6c7d9 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1509 Tested-by: jenkins
2013-09-08mini51: support for Nuvoton NuMicro Mini51 series flash memoryCosmin Gorgovan
Adds a flash driver for Nuvoton MINI51, MINI52 and MINI54 microcontrollers. At the moment, it only supports the erase and write operations. These microcontrollers have a 4 / 8 / 16 KB APROM for application code and a 2 KB LDROM for bootloaders. When the MCU has booted off the APROM, the LDROM isn't mapped in memory but can be programmed, and the other way around. This means that the ARM core is typically rebooted for programming. After a successful write or erase operation, it is rebooted again, using the initial boot source. This driver only supports programming the APROM. This driver is a pure JTAG implementation, it doesn't use any SRAM. I've tested it on a MINI54ZAN microcontroller using an ST-LINK/V2. With the microcontroller running at the default clock frequency of 22.1184 MHz, speed seems to be around 1.1 KB/s. Change-Id: I180889c55af9fb5614cd99a953b755baba14288a Signed-off-by: Cosmin Gorgovan <cosmin@linux-geek.org> Reviewed-on: http://openocd.zylin.com/1546 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-09-08kinetis: add kl flash supportSpencer Oliver
Not tested, adapted from http://tech.groups.yahoo.com/group/versaloon/message/391 depends on http://openocd.zylin.com/1602 Change-Id: Ib846be48500a28d515c6dbd3ca2a5c1719cd74d4 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1508 Tested-by: jenkins Reviewed-by: Chris Fryer <chrisf1874@gmail.com> Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
2013-08-29flash: fix stm32f1x dual bank detectionSpencer Oliver
Not all devices with devce id 0x419 have dual flash banks, only those with > 1024kB. Change-Id: I197d2b87df7599cd0837e25648af48439f2f1e50 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1544 Tested-by: jenkins
2013-08-15stm32lx flash: fix flash size for Medium+ devicesAndrey Yurovsky
Unfortunately the Medium+ density and 0x436 devices have their F_SIZE register at a different location: 0x1FF800CC instead of 0x1FF8004C. Fix this for the 0x427 Medium+ devices and also the 0x436 devices. Furthermore, for 0x436 devices the flash size is reported as a 0 or 1 code rather than the size in Kb. Please see RM0038 r8 or newer for an explanation, as noted in the comments. Change-Id: Ie03b1e119a61f2a854bc2ccc5f90ce3e8852e272 Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-on: http://openocd.zylin.com/1522 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-08-07mdr32fx: support for Milandr's MDR32Fx internal flash memoryPaul Fertser
This adds example config and flash driver for russian Cortex-M3 microcontroller model. Run-time tested on MDR32F9Q2I evaluation board; the flash driver should be compatible with MDR32F2x (Cortex-M0) too but I lack hardware to test. There're no status bits at all, the datasheets specifies some delays for flash operations instead. All being in <100us range, they're hard to violate with JTAG, I hope. There're also no flash identification registers so the flash size and type has to be hardcoded into the config. The flashing is considerably complicated because the flash is split into pages, and each page consists of 4 interleaved non-consecutive "sectors" (on MDR32F9 only, MDR32F2 is single-sectored), so the fastest way is to latch the page and sector address and then write only the part that should go into the current page and current sector. Performance testing results with adapter_khz 1000 and the chip running on its default HSI 8MHz oscillator: When working area is specified, a target helper algorithm is used: wrote 131072 bytes from file testfile.bin in 3.698427s (34.609 KiB/s) This can theoretically be sped up by ~1.4 times if the helper algorithm is fed some kind of "loader instructions stream" to allow sector-by-sector writing. Pure JTAG implementation (when target memory area is not available) flashes all the 128k memory in 49.5s. Flashing "info" memory region is also implemented, but due to the overlapping memory addresses (resulting in incorrect memory map calculations for GDB) it can't be used at the same time, so OpenOCD needs to be started this way: -c "set IMEMORY true" -f target/mdr32f9q2i.cfg It also can't be read/verified because it's not memory-mapped anywhere ever, and OpenOCD NOR framework doesn't really allow to provide a custom handler that would be used when verifying. Change-Id: I80c0632da686d49856fdbf9e05d908846dd44316 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1532 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-08-01flash: add Winbond w25q80bv spi supportNemui Trinomius
Not tested, adapted from http://tech.groups.yahoo.com/group/versaloon/message/391 Change-Id: Ibe87c617b3cdf70ee042112609ab46bea98a3e6d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1511 Tested-by: jenkins Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-07-26lpcspifi: assume flash is unprotected after probingPaul Fertser
Since the driver doesn't support any hardware flash protection, it doesn't make sense to report "protected" status after probing, as it requires extra commands to unprotect before flashing and might be confusing for the end-users. Change-Id: I04d96790cc42412df5334951f39fb6723c972ced Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1525 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-07-26stm32f2x flash: add STM32F401 (F4 low power)Andrey Yurovsky
Add support for the new STM32F401 parts. These are similar to the STM32F405/407 however they are a new Low Power variant with ID code 0x423 and have 256K of Flash. Tested with a modified F4 discovery board. Change-Id: Ida5fb14a0832934b4d6d1ec11e602df5076edbc8 Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-on: http://openocd.zylin.com/1521 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-07-15flash/stm32*: Sync all device/rev IDs with reference manualsAndreas Fritiofson
Uppercase device/family names and change them to be more specific and consistent across all STM32 families. High-density STM32F10x has a Rev Y according to RM0008 Rev 14, so add it. I have a STM32F30x Rev Y, sitting on my desk, but it isn't described in the reference manual. Add it as well. Split the STM32L1xx Medium+ Density devices based on ID, to match the reference manual. If I read it correctly, the Medium+ devices have different revision mappings depending on their package/device ID. I have no real devices to examine, however. Change-Id: I5b95e5fa3cdeba219aa96838ea06ec1bb62bd921 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1497 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-07-15flash/stm32*: Rewrite info functionsAndreas Fritiofson
Factor out common bit masking and printing code and use intermediate strings to avoid buffer size handling. Change-Id: I7d8c12df11ade6cdca8c917b5524372daa498bf4 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1496 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-07-15flash/stm32*: Remove the halted check in protect_checkAndreas Fritiofson
These chips are capable of reading the flash registers while they're running. Change-Id: I76b90b2bae1aa79b5a063b2073faa5d3ed93cfd7 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1495 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-07-15flash: add missing stm32l medium+ device idSpencer Oliver
The device was correctly used in stm32lx_probe but missing from stm32lx_get_info. Change-Id: If288b8df3210a945e727e4e27cfbdb948db32fc7 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1491 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2013-07-01at91sam3: Added support for at91sam3s8a, b and cUlf Wetzker
Only the support for at91sam3s8b is tested on real hardware. Change-Id: I4ce23bc2f6131d9cf3ff1b301ab9e470d20845ab Signed-off-by: Ulf Wetzker <ulf.wetzker@eas.iis.fraunhofer.de> Reviewed-on: http://openocd.zylin.com/1424 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-07-01at91sam3: Added support for at91sam3sd8a and bUlf Wetzker
This update is untested due to missing hardware. Change-Id: Ibe286b741ebbb1c8ae0bd3dea4b8f3e12320ab34 Signed-off-by: Ulf Wetzker <ulf.wetzker@eas.iis.fraunhofer.de> Reviewed-on: http://openocd.zylin.com/1423 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-07-01flash/nor/at91sam3: fixed lock region sizeUlf Wetzker
According to the "AT91SAM ARM-based Flash MCU SAM3S Series datasheet" (http://www.atmel.com/Images/doc11090s.pdf) p. 30 the lock region size for the at91sam3sd9 family is 32 kbyte. This fix is only based on the datasheet due to missing hardware. Change-Id: Ic47b0642e4f11a60de477eaa0167038103b8ff15 Signed-off-by: Ulf Wetzker <ulf.wetzker@eas.iis.fraunhofer.de> Reviewed-on: http://openocd.zylin.com/1422 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-07-01Support for SST 39VF3201C NOR flashIS2T
* Add Thumb-2 code to write flash memories that don't support DQ5 polling * Make sure default values for unlock commands are set even if there is no PRI information given by the flash * Add a fixup to disable DQ5 polling for the SST 39VF3201C Change-Id: Ib08cf20547d0f500d5f78241521e6b49050c3d40 Signed-off-by: IS2T development team <dev.is2t@gmail.com> Reviewed-on: http://openocd.zylin.com/1449 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-06-21flash/nor/spi: uniform all hex data to lowercaseAntonio Borneo
Change-Id: I3daee7218283e521bf490993dba02a8658540951 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/1453 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-06-21flash/nor/spi: add flash Micron n25q064Antonio Borneo
Change-Id: Ic39bb6d020767cece2eaa4e194071be8b002ece4 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/1452 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-06-21stm32f2x: Correct calculation of number of 128k sectors.Andreas Fritiofson
Fixes regression introduced in 9785f51f that caused write outside allocated memory during probe of devices with <1024K flash. Reported-by: Alexander Pakhomov <ker0sin@yandex.ru> Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Change-Id: Ifba8833e436064624efbf678162538fd351a5702 Reviewed-on: http://openocd.zylin.com/1450 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-06-12cfg: add stm32 flash driver aliasSpencer Oliver
This will enable the user to use either name when calling flash driver cmds. For example the stm32f3x family use the same flash driver as the stm32f1x, so the user has to use 'stm32f1x mass_erase 0' which can be confusing. Now the user can also use 'stm32f3x mass_erase 0' with the same result. Change-Id: I14280674c8dfa2ce1c01e327af7f38e36150462c Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1428 Tested-by: jenkins
2013-06-12stm32: add new stm32f0 device idSpencer Oliver
updated from RM0091 rev4. Change-Id: Ic5e46229b85ce3974ef3016724d29a94037ac577 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1435 Tested-by: jenkins
2013-06-05update files to correct FSF addressSpencer Oliver
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1426 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2013-05-08efm32: fix FTBFS on ARM due to alignment issuesPaul Fertser
The following warnings prevent OpenOCD from building: efm32.c: In function 'efm32x_read_lock_data': efm32.c:373:8: error: cast increases required alignment of target type [-Werror=cast-align] efm32.c:386:9: error: cast increases required alignment of target type [-Werror=cast-align] efm32.c:394:9: error: cast increases required alignment of target type [-Werror=cast-align] efm32.c:402:9: error: cast increases required alignment of target type [-Werror=cast-align] efm32.c: In function 'efm32x_get_page_lock': efm32.c:430:17: error: cast increases required alignment of target type [-Werror=cast-align] efm32.c: In function 'efm32x_set_page_lock': efm32.c:441:19: error: cast increases required alignment of target type [-Werror=cast-align] cc1: all warnings being treated as errors This patch is compile-tested only. Change-Id: Ia3a8f342e0f5e30c8ea4de9435c5c7a80bc100e3 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1370 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-04-28kinetis: fix "SF1" parts to limit FlexRAM usageChristopher Kilgour
Ensure FlexRAM usage is limited to half the FlexRAM size when programming. Assume the FlexNVM sector size is equal to half the FlexRAM. Fix sector erase checking which had an error introduced when the kinetis_ftfx_command( ) signature was changed. Change-Id: I88edd9c7d4a4ba474cad7b00052feaeedfa8ced8 Signed-off-by: Christopher Kilgour <techie@whiterocker.com> Reviewed-on: http://openocd.zylin.com/1358 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-04-21Add "lpc1800" alias for "lpc4300" flash driverFreddie Chopin
Change-Id: I6d2bb9105cc778bd1d21580022529d684c3b21b0 Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-on: http://openocd.zylin.com/1351 Tested-by: jenkins
2013-04-21flash/nor: add lpc4300 variant to lpc2000 driverMatt Dittrich
This patch adds flash programming support for internal flash of the LPC43x2/3/5/7 part, tested on a LPC4337 (also tested on a LPC1768 and LPC2468). It should also work with LPC1800's with onchip flash. The "base" parameter of the "flash bank" command is now significant for the lpc4300 variant and required to determine the bank number parameter needed by the IAP routines. NOTE: I could only program flash successfully when the chip is powered with "P2_7" pulled low to put it in ISP mode. When running from flash (and not the ISP ROM), the target fails to halt and the sector erase fails. This is similar to the behavior I remember when trying out the spifi driver on a LPC4350... lots of power cycles to make progress, one To burn, one to run. So I am not confident my config is set up correctly. Change-Id: I8a75ef1b95cedd5b5898b2dedff477f502fd19f3 Signed-off-by: Matt Dittrich <mdittrich.dev@gmail.com> Reviewed-on: http://openocd.zylin.com/1126 Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Tested-by: jenkins
2013-04-17topic: STM32W support added to em357 driverBen Nahill
The em357 driver only supported one page configuration (192k in 96 2048k) pages. This is fine for em357 chips since that's the size they have, but ST's STM32W chips (pretty much the same) have different flash configurations available (64, 128, 192, 256k). I can't find anywhere that would indicate the size of the chip anywhere in memory so the selection must be manual, using the 'size' parameter. For backwards compatibility, any size not known to be in use defaults to the 192k configuration. I don't have any em357 devices to test, but I also found that I had to re-assert the FPEC clock enable before performing an erase. This is a single line and shouldn't break any configurations. My testing so far has only been with a 64k device with 8k of RAM. Change-Id: Ic0ac400a9696efaa09d1407dd4a4d456bc2c318b Signed-off-by: Ben Nahill <bnahill@gmail.com> Reviewed-on: http://openocd.zylin.com/1336 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2013-04-17program: do not poll target after reset runSpencer Oliver
Disable polling the target before we issue a 'reset run'. This stops errors or warnings if the target disables the SWD or JTAG interface as part of the application code. Change-Id: I5019dffdad41a8e210003ece1caf89069ee0f223 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1331 Tested-by: jenkins
2013-04-15flash: Added support for at91sam4sd32cPeter Dietzsch
Change-Id: I7223980602d7595a3dd7a3ceaac3f58d4f73f88d Signed-off-by: Peter Dietzsch <peter.dietzsch@ib-dt.de> Reviewed-on: http://openocd.zylin.com/1332 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2013-04-02Added support for ARMv7-M in arm io.Henrik Nilsson
Added support for ARMv7-M targets in arm_nandwrite and arm_nandread. Change-Id: Iab1d78d401f735e191c6a8519f3619035a300fae Signed-off-by: Henrik Nilsson <henrik.nilsson@bytequest.se> Reviewed-on: http://openocd.zylin.com/1188 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-03-24at91sam3: Wrong PLLA frequency calculationsThomas Schmid
The command 'at91sam3 info' ignores PLLA DIV values >1. This patch fixes it. Tested on a SAM3S4C chip. Change-Id: I051f41bb3dcefe1ac785fbcb48477a807daa16a2 Signed-off-by: Thomas Schmid <thomas.schmid@gmail.com> Reviewed-on: http://openocd.zylin.com/1307 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2013-03-15target: Retire target_bulk_write_memory()Andreas Fritiofson
The only caller was arm_nandwrite(). Replace that call with target_write_buffer() instead, which in turn may end up calling the same bulk_write_memory target API function. Change-Id: If34c7474df5cf14af3b732fb4774816818f28e79 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1214 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-03-13Kinetis: Flash command function matches datasheetAlex Austin
The kinetis datasheets specify the flash registers as bytes rather than as words, as the previous implementation did. This also makes a few code sections slightly less endian-magical. Change-Id: If8f4adfc7f4341085ae5b6eacbf7d74bbd74cf08 Signed-off-by: Alex Austin <alex.austin@spectrumdsi.com> Reviewed-on: http://openocd.zylin.com/1192 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-03-13Kinetis: Symbolic names for Addresses and CommandsAlex Austin
Change-Id: I2165b66c37bd1608139b5dd00f48124161e13ef0 Signed-off-by: Alex Austin <alex.austin@spectrumdsi.com> Reviewed-on: http://openocd.zylin.com/1191 Tested-by: jenkins Reviewed-by: Christopher Kilgour <techie@whiterocker.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-03-12tcl: add flash programming helperSpencer Oliver
This adds a program proc that simplifies using OpenOCD as a standalone programmer. Change-Id: I6ece492cd878c170b734e8bb2e09fe8c4557d5a6 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1199 Tested-by: jenkins Reviewed-by: Jörg Fischer <turboj@gmx.de> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2013-03-06flash: fix stm32 failed probe using incorrect flash sizeSpencer Oliver
This fixes an issue if the device is manually probed after the initial probe fails due to being unable to read flash size register. In this situation the driver assumes the user has overridden the flash size when infact this may not be the case. It also seems on the older stm32f1 devices the flash register is not readable when locked, this does not seem to apply to the newer parts - f0, f3, f4. Change-Id: I125f872fcb2d962ca6705f97b62d957e2b31303b Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1187 Tested-by: jenkins Reviewed-by: Johan Almquist <johan.almquist@assaabloy.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-03-06stm32: update stm32f1x driver for f0x and f3x option bytesSpencer Oliver
The stm32f0 and stm32f3 share the same option byte location, but the format differs. Adding an option_offset fixes the broken options_read cmd and incorrectly setting Hardware Watchdog when unlocking a f3x device. Change-Id: I82d66b6198294ea9eedb44ca8b2fb368c0cb15e8 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1184 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-02-25stm32: add support for stm32l1x 256k high density single bank devicesJohan Almquist
Added support for new ST devices in the stm32lx portfolio, with device id 0x427. These have 256k flash, but in a single bank compared to device id 0x436 which is a dual bank flash. Change-Id: Iafdfe990f24bd04b0d6e00385ee70690f3bf8d5f Signed-off-by: Johan Almquist <johan.almquist@assaabloy.com> Reviewed-on: http://openocd.zylin.com/1140 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-02-25stm32: add support for the STM32Lx 384kb dual bank flashJohan Almquist
This update adds support for the STM32Lx 384kb dual bank flash. Previously there was a problem when writing an image that was larger than 192Kb. That lead to openocd printing out two error messages like "Error: access denied / write protected" and "Error: invalid program address". The reason was that the stm32lx driver tried to write half pages which overlapped into the next flash bank. A new configuration file stm32lx_dual_bank.cfg can be used for stm32lx chips with dual bank flash (256kb or 384kb devices). A sanity check was added for probed flash size values to fix the issue seen on some ST samples that answered incorrectly. Change-Id: I69e25131983d88613be8606b438f98870c5f1e52 Signed-off-by: Johan Almquist <johan.almquist@assaabloy.com> Reviewed-on: http://openocd.zylin.com/1125 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-02-25stm32: enable flash bank size overrideSpencer Oliver
It has been seen on some stm32 targets that the flash size register that is probed by the driver may contain an invalid size. This change enables the user to override the probed value. Change-Id: I09359e59a96f9133d3d939670957d32a830a944e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1132 Tested-by: jenkins Reviewed-by: Johan Almquist <johan.almquist@assaabloy.com>
2013-02-02armv7m: use ARM_MODE_THREAD core mode for algoorithm'sSpencer Oliver
This makes sure we are using privileged mode when executing any loaders. Change-Id: I18bf32ec92e1c76a66ab25e3712652bc3650b332 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1108 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-02-02armv7m: use generic arm::core_modeSpencer Oliver
To simplify things change over to using the generic core_mode struct rather than maintaining a armv7m specific one. Change-Id: Ibf32b785d896fef4f33307fabe0d8eb266f7086f Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/966 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-01-21flash: add stm32lx loader Hard Fault workaroundSpencer Oliver
An issue has been seen with the stm32lx flash driver that if a power cycle/reset is applied after a erase, any ram loader will Hard Fault on execution. A similar issue is mentioned in the errata for the device. Two solution's seem to workaround this issue: 1, Handle the exception, this means adding exception vectors to the loader and changing the exception address using nvic vtor register. 2. falling back to using slower direct page writes - approx 50% slower. Using solution 1 would mean restrictions are placed on the loader location. Solution 2 was chosen mainly as it was simpler too implement. Change-Id: I429f06b5a3e3b1d8de90071a88a7df11fc9b46a7 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1010 Tested-by: jenkins
2013-01-21flash: reduce stm32lx loader timeoutSpencer Oliver
Waiting 20secs is a bit much excessive, we could probably reduce to 5. Change-Id: Iffb97adb99c2541a075fe78dbc88a53ddf340214 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1009 Tested-by: jenkins
2013-01-21flash: cleanup stm32lx driverSpencer Oliver
Handle any leading bytes upto the next 128 byte page, enabling us to safely use the faster page write. Rather than use a separate word/byte write to program any trailing bytes we use a combined write function. Use memcpy for byte writes and change loader to using bytes. Change-Id: Ie0164a30388f018dd00e752cf5ff87d4f96ced97 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1008 Tested-by: jenkins