aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-03-14flash/stm32h7x: remove IWDG1_SW separate variableChristopher Head1-14/+0
Bit 4 in OPTSR is IWDG1_SW (the code originally called it IWDG1_HW, but the reference manual refers to it as IWDG1_SW). This is broken out into a separate variable, independent_watchdog_selection, in stm32x_options. However, this is not necessary: bit 4 is included in the user_options field, which includes all of bits 2 through 7, and independent_watchdog_selection is not referenced anywhere else. Delete the field and just rely on user_options to transport that bit, along with all the other bits it contains, between stm32x_read_options and stm32x_write_options. Change-Id: I4da63df9272cf091267b956c412b95671ea1d3c9 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/4744 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-14target/adi_v5_swd: improve error check while updating DP_SELECTAntonio Borneo1-13/+42
Write to register DP_SELECT can fail, but both functions swd_queue_dp_bankselect() and swd_queue_ap_bankselect() return void and do not propagate the error. Change the return type of the two functions to int and check the returned value. Invalidate the cached value of DP_SELECT if the write fails. Change-Id: Iba6ef8b0c2332e7f7efb66337d558fb7a4a0d39c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4980 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-14target/adi_v5_swd: update cached value on write to DP_SELECTAntonio Borneo1-1/+4
When the register DP_SELECT is written directly, e.g. with command <dap> dpreg 8 <value> the cached value in OpenOCD is not completely updated with the new value, thus creating issues in the following AP and DP read/write that rely on the cached value. Update the cached value while writing to DP_SELECT. Change-Id: I8221b10cd6fc1fbe73e6b834b68820b43480e1a2 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4979 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-12target/breakpoints: make internal functions staticTomas Vanek1-4/+6
While on it add two missing new lines. Change-Id: I0d54740479bc462b734f91686f0931824796b598 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4888 Tested-by: jenkins Reviewed-by: Marc Schink <openocd-dev@marcschink.de>
2019-03-12flash/nor/tcl.c: use COMMAND_PARSE_ADDRESSTomas Vanek1-5/+1
instead of conditional compilation #if BUILD_TARGET64 Change-Id: I005ae0b3a4ed127c0f59219b1c6b185a2c76c76e Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4977 Tested-by: jenkins Reviewed-by: Tim Newsome <tim@sifive.com>
2019-03-08flash/nor: use target_addr_t for flash bank baseTim Newsome28-98/+121
This should allow users to configure flash at >32-bit addresses. Change-Id: I7c9d3c5762579011a2d9708e5317e5765349845c Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: http://openocd.zylin.com/4919 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-08gdb_server, target: Add target_address_bits()Tim Newsome5-6/+43
Targets can use this to expose how many address bits there are. gdb_server uses this to send gdb the appropriate upper limit in the memory-map. (Before this change the upper limit would only be correct for 32-bit targets.) Change-Id: Idb0933255ed53951fcfb05e040674bcdf19441e1 Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: http://openocd.zylin.com/4947 Tested-by: jenkins Reviewed-by: Peter Mamonov <pmamonov@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-08rtos/hwthread: add hardware-thread pseudo rtosMatthias Welwarsky4-51/+417
This patch adds "hwthread", a pseudo rtos that represents cpu cores in an SMP system as threads to gdb. This allows to debug SMP system kernels in a more sensible manner and removes the current atrocities of switching gdb manually between CPU cores to update the context. Change-Id: Ib781c6c34097689d21d9e02011e4d74a4a742379 Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com> Reviewed-on: http://openocd.zylin.com/3999 Tested-by: jenkins Reviewed-by: Tim Newsome <tim@sifive.com> Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-by: Graham Sanderson <graham.sanderson@gmail.com>
2019-03-08drivers/stlink_usb: use command STLINK_DEBUG_APIV2_READ_IDCODESAntonio Borneo1-5/+13
API v2 deprecates using command STLINK_DEBUG_READCOREID to read the core ID. Switch to STLINK_DEBUG_APIV2_READ_IDCODES on new stlink firmware version. Change-Id: Iabadfc116c57f2c31f08f2e77baefea0cf90bdc3 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4826 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-08drivers/stlink_usb: check error code returned by st-linkAntonio Borneo1-36/+46
Most of ST-Link commands return an error code, but this is almost never checked. Check for the error code for every command that returns it. Change-Id: Ifc4e32f8c73196de23700ba0989bfdfe0f5b46e3 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4825 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-08drivers/stlink_usb: fix stlink_usb_read_regs() for API v2Antonio Borneo1-9/+10
API v2 implementation for command READALLREGS returns the status in the first two bytes, followed by two bytes of padding. This makes the reply 4 bytes longer and changes the offset of the first register value to 4. Fix it for the case API v2 and clean-up the management of the return value. Change-Id: I448c82bcc0baa72d66fdfe7f0c525b94f8a4468b Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4824 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-07stlink: handle error GET_IDCODEAntonio Borneo1-0/+4
When the connection with target is lost on the physical JTAG/SWD link (either wire disconnected or DAP/TAP in reset), STLINK fail to connect and returns error STLINK_JTAG_GET_IDCODE_ERROR. Add it in the list of known errors. Change-Id: Iabd6e6892111726f614345497d9286554bfe4ac0 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4982 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2019-03-07stlink: handle error bad-APAntonio Borneo1-0/+5
The new firmwares for ST-Link support handling multiple AP, but are (actually) limited to the AP number in range [0..8]. Any tentative to operate on AP number higher than 8 returns an error "bad AP". Add the error code and the related message. Change-Id: I78a98b2612d10e580d03fc43ed9f2b09619d39d8 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4981 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2019-03-06target/openrisc/x86_32_common: Use 'bool' data typeMarc Schink1-12/+12
Change-Id: I395a36ddd7ac7e85bc54f6bb073a93b0c6f24db0 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4972 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/openrisc/or1k: Use 'bool' data typeMarc Schink1-8/+8
Change-Id: I6393bb8503d64947a1f2349e1d14c1552cabf927 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4971 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/lakemont: Use 'bool' data typeMarc Schink1-12/+12
Change-Id: I9baaf617c2bfabd07ac3ca195e486893d7950398 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4969 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/feroceon: Use 'bool' data typeMarc Schink1-6/+6
Change-Id: I30b8d07ee198e8f67cd98f83c4bec15bcfe8be08 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4967 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/etb: Use 'bool' data typeMarc Schink1-4/+4
Change-Id: I536036b15af10bb1879dbbec84576134fd3dce35 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4966 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/arm_semihosting: Use 'bool' data typeMarc Schink1-6/+6
Change-Id: I05245b7dc9c37ea8e0e40672070fb3e87cb7683f Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4965 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/embeddedice: Use 'bool' data typeMarc Schink1-4/+4
Change-Id: I0f237e0769786aa560d1a472a71499d3856ab25c Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4964 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/cortex_a: Use 'bool' data typeMarc Schink1-6/+6
Change-Id: I055767f1c20af539159ee59e35de8dd20b399fa4 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4963 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/avr32_ap7k: Use 'bool' data typeMarc Schink1-8/+8
Change-Id: I49f1a6c6ee6d175935eb40b49abf8ebdf56a0b6e Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4961 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/arm926ejs: Use 'bool' data typeMarc Schink1-3/+3
Change-Id: I3016a8ba37942d674017c09e4540d9813c832872 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4960 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/arm920t: Use 'bool' data typeMarc Schink1-7/+7
Change-Id: I5f2c95d9a4bdb14cc31d72eb026f58710fb07db5 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4959 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/arm720t: Use 'bool' data typeMarc Schink1-3/+3
Change-Id: I9838d0d0ba472f029169ab37597ef367a6084fbf Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4958 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/aarch64: Use 'bool' data typeMarc Schink1-2/+2
Change-Id: Ibfe4413b88ed0759a556a8777dac40f0c2c64922 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4957 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/armv8: Use 'bool' data typeMarc Schink1-8/+8
Change-Id: I65def33f24187ab336db5732ce35200ca5cd8f5f Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4956 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/armv7m: Use 'bool' data typeMarc Schink1-16/+16
Change-Id: I9cfbba9d81601cc72e2b54ec410e21c7edc4f1c4 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4955 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/arm11: Use 'bool' data typeMarc Schink1-2/+2
Change-Id: Ia09adeab88eaf66c009f94be25ab82b0b8f88f61 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4954 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/armv7_9_common: Use 'bool' data typeMarc Schink1-34/+34
Change-Id: I5af27247f39cf47c925260784e21292f34665471 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4953 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/armv4_5: Use 'bool' data typeMarc Schink1-13/+13
Change-Id: I82e3963ea662844bb96943aee849dab35ea96bb3 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4952 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/register: Use 'bool' data typeMarc Schink1-4/+4
Change-Id: I3633ced9cb2bfe6afb0ef49aa42fd1b54f155a66 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4951 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target/cortex_m: Use 'bool' instead of 'int'Marc Schink2-9/+9
Change-Id: I273d24997e2c844015e144a15981f8f0af522261 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4950 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-03-06target: Remove unused variable 'has_percent'Marc Schink1-1/+0
Change-Id: Ib080fc33e8a0305990ee334019547e7643c446ac Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4949 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-06helper/command: return proper JIM error codeAntonio Borneo1-1/+1
The function command_unknown() is expected to return a value recognized as JIM error code, as it is correctly done in the other cases it returns. Fix the only case in which command_unknown() does not return a JIM error code, by s/ERROR_FAIL/JIM_ERR/ Change-Id: Ib98b75755ae36870bd68c17f8839ddbfa06c6312 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4973 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-06stlink: remove unused assignmentAntonio Borneo1-1/+1
Fix a warning identified by clang 7.0.1: stlink_usb.c:1092:3: warning: Value stored to 'p' is never read p += sprintf(p, "S%d", swim); ^ ~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: Ic9da57e19ceecb0e3d65d3ea3412a05e1c2c779a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4945 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-06gdb_server: fix 'null' pointer passed as 'nonnull' parameterAntonio Borneo1-2/+2
The null pointer used as second parameter to gdb_put_packet() is passed as second parameter to the memcpy() in line 408 of gdb_put_packet_inner(). In this case memcpy() does not segfault because also the parameter length is zero. Nevertheless, the prototype of memcpy() requires a nonnull pointer. Fixed by passing an empty string in place of the null pointer. Issue highlighted by clang 7.0.0 with warning message: "Null pointer passed as an argument to a 'nonnull' parameter" Change-Id: Ib3dde95d76fcc5fb245ee2d6669e5535d0e0b127 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4946 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-05src/jtag/drivers/ftdi: fix swd pin comment and linksDiego Herranz1-4/+4
- TDI/DO is not pin 2 and in fact, we don't even need to mention which pin number it is. "TDI/DO pin" is descriptive enough. - FT2232D link didn't work anymore. It could have been updated to the current working FT2232D link but changed to link the FT2232H instead which is the latest generation and the most commonly used these days. - Taking advantage of the change, link to the MPSSE document updated. It still worked but through a redirection, so updated just in case the redirection stops working. Change-Id: Ia7d01bbcac2158026831edb010a6b50f58351e42 Signed-off-by: Diego Herranz <diegoherranz@diegoherranz.com> Reviewed-on: http://openocd.zylin.com/4908 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2019-03-04gdb_server: remove warning for stepi after gdb_syncAntonio Borneo1-2/+2
The command "gdb_sync" is used to resynchronize gdb with OpenOCD. It is supposed to be follow by the gdb command "stepi" that will be ignored by OpenOCD. Don't annoy the user with a warning message when the stepi command is ignored, but simply log a debug message. Change-Id: Ie4cffa89e761d7335e5961900b62e31f209d4b1b Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4764 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2019-03-04armv8: allow halt on exceptionMatthias Welwarsky7-2/+90
add command 'catch_exc' to halt a core on entering any of Secure EL1 or EL3 or Non-Secure EL1 or EL2. Change-Id: I0c68e247af68dd96616855a9bc1063c277d222e5 Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com> Reviewed-on: http://openocd.zylin.com/4479 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-03-01Use enum for target_register_timer_callback()Marc Schink8-8/+14
Change-Id: I268e8c5d783914aa97cbde301448b2c5bc3cb9e6 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4921 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-01target: Use proper data types for timer callbackMarc Schink2-7/+13
Change-Id: I5ca6da767f9e96180c43b179b2c682b1b7c98563 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4920 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-02-27flash: stm32f2/f4/f7: Add One-Time-Porgrammable (OTP) supportMoritz Fischer5-10/+226
The OTP is part of the flash memory. It has 512 (1024 for F7) bytes and is organized in 16 sectors with 32 (64 for F7) bytes each. The OTP is exposed as separate flash bank 1 and can be used with the usual flash commands. Writing the OTP can be done as follows: > stm32f2x otp 1 enable > flash write bank 1 foo.bin 0 > mdw 0x1fff7800 4 > verify_image foo.bin 0x1fff7800 > stm32f2x otp 1 disable Note: This patch is largely a rebase/cleanup of a patch from 2012 by Laurent Charpentier and he did most of the work. No new Clang-Analyzer warnings. Change-Id: I5e6371f6a7c7a9929c1d7907d6ba4724f9d20d97 Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Reviewed-on: http://openocd.zylin.com/829 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-02-25jtag: drivers: cmsis-dap: correct vendor request codePaul Fertser1-2/+2
While at it, change the macro name to make it obvious it's a string, not some numeric ID. This also matches ARM code that's using Change-Id: Id35ba5b95cef0ac77657c40985b24c1ae2720748 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/3855 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-02-25aarch64: fix a potential memory leak in aarch64_target_create()Antonio Borneo1-1/+7
If the function aarch64_target_create() exits for an error, the value of pointer aarch64 get lost, causing a memory leak. Move the allocation of aarch64 after the check on the parameters. While there, add a check on the value returned by calloc(). Issue highlighted by clang 7.0.0. Change-Id: Ib9ad27f4acd940da308c01fdbf33cfe51ab0c639 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4924 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-02-25mem_ap: fix a potential memory leak in mem_ap_target_create()Antonio Borneo1-1/+7
If the function mem_ap_target_create() exits for an error, the value of pointer mem_ap get lost, causing a memory leak. Move the allocation of mem_ap after the check on the parameters. While there, add a check on the value returned by calloc(). Issue highlighted by clang 7.0.0. Change-Id: Ia2c11b14fde9694f28bf6efe01d278923db0f0d4 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4923 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-02-25cortex_a: fix a potential memory leak in cortex_a_target_create()Antonio Borneo1-5/+14
If the function cortex_a_target_create() or the function cortex_r4_target_create() exit for an error, the value of pointer cortex_a get lost, causing a memory leak. Move the allocation of cortex_a after the check on the parameters. While there, add checks on the value returned by calloc(). Issue highlighted by clang 7.0.0. Change-Id: Ic6eeb9c3b39922d016f6d0319eada1a97a6681f0 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4925 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2019-02-21server: fix small mem leak of bindto_nameTomas Vanek1-0/+2
Change-Id: Ib9c8003e164a156f1c4d3cde47e4158d867d82c6 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4909 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2019-02-21Fix support for single-bank stm32l4 processorsArmin van der Togt1-2/+13
Recent patches for STM32L4+ assumed all STM32L4 processors have a dual- bank option. This is not the case for STM32L4{3,4,5,6}xx processors and therefore, these processors (like STM32L433) failed when attempting to flash the second half of the flash memory. This patch fixed this issue. Tested on STM32L433xC, STM32L476xG and STM32L471xG. Change-Id: I8262ba4f05190802c5868d753f3e7af50e581811 Signed-off-by: Armin van der Togt <armin@otheruse.nl> Reviewed-on: http://openocd.zylin.com/4913 Tested-by: jenkins Reviewed-by: Peter Tettelaar <peter@float-iot.nl> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Mark Schulte <mschulte@lyft.com>
2019-02-19ftdi: use "adapter usb location" instead of ftdi_location commandOleksij Rempel3-28/+13
Use unified "adapter usb location" instead of driver specific command. Change-Id: I568a76b87d09cea0f40f1580cf81f7c51402f6f1 Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-on: http://openocd.zylin.com/4771 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>