aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor
AgeCommit message (Collapse)Author
2016-11-04Make OpenOCD build using -Og.Tim Newsome
With -Og gcc doesn't perform as many optimizations, and as a result warns about some code that it wouldn't otherwise warn about. These fixes all assign values to otherwise uninitialized variables. Change-Id: I9a6ea5eadd73673891ecfec568b8b00d78b596a5 Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: http://openocd.zylin.com/3779 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-11-04nrf51: show proper part numberJiří Pinkava
Change-Id: I3e8169eb577888ee54541a1e864a8ad5a9a7cfd1 Signed-off-by: Jiří Pinkava <j-pi@seznam.cz> Reviewed-on: http://openocd.zylin.com/3733 Tested-by: jenkins Reviewed-by: Fredrik Hederstierna <fredrik@hederstierna.com> Reviewed-by: Michael Dietz <mjdietzx@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-10-30flash: nor: lpc2000: handle lpc11xx parts with more than 96k memoryPaul Fertser
Known big flash parts such as LPC11u68/e68 have a non-uniform memory organisation, the first 24 sectors are 4k, the rest are 32k. Change-Id: Icf515152dfc54ec0ca187561d2d63088b9640f14 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/3802 Tested-by: jenkins Reviewed-by: akaWolf Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-10-30flash/nor: Add erased_value to drivers and pass it to targetsAndreas Färber
struct flash_driver has a default_padded_value field that is similar, but it can be changed by the user for the specific purpose of padding. Add a new erased_value field and initialize it for all targets, particularly stm32lx, xmc4xxx and virtual. Use this value in core.c:default_flash_mem_blank_check(), the slow path. Extend the target API to pass erased_value down to target code. Adding an argument ensures that we catch all callers. This allows us to merge xmc4xxx.c:xmc4xxx_blank_check_memory() into armv7m:armv7m_blank_check_memory(). It further allows us to use default_flash_blank_check() in place of xmc4xxx.c:xmc4xxx_flash_blank_check(), adding a potential slow path fallback, as well as stm32lx:stm32lx_erase_check(), adding the potential armv7m fast path with fallback to default_flash_mem_blank_check(). Fix a mips32 code comment while at it (zeroed -> erased). The armv4_5 and mips32 target implementations will now error out if an erase value other than 0xff is used, causing default_flash_blank_check() to fall back to the default_flank_mem_blank_check() slow path. Change-Id: I39323fbbc4b71c256cd567e439896d0245d4745f Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3497 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2016-10-30atsamv: Support for ATSAMS70N19 Memory ConfigurationGabrielle Trotter
Change-Id: I3c17fcb7ee053f92aa583149bea7b8e33b3b86f7 Signed-off-by: gtrotter@bulogics.com Reviewed-on: http://openocd.zylin.com/3834 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2016-10-17flash Kinetis: fix mdm check_security regression in JTAG modeTomas Vanek
Commit 6d5b4d709cb05e8daf0350ac507b928da95d0abb causes failed assert when JTAG transport is selected: src/target/arm_adi_v5.h:346: dap_queue_ap_read: Assertion `ap->dap->ops != ((void *)0)' failed. As check_security runs early in examine-start event, dap->ops must be checked. Change-Id: Ibd8312a3c668fbce834eed9790eabeed794117aa Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3712 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2016-10-04stm32f2x: Increase options write timeoutAndreas Fritiofson
Large flash parts time out when unlocking. Mass erase time is specified as 32 seconds worst case for some parts. Automatic mass erase is probably not using x8 parallelism, though, but a too large timeout shouldn't hurt. Also, use the new define instead of hardcoded timeout when mass erasing. Change-Id: Ib5af60d52ed7d53277bfe7176c4c44f79d3a26bc Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3738 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2016-10-04nRF51: Fix bug in Code memory size.Michael Dietz
The code memory size was a bug and seemed to be working by accident since there happened to be 256 pages in the device that was tested on which corresponded to 256kb. Also don't fail if memory size != expected memory size based on hwid as this hwid is unstable and should be used only for debug/diagnostics. Change-Id: I4e98f7498a36c53fc51783eddfdaba704d30e3ca Signed-off-by: Michael Dietz <mjdietzx@gmail.com> Reviewed-on: http://openocd.zylin.com/3510 Tested-by: jenkins Reviewed-by: Jiří Pinkava <j-pi@seznam.cz> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2016-10-04STM32L433 Flash supportPeter Kuhar
Added new chip id based flash size. Change-Id: I5b5e71074af0e50352443f66f88adfc6e14280bf Signed-off-by: Peter Kuhar <peter@pkuhar.com> Reviewed-on: http://openocd.zylin.com/3732 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2016-10-04stm32l4x: fix incorrect device id maskSpencer Oliver
Change-Id: I37cf9cbdd07dc3764d2c719b7c6ed5852aea3943 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/3799 Tested-by: jenkins
2016-08-14flash Kinetis: Implement flash protection settingTomas Vanek
Kinetis family employs strange concept of Flash Configuration Field at address 0x400 of program flash. Writing incorrect data to FCF may permanently lock the device. The change introduces 'kinetis fcf_source protection' mode. In this mode write of flash image data to FCF is prevented. FCF data build from protection (set by 'flash protect' command) are written instead. FCF data are written also just after erase of relevant sector. It protects device from locking security by reset or power cycle after erase. prot_blocks array is used as protection blocks have bigger size than sectors. Alignment and padding programming sections is rewritten to fix writing with not section boundary aligned begin. Change-Id: I9fc8bd37d6f627fb8ed7abb7f7560e78a740b195 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3562 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2016-08-14pic32mx: add new device ID, 17x/27x Flash supportSASANO Takayoshi
- add new device ID: 170F256B, 170F256D, 270F256B, 270F256D, 330F064H, 330F064L, 430F064H, 430F064L, 350F128H, 350F128L, 450F128H, 450F128L, 350F256H, 350F256L, 450F256H, 450F256L, 370F512H, 370F512L, 470F512H, 470F512L - add support for PIC32MX17x/27x 256kB Flash Change-Id: I65a304d2114fff80de3a24c1f6d0b5e955b22531 Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk> Reviewed-on: http://openocd.zylin.com/3186 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2016-08-14flash Kinetis: refactoring ftfx commands and numerous minor changesTomas Vanek
Add kinetis_ftfx_decode_error() to show flash error type in human readable message. Add kinetis_ftfx_prepare() to prepare flash module just once in command (not each time kinetis_ftfx_command() is called). Change target_read/write_memory() to target_read/write_u8/32(). Make ftfx_fstat parameter of kinetis_ftfx_command() optional. Longword flash write: Fix huge memory leak after write of unaligned block. Check flash address alignment properly. Do not fill whole padding buffer but its end after original data. Remove duplicite padding. Change-Id: Ia5e312909f68d3cc724c8cbffe1cd903b9102124 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3561 Tested-by: jenkins Reviewed-by: Steven Stallion <stallion@squareup.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-08-14flash/nor: implement protection blocks of different size than erase sectorTomas Vanek
Originally flash/nor infrastructure assumed protection blocks identical to erase sectors. This assumption is not valid for many flash types. Driver code fixed the problem either by increasing sector size to size of protection block or by defining more protection block than really existed in device. Both cases had drawbacks. The change retains compatibility with the old driver. Updated driver can set protection blocks table independent of sector table. Change-Id: I27f6d267528ad9ed9fe0a85f05436a8ec17603a4 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3545 Tested-by: jenkins Reviewed-by: Steven Stallion <stallion@squareup.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-08-14flash Kinetis: dynamic status detection before starting mass_eraseTomas Vanek
The change prevents starting mass_erase in unstable state of MCU (RESET/WDOG loop). mass_erase of secured MCU using manual reset button is supported. Timeouts are measured by timeval_ms() instead of iteration count. mass_erase timeout prolonged to 16 seconds because aborting mass_erase in progress (deasserting reset) leaves the device in security locked state. Change-Id: I6605532df56080a54c2a1dfe49094e3db4ce534a Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3551 Tested-by: jenkins Reviewed-by: Steven Stallion <stallion@squareup.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-08-14flash Kinetis: Detect RESET/WDOG loop, fix detection of secured MCUTomas Vanek
Kinetis driver checks MDM STAT register to detect secured state of MCU. Original version often reported a blank device as secured one. Change #3010 has not fixed all false reports. After changes in arm_adi_v5 infrastructure secured devices was not detected at all. New algorithm uses multiple MDM STAT reads and counts MDM_STAT_SYSSEC and MDM_STAT_FREADY bits. Both secured MCU and MCU locked-up in RESET/WDOG loop are detected reliably. Detection is run in both kx.cfg and klx.cfg from examine-start event, not examine-end as before. Event is configured only for non hla adapter. Minor fix in klx.cfg: commented out adapter_khz 24000 in reset-init. Such frequency is not supported in VLPR CPU mode and with JTAG. Change-Id: I2ec2b68c45bde9898159cd15fbdcbcfa538c41d9 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3547 Tested-by: jenkins Reviewed-by: Steven Stallion <stallion@squareup.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-08-14kinetis: support mass erase on boards without SRSTSteven Stallion
NXP (nee Freescale) documents the mass erase procedure using the MDM-AP block in AN4835. Existing support for this feature did not properly handle boards without SRST. This patch updates the mass_erase command such that it works correctly on these boards. Additionally, the core is left in a halted state once complete to prevent reset loops due to the watchdog as reported by some users. Since the MDM-AP provides an additional method of halting and resetting the core that is disconnected from the DAP, additional commands are provided to manage this state. These commands are particularly helpful when connecting to a target with an unknown state. Change-Id: I40f006d5d964befb12b019c5d509988decdd3f91 Signed-off-by: Steven Stallion <stallion@squareup.com> Reviewed-on: http://openocd.zylin.com/3540 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2016-08-14at91sam7: do not touch flash banks which belong to other targetsAndreas Fritiofson
at91sam7_read_part_info() walks throw all flash banks following current one. I don't know why it has to do it at all (possibly for multi-bank devices like SAM7S512), but if there is more than one target in JTAG chain, this lookup can touch flash bank of another (possibly not halted) target, which cause probe error and current command execution abort. [andreas.fritiofson@gmail.com]: Change to for-loop and reduce indentation Change-Id: Ide50e93578786e1250f7a0fd0e3d296247924814 Signed-off-by: Sergey A. Borshch <sb-sf@users.sourceforge.net> Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2610 Tested-by: jenkins
2016-08-14Flash handling for STM32F76x/77x and F446 addedAndreas Bolsch
- added ids for various parts - rewrite of sector allocation to deal with dual-bank F76x/77x - single- / dual-bank mode for F76x/77x - sector protection adapted for F76x/77x in dual-bank mode - handling of additional option bits (28-31) in FLASH_OPTCR in options_read and options_write for F42x/43x/469/479/7xx, options bits 0-1 masked out - check for sensible value of user_options in options_write - some #defines clarified, non-needed ones removed - docs updated (options read, options write) Change-Id: Ie4db80e60baa7d2663e024ab1f278640b1ce901b Signed-off-by: Andreas Bolsch <hyphen0break@gmail.com> Reviewed-on: http://openocd.zylin.com/3526 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-08-14flash/nor/tcl.c: Less verbose output of flash erase_check.Uwe Bonnes
Only report non-erased or unknown sectors or if bank is fully erased. Change-Id: I94f0bc2a0d6529d1ea5f66b284cefd6a2c61fe39 Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/3501 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Andreas Färber <afaerber@suse.de>
2016-08-14stm32l4: Handle failing flash_size read like on other devices.Uwe Bonnes
Change-Id: I54d7cd3a8c80d0e4663c3c09457a4ff338a6f1a0 Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/3503 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2016-08-13psoc4: Corrected Silicon IDsGeorge Ioakimedes
Corrected 2 Silicon IDs that were swapped. I've tested with a CY8C4125AXI-483 and confirmed that the device is recognized correctly now. Change-Id: I6fcbee33558d8feec9abf6052df3f15523379c48 Signed-off-by: George Ioakimedes <georgeioak@gmail.com> Reviewed-on: http://openocd.zylin.com/3619 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2016-08-13at91samd: Add Atmel SAMD09 family supportOlaf Lüke
Change-Id: I0ee3bb92aa168ed070863ac09e3c457a4b2e2220 Signed-off-by: Olaf Lüke <olaf@tinkerforge.com> Reviewed-on: http://openocd.zylin.com/3428 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins Reviewed-by: Liviu Dudau <liviu@dudau.co.uk>
2016-08-02flash: nor: mdr: fix verification problem with 1986VE1T or 1986VE3TAndrey Skvortsov
1986VE1T and 1986VE3T have issue with flash acceleration engine described in their errata (issue 0007). After programming flash acceleration engine's buffer contains old data, and therefore first read data are wrong. Because of this verification after programming fails always. Recommended workaround for the issue is to flush flash accelerator's buffer. To do so it's necessary to read at least 64 bytes of flash through accelerator. Reading bytes through JTAG using default_flash_read doesn't help. It seems that reading should be done by uC itself. Change-Id: I18ef464a68ad5c5b16d3933f31ca61f8e2e7cca3 Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com> Reviewed-on: http://openocd.zylin.com/3509 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2016-07-19Fix usage of timeval_ms()Andreas Färber
First, fix the timeval_ms() implementation to not have K&R but ANSI argument semantics by adding a missing void. timeval_ms() returns an int64_t, not uint64_t or long long. Consistently use int64_t for variables and PRI*64 as format string. While at it, change a few related variables to bool for clarity. Note that timeval_ms() may return a negative error code, but not a single caller checks for that. Change-Id: I27cf83e75b3e9a8913f6c43e98a281bea77aac13 Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3499 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2016-06-23cfi: Add support for strangely endianness broken SoC implementationsEsben Haabendal
This adds the 'data_swap' parameter to the CFI driver, which enables swapping of data bytes when writing/programming words to the flash. Note, that this specifically means that bytes are not swapped when writing command words to the flash chip. Unless you are using the SAP in an LS102x chip to program an attached 16-bit NOR flash, you hopefully do not need this! Change-Id: I1e6f7169da36f373c880d1756d9c21c9957acc50 Signed-off-by: Esben Haabendal <esben@haabendal.dk> Reviewed-on: http://openocd.zylin.com/3109 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2016-05-24Make #include guard naming consistentMarc Schink
Change-Id: Ie13e8af0bb74ed290f811dcad64ad06c9d8cb4fa Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/2956 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-05-24Remove FSF address from GPL noticesMarc Schink
Also make GPL notices consistent according to: https://www.gnu.org/licenses/gpl-howto.html Change-Id: I84c9df40a774958a7ed91460c5d931cfab9f45ba Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3488 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-05-20lpcspifi: Fix SWD support for LPC43xxAndreas Färber
When using SWD rather than JTAG transport, the lpcspifi driver complains: Error: Device ID 0x0 is not known as SPIFI capable Error: auto_probe failed This is because target's JTAG tap->idcode is zero for SWD. Drop this check completely and hardcode the addresses for now. Neither the JTAG TAPID nor the SWD IDCODE are unique enough to detect the exact chip model and thereby its memory map. Change-Id: Ic230e3e989a3e1f1a5b3bae68bdb34e5ef55d392 Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3089 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-20Fix spelling of ARM CortexAndreas Färber
It's Cortex-Xn, not Cortex Xn or cortex xn or cortex-xn or CORTEX-Xn or CortexXn. Further it's Cortex-M0+, not M0plus. Cf. http://www.arm.com/products/processors/index.php Consistently write it the official way, so that it stops propagating. Originally spotted in the documentation, it mainly affects code comments but also Atmel SAM3/SAM4/SAMV, NiietCM4 and SiM3x flash driver output. Found via: git grep -i "Cortex " git grep -i "Cortex-" | grep -v "Cortex-" | grep -v ".cpu" git grep -i "CortexM" Change-Id: Ic7b6ca85253e027f6f0f751c628d1a2a391fe914 Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3483 Tested-by: jenkins Reviewed-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-05-20stm32l1/Cat.3: Devices have only one bank.Uwe Bonnes
Change-Id: I02ce243c228ea20be6d5f01fee705a671747ebad Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/3490 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-17kinetis: Fix typo in variable namesAndreas Färber
It's security, not securtiy. Change-Id: Idb10d7e0a1ca47d2d93b496d12cd4ec7ad116f22 Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3487 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2016-05-14flash/nor: Add Ambiq Micro Apollo flash driver.Rick Foos
Initial release of Ambiq Micro Apollo flash driver supporting our sub-threshold (low power) Cortex M4F part, and Evaluation Kit. We have been shipping openocd to our customers for about one year. The EVK boards are SWD only using ftdi. We also use two of the other COM instances to display debug information. It takes about 15 seconds to flash 512K, and mass erase is about 5 seconds. Tested by internal verification group, FAE's, and customer sites. Merged commit 'refs/changes/17/3417/1' as suggested. Makefile.am and drivers.c follow the new format to avoid conflicts. Removed unused fault_capture command. Added documentation for flash driver. Change-Id: Iae92d869369c6827244f0071f9cb522d8d91fed8 Signed-off-by: Rick Foos <rfoos@solengtech.com> Reviewed-on: http://openocd.zylin.com/3230 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-14xmc4xxx: Improve xmc4xxx_blank_check_memory() error handlingAndreas Färber
Clean up working area in case writing fails. Probably inherited from armv7m_blank_check_memory(). Fix adapted from armv7m_checksum_memory(). Change-Id: I784bef481d1eba833ab6a9c34249fe9d43a16081 Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3470 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2016-05-08flash/nor/spi: use only lower case hex numbersRobert Jordens
Change-Id: I21ad0d3a73a60d22cb98a0350098baf8af96bebf Signed-off-by: Robert Jordens <jordens@gmail.com> Reviewed-on: http://openocd.zylin.com/3350 Reviewed-by: Andreas Färber <afaerber@suse.de> Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-08flash/nor/spi: fix macronix 25l1005 chip eraseRobert Jordens
Change-Id: Ibc445bbe9360d0f1f41e71af8b990b96e0ae5d1f Signed-off-by: Robert Jordens <jordens@gmail.com> Reviewed-on: http://openocd.zylin.com/3349 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-05Support for debug interface lock of EFM32 controllersLieven Hollevoet
The capability to lock the debug interface on EFM32 controllers was lacking in OpenOCD. After receiving some pointers by zapb_ and PaulFertser on IRC (thanks guys!) I have added this capability. This works by writing the required bits in the debug lock word to '0'. Note: there is currently no way to re-enable the debug interface from OpenOCD as doing this requires specific pin wiggling that is currently not implemented yet. However: having the capability to lock the debug interface is useful when building a volume programming jig. You can flash the program code, verify and then lock the debug interface so that the device cannot be read when it is deployed in the field. Change-Id: If2d562dfdb4b95519785a4395f755d9ae3d0cf12 Signed-off-by: Lieven Hollevoet <hollie@lika.be> Reviewed-on: http://openocd.zylin.com/3389 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-05xmc4xxx: Fix error propagation for erase_check callbackAndreas Färber
If an error occurs during xmc4xxx_blank_check_memory() aka .erase_check, it would break out of the loop over flash sectors and return ERROR_OK. Instead return the error code so that tcl.c can notify the user. Change-Id: Ie2c1b7933eef2b240b28f8a292634fbbf5b31706 Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3425 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-05fm4: Set read callbackAndreas Färber
Fix a segfault for flash read_bank by adopting the default read implementation. Change-Id: I09e030d9a7669b848a1743aaba03875bf408c7ee Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3431 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-05at91samd: Add additional "B Variant" parts from SAMD21 familyPeter D. Gray
The parts are listed in Rev I of the Datasheet Change-Id: Icdd9108a0f1f19f666fce79de7f25df9f46de866 Signed-off-by: Peter D. Gray <peter@conalgo.com> Reviewed-on: http://openocd.zylin.com/3424 Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Tested-by: jenkins
2016-05-05flash/nor: Add Infineon XMC1000 flash driverAndreas Färber
The XMC1000 family uses a very different flash interface from XMC4000. Tested on XMC 2Go and XMC1100 Boot Kit. Change-Id: I3edaed420ef1c0fb89fdf221022c8b04163d41b3 Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3418 Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Tested-by: jenkins
2016-05-05at91samd: Atmel SAML22 (segment LCD) family addedTomas Vanek
Part IDs taken from Atmel-42402C-SAM L22_Datasheet_Complete-01/2016 (revision C) Change-Id: I1eb76a92097a8327da10faa0551e7fc962a549f8 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3426 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-05flash Kinetis: new KVx family addedTomas Vanek
Cortex-M0+ and M4 motor control MCUs KV10, KV11, KV30, KV31, KV42, KV44 and KV46 added to SDID identification. Watchdog disable code changed to work on Cortex-M0+ (KV1x) Protection size set to 1K for 16K flash devices (KV10Z16) - cherry picked from Andrey Smirnov's change #2051 Change-Id: Ia6f4868eaf7e2cb6ad6a736210c703a67e0027be Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/3235 Tested-by: jenkins Reviewed-by: Kyle Manna <kyle.manna@fuel7.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-05Add support for Atmel AT91SAMD21E16B (B variant) and a spelling mistake.Peter D. Gray
Change-Id: I55ab830aed34a02c53f3419facc81c7354368e30 Signed-off-by: Peter D. Gray <peter@conalgo.com> Reviewed-on: http://openocd.zylin.com/3422 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Andreas Färber <afaerber@suse.de>
2016-05-05flash/nor: Reorder drivers alphabeticallyAndreas Färber
To avoid conflicts between flash drivers being added, consistently use an alphabetical sort order for the three places new drivers get added: * Makefile.am NOR_DRIVERS (note: automake disallows a trailing backslash) * drivers.c struct flash_driver forward declarations * drivers.c flash_drivers array Change-Id: Idcd6a8e12821ef10958a6b3ad7bac0dc63cadd08 Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3417 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-04stm32lx: Add support for lock/unlock (RDP Level 0<->1)Andreas Fritiofson
Change-Id: Iecc356373e084056d048d92820062483cac3c8ec Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3234 Tested-by: jenkins Reviewed-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-04stm32f2x.c: Add more F4 devices.Uwe Bonnes
Taken from git://git.ac6.fr/openocd commit e8ed67c42227b7072 STM32F446 (0x434) now is's own case. Change-Id: I5061db7102b4c923c9f39d3d2f0cc69d29fca0a4 Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/3375 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-05-04src/flash/nor/stm32f2x.c: Really erase second bank if requested.Uwe Bonnes
Taken from git://git.ac6.fr/openocd commit e8ed67c42227b7072 Change-Id: Ic7f529aecd1603b8c083c3c9ce96a0f13dd604e0 Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/3374 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-05-04 stm32l4x.c: Correct waiting for data.Uwe Bonnes
Old code waited only for 7 bytes and didn't handle buffer wrap-around, but was functional despite. Change-Id: Iceaf7be1e51368b2ec0a8722cc9ac16d12f9aa63 Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/3140 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2016-05-04stm32l4x.c: Use explicit 64-bit flash access as reference manual implies.Uwe Bonnes
Change-Id: I87b540c1ee7158a9d697e9fbc845a603c6bbe74d Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Reviewed-on: http://openocd.zylin.com/3139 Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Tested-by: jenkins