Commit Graph

27 Commits

Author SHA1 Message Date
Andreas Färber 0c8ec7c826 Fix spelling of ARM Cortex
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-20 21:38:03 +01:00
Jonathan Dumaresq f5b7033742 RTOS support: Add FPU support for FreeRTOS
Add new structure for for working with FPU thread in thread view.
This modification support both stacking.
When FPU is activated, LR must be validated to check if the FPU
register are push on the stack. This is mandatory to find the correct
stack pointer position.

the modified code was inspired and adapted from

88d2003bb8

Change-Id: I6641926aa14e7216cacb399cbc8bb0db324cc9fc
Signed-off-by: Jonathan Dumaresq <jdumaresq@cimeq.qc.ca>
Reviewed-on: http://openocd.zylin.com/3397
Tested-by: jenkins
Reviewed-by: Sergey A. Borshch <sb-sf@users.sourceforge.net>
Reviewed-by: Harry Zhurov <harry.zhurov@gmail.com>
Reviewed-by: Anton Gusev
Reviewed-by: Михаил Цивинский <mtsivinsky@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2016-05-04 22:36:23 +01:00
Andreas Fritiofson 9dfb58e802 rtos: add instructions and helper code to make FreeRTOS work again
Run-time tested with FreeRTOS V8.1.2 (current version).

For the time being I propose this way of dealing with RTOSes that do
not export necessary information on their own.

I also suggest implementing a similar scheme for ChibiOS, exporting
the necessary struct fields' offsets via an OpenOCD-specific helper.

Change-Id: Iacf8b88004d62206215fe80011fd7592438446a3
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2347
Tested-by: jenkins
2015-04-16 20:23:46 +01:00
Andreas Fritiofson 6b2887e16a FreeRTOS: Make optional symbols optional
xSuspendedTaskList and xTasksWaitingTermination are only available for
some configurations. Missing optional symbols will have their addresses
remaining at zero so the corresponding lists will be skipped when
building the task list.

Change-Id: If330f5038d009298c3a14a4d2756db7105a30bc8
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2425
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-04-16 20:20:28 +01:00
Evan Hunter 0836a0fa21 RTOS: Add logging to FreeRTOS and general RTOS
Change-Id: I43d14f3b59daae7f90c344abdf71eaa8f74ef7ef
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/2391
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-04-14 11:42:58 +01:00
Paul Fertser 6d562283b5 rtos: allow symbols to be optional for a particular RTOS
Default to non-optional.

Change-Id: Ifc9ddb1ab701a19c3760f95da47da6f7d412ff2e
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2355
Tested-by: jenkins
Reviewed-by: Christian Gudrian <christian.gudrian@gmx.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-11-24 22:21:37 +00:00
Spencer Oliver 03410e92da rtos: constify symbol names and lists
Change-Id: I72f3cd50fc6a33a178e72e169c9660e707751524
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2292
Tested-by: jenkins
2014-10-06 11:57:29 +00:00
Andreas Fritiofson e6907e6d7e Don't cast return value of [cm]alloc
Change-Id: I0028a5b6757b1ba00031893d9a2a1725f915a0d5
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/2069
Tested-by: jenkins
Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-30 03:53:45 +00:00
Christian Eggers d36889e692 RTOS: Unify wipe-out of thread list
Each RTOS implementation uses it's own (similar) code to free
the thread list. There are some additional issues:

<--->
if (pointer != NULL)
	free(pointer);
<--->
This is not necessary, free(NULL) is perfectly ok.

<--->
free(rtos->thread_details);
rtos->thread_details = NULL;
rtos->thread_count = 0;
<--->
The 3rd line has been missing for all RTOS but ChibiOs. There are paths
in the code where rtos->thread_count is never set to NULL, which can
lead to null pointer dereference of rtos->thread_details.

Change-Id: I6f7045c3d4518b925cb80dd5c907a566536b34ad
Signed-off-by: Christian Eggers <ceggers@gmx.de>
---
Changelog:
v7:
- rtos_wipe_threadlist() --> rtos_free_threadlist()
- removed non related changes in gdb_server.c from this patch
v3:
- Removed world "topic" from first line of commit message
v2:
- typo: "whipe" --> "wipe"
Reviewed-on: http://openocd.zylin.com/1916
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-04 20:13:58 +00:00
Hsiangkai Wang 356f8a7412 nds32: support FreeRTOS
Change-Id: I117b5541fb19388c0f5c2344ee42d9151c9a222e
Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com>
Reviewed-on: http://openocd.zylin.com/1577
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-09-13 19:37:45 +00:00
Spencer Oliver 08d4411b59 update files to correct FSF address
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-06-05 19:52:42 +00:00
Spencer Oliver b7d2cdc0d4 target: rename cortex_m3 to cortex_m
Rename cortex_m3 target to use a more correct cortex_m name.
This also adds a deprecated_name var so that older scripts issue a warning
to update the target name.

cfg files have also been updated to the new target name.

Change-Id: Ia8429f38e88da677249c5caa560c50f8ce56ea10
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1129
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-04-28 08:55:31 +00:00
Spencer Oliver 08fc741733 rtos: do not use LOG_OUTPUT
LOG_OUTPUT is not intended for general output so use the correct LOG_*
functions instead.

Change-Id: I48d0fe765637024dbafc68f2ea08219d3ff42754
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1104
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-01-27 14:29:34 +00:00
Spencer Oliver bd1502eb0f rtos: rename stm32_stlink target to hla_target
Update rtos detection to use the new target name.

Change-Id: I4e55311bcfbc8af55708b43daf0c73b1c8145934
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/923
Tested-by: jenkins
2012-12-23 21:45:54 +00:00
Matthias Blaicher 3a6ac23716 rtos: Use ARRAY_SIZE instead of coding it by hand
Use ARRAY_SIZE in helper/types.h to determine the size of the
symbol list.

Change-Id: Icc9838323510f8602efa5d0162a4daed33f863b9
Signed-off-by: Matthias Blaicher <matthias@blaicher.com>
Reviewed-on: http://openocd.zylin.com/935
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-10-28 01:25:39 +00:00
Paul Fertser a136b08fc3 rtos: support FreeRTOS over stlink
Since stlink is a special case it presents the same CPU core under a
different name, so copy the configuration to account for that.

Change-Id: I9febf79b388301bde6211d185b5b8161cdadb9ff
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/652
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-08 20:36:18 +00:00
Spencer Oliver 60a932b368 build: fix memory leaks
Fix the memory leaks found by clang-3.1

Change-Id: Iaae68627ef599c324c9c9ee5737c22e92512862d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/775
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-08-24 16:49:56 +00:00
Paul Fertser e26d076190 rtos: add sanity checking for FreeRTOS's quantity of priorities
On operating systems with opportunistic malloc() (e.g. default setting in
GNU/Linux) malloc can sometimes allocate a huge memory region but later the
process will get killed on the first attempt to use this memory, so
checking for malloc's return value is not enough to prevent a crash.

This patch is compile-tested only.

Change-Id: I5e21663115c8e9a0ca9f3d71f7ba4bd09e5c3bb1
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/521
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-19 17:07:44 +00:00
Paul Fertser fe11baeebb rtos: fix segfault in FreeRTOS handling
When gdb loads an elf file of a newer or older version of the firmware
being debugged, or when the firmware is not running yet, there's a high
probability of FreeRTOS variables to be read incorrectly, thus leading to
an attempt to allocate an enourmous amount of memory. Without this check
OpenOCD simply crashes and that's mad confusing.

Change-Id: I404a072e886d2d47d9d942cfaea8417eb8bd4a5d
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/520
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-19 17:07:26 +00:00
Spencer Oliver 7b032df3aa build: cleanup src/rtos directory
Change-Id: I24bc62d12409dbfc20a0a986acf6b3f2c913e36d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/416
Tested-by: jenkins
2012-02-06 10:50:26 +00:00
Øyvind Harboe 7e817839f3 clang: fix warning about missing check for return value
Change-Id: I0c6b6b8d1f0c30b6a503cb98df30584252bc0ee1
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/129
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-27 17:38:46 +00:00
Evan Hunter e175f02715 Fix off by one bug in FreeRTOS 2011-08-27 19:37:22 +02:00
Evan 32862ed9f8 Add suspended task list to FreeRTOS support 2011-08-24 11:14:33 +02:00
Evan Hunter 85219514cf Fix FreeRTOS thread list parsing 2011-08-24 11:14:28 +02:00
Luca Bruno 898dd3af46 Fix typo in command output
Fix a bunch of minor typo in user facing output.

Signed-off-by: Luca Bruno <lucab@debian.org>
2011-07-10 17:00:57 +02:00
Michel Jaouen 3c6af518b3 rtos : compilation error on amd64 2011-04-19 12:53:56 +02:00
Broadcom Corporation (Evan Hunter) b69119668e RTOS Thread awareness support wip
- works on Cortex-M3 with ThreadX and FreeRTOS

Compared to original patch a few nits were fixed:

- remove stricmp usage
- unsigned compare fix
- printf formatting fixes
- fixed a bug with overrunning a memory buffer allocated with malloc.
2011-04-15 08:24:18 +02:00