<feed xmlns='http://www.w3.org/2005/Atom'>
<title>OpenOCD/src/rtos, branch mips-hack</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>https://git.amat.us/openocd/atom/src/rtos?h=mips-hack</id>
<link rel='self' href='https://git.amat.us/openocd/atom/src/rtos?h=mips-hack'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/'/>
<updated>2015-11-03T21:58:50Z</updated>
<entry>
<title>rtos/mqx: Fix uninitialized parts of symbol table</title>
<updated>2015-11-03T21:58:50Z</updated>
<author>
<name>daniel-k</name>
<email>github@daniel-krebs.net</email>
</author>
<published>2015-10-14T15:30:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=9bf5309ec7b343cc304f6c72d165003e1e096b29'/>
<id>urn:sha1:9bf5309ec7b343cc304f6c72d165003e1e096b29</id>
<content type='text'>
Memory for the symbol table was allocated by malloc but not initialized other
than with the symbol name. Therefore `address` and `optional` members were
having arbitrary values leading to every symbol being optional most of the
time which messes up RTOS auto-detection. Memory will now be zero-initialized
as in other RTOS implementations.

Change-Id: I6c6e31ec1ef7e043061adf8c695b2139620e005d
Signed-off-by: Daniel Krebs &lt;github@daniel-krebs.net&gt;
Reviewed-on: http://openocd.zylin.com/3017
Tested-by: jenkins
Reviewed-by: Freddie Chopin &lt;freddie.chopin@gmail.com&gt;
</content>
</entry>
<entry>
<title>rtos: handle STKALIGN adjustments on cortex m</title>
<updated>2015-10-30T23:44:04Z</updated>
<author>
<name>Andrew Ruder</name>
<email>andrew.ruder@elecsyscorp.com</email>
</author>
<published>2015-10-05T18:52:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=afb083625c9ee7871004f9f6a00d04173ddf83f0'/>
<id>urn:sha1:afb083625c9ee7871004f9f6a00d04173ddf83f0</id>
<content type='text'>
In the case that the STKALIGN bit is set on Cortex M processors, on
entry to an exception - the processor can store an additional 4 bytes
of padding before regular stacking to achieve 8-byte alignment on
exception entry.  In the case that this padding is present, the
processor will set bit (1 &lt;&lt; 9) in the stacked xPSR register.  Use the
new calculate_process_stack callback to take into account the xPSR
register and use it on the standard Cortex_M3 stacking.

Note: Change #2301 had some misinformation regarding the padding.  On
Cortex-M the padding is stored BEFORE stacking so xPSR is always
available at a fixed offset.

Tested on a Cortex-M0+ (Atmel SAMR21) board which has STKALIGN fixed
to a '1' such that this alignment always occurs on non-aligned stacks.

Behavior of xPSR verified via the (bad-sorry) assembly program below by
setting a breakpoint on the SVC_Handler symbol.  The first time
SVC_Handler is triggered the stack was 0x20000ff8, the second time
SVC_Handler is triggered the stack was 0x20000ffc.  Note that in both
cases the interrupt handler gets 0x20000fd8 for a stack pointer.

GDB exerpt:

Breakpoint 1, 0x000040b6 in Reset_Handler ()
(gdb) hbreak SVC_Handler
Hardware assisted breakpoint 2 at 0x40f8
(gdb) cont
Continuing.

Breakpoint 2, 0x000040f8 in SVC_Handler ()
(gdb) print $msp
$3 = (void *) 0x20000fd8
(gdb) x/9w $msp
0x20000fd8:     0x1     0x2     0x3     0x4
0x20000fe8:     0x88160082      0xa53   0x40ce  0x21000000
0x20000ff8:     0x0
(gdb) cont
Continuing.

Breakpoint 2, 0x000040f8 in SVC_Handler ()
(gdb) print $msp
$4 = (void *) 0x20000fd8
(gdb) x/9w $msp
0x20000fd8:     0x1     0x2     0x3     0x4
0x20000fe8:     0x88160082      0xa53   0x40e8  0x21000200
0x20000ff8:     0x0

Assembly program:

	.cpu cortex-m0plus
	.fpu softvfp
	.thumb
	.syntax unified

.section .vectors
@ pvStack:
	.word	0x20001000
@ pfnReset_Handler:
	.word	Reset_Handler + 1
@ pfnNMI_Handler:
	.word	0
@ pfnHardFault_Handler:
	.word	0
@ pfnReservedM12:
	.word	0
@ pfnReservedM11:
	.word	0
@ pfnReservedM10:
	.word	0
@ pfnReservedM9:
	.word	0
@ pfnReservedM8:
	.word	0
@ pfnReservedM7:
	.word	0
@ pfnReservedM6:
	.word	0
@ pfnSVC_Handler:
	.word	SVC_Handler + 1

.section .text
.global Reset_Handler
Reset_Handler:
    cpsie i
    ldr r0, .stack_start
    ldr r2, .stack_last
    eors r1, r1
.loop_clear:
    str r1, [r0]
    adds r0, r0, #4
    cmp r0, r2
    bne .loop_clear
    subs r2, r2, #4
    mov sp, r2
    movs r0, #1
    movs r1, #2
    movs r2, #3
    movs r3, #4
    svc #0
    ldr r0, .stack_start
    ldr r2, .stack_last
    eors r1, r1
.loop_clear2:
    str r1, [r0]
    adds r0, r0, #4
    cmp r0, r2
    bne .loop_clear2
    mov sp, r2
    movs r0, #1
    movs r1, #2
    movs r2, #3
    movs r3, #4
    svc #0
.loop:
	b .loop
.align 4
.stack_start:
    .word 0x20000f00
.stack_last:
    .word 0x20000ffc

@ first call - 0x2000fff8 -- should already be aligned
@ second call - 0x2000fffc -- should hit the alignment code
.global SVC_Handler
SVC_Handler:
    bx lr

Change-Id: Id0940e6bbd6a59adee1378c0e86fe86830f0c8fc
Signed-off-by: Andrew Ruder &lt;andrew.ruder@elecsyscorp.com&gt;
Cc: Paul Fertser &lt;fercerpav@gmail.com&gt;
Cc: Andreas Fritiofson &lt;andreas.fritiofson@gmail.com&gt;
Cc: Evan Hunter &lt;evanhunter920@gmail.com&gt;
Cc: Jon Burgess &lt;jburgess777@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/3003
Tested-by: jenkins
Reviewed-by: Freddie Chopin &lt;freddie.chopin@gmail.com&gt;
</content>
</entry>
<entry>
<title>rtos: turn stack alignment into a function pointer</title>
<updated>2015-10-30T23:41:44Z</updated>
<author>
<name>Andrew Ruder</name>
<email>andrew.ruder@elecsyscorp.com</email>
</author>
<published>2015-10-05T18:51:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=9413a7a814755f3fab92f460bfbdd518f24ffaf5'/>
<id>urn:sha1:9413a7a814755f3fab92f460bfbdd518f24ffaf5</id>
<content type='text'>
Some targets (Cortex M) require more complicated calculations for
turning the stored stack pointer back into a process stack pointer.
For example, the Cortex M stores a bit in the auto-stacked xPSR
indicating that alignment had to be performed and an additional 4
byte padding is present before the exception stacking.  This change
only sets up the framework for Cortex-M unstacking and does not
add Cortex-M support.

Note: this also fixes the alignment calculation nearly addressed by
change #2301 entitled rtos/rtos.c: fix stack alignment calculation.
Updated calculation is in rtos_generic_stack_align.

Change-Id: I0f662cad0df81cbe5866219ad0fef980dcb3e44f
Signed-off-by: Andrew Ruder &lt;andrew.ruder@elecsyscorp.com&gt;
Cc: Paul Fertser &lt;fercerpav@gmail.com&gt;
Cc: Andreas Fritiofson &lt;andreas.fritiofson@gmail.com&gt;
Cc: Evan Hunter &lt;evanhunter920@gmail.com&gt;
Cc: Jon Burgess &lt;jburgess777@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/3002
Reviewed-by: Andreas Fritiofson &lt;andreas.fritiofson@gmail.com&gt;
Tested-by: jenkins
</content>
</entry>
<entry>
<title>RTOS: ThreadX support on ARM926E-JS</title>
<updated>2015-08-06T12:07:39Z</updated>
<author>
<name>Alexander Drozdov</name>
<email>adrozdoff@gmail.com</email>
</author>
<published>2015-07-02T08:32:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=383a835bcd6ea6797fbf646a5faae3997b91c7e1'/>
<id>urn:sha1:383a835bcd6ea6797fbf646a5faae3997b91c7e1</id>
<content type='text'>
ThreadX uses two stacking schemas on ARM926E-JS, extend API to use more then
one stecking at time.

Change-Id: I92d445ad0981b6409ea4c4e7e438d3a7ae39cbe7
Signed-off-by: Alexander Drozdov &lt;adrozdoff@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/2848
Tested-by: jenkins
Reviewed-by: Spencer Oliver &lt;spen@spen-soft.co.uk&gt;
</content>
</entry>
<entry>
<title>rtos/mqx: prevent crash with -rtos auto</title>
<updated>2015-04-24T13:49:06Z</updated>
<author>
<name>Paul Fertser</name>
<email>fercerpav@gmail.com</email>
</author>
<published>2015-04-24T11:43:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=528197ba2cf2b208efa4d5c8465a9044567e8d69'/>
<id>urn:sha1:528197ba2cf2b208efa4d5c8465a9044567e8d69</id>
<content type='text'>
Since mqx comes last in the list, with the auto option its
update_threads is called even though it wasn't detected.

This check should be removed from all the rtos helpers and moved to
the generic code, but better do it later all in one go.

Change-Id: If24ab42a58a468d90e9f12028d4c2fb76a9bc2e8
Signed-off-by: Paul Fertser &lt;fercerpav@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/2741
Tested-by: jenkins
</content>
</entry>
<entry>
<title>rtos: fix print format specifiers</title>
<updated>2015-04-24T13:46:19Z</updated>
<author>
<name>Paul Fertser</name>
<email>fercerpav@gmail.com</email>
</author>
<published>2015-04-20T09:02:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=0d50dfe31840ddd282aa2ca7507c45f607284fc6'/>
<id>urn:sha1:0d50dfe31840ddd282aa2ca7507c45f607284fc6</id>
<content type='text'>
Exposed by arm-none-eabi build.

Change-Id: I657c642249aa83403f93132d1e28713aee692c30
Signed-off-by: Paul Fertser &lt;fercerpav@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/2724
Tested-by: jenkins
</content>
</entry>
<entry>
<title>rtos: add instructions and helper code to make FreeRTOS work again</title>
<updated>2015-04-16T19:23:46Z</updated>
<author>
<name>Andreas Fritiofson</name>
<email>andreas.fritiofson@gmail.com</email>
</author>
<published>2015-04-16T11:08:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=9dfb58e802787b1dcee756cdf963a7a2ac808eca'/>
<id>urn:sha1:9dfb58e802787b1dcee756cdf963a7a2ac808eca</id>
<content type='text'>
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 &lt;fercerpav@gmail.com&gt;
Signed-off-by: Andreas Fritiofson &lt;andreas.fritiofson@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/2347
Tested-by: jenkins
</content>
</entry>
<entry>
<title>FreeRTOS: Make optional symbols optional</title>
<updated>2015-04-16T19:20:28Z</updated>
<author>
<name>Andreas Fritiofson</name>
<email>andreas.fritiofson@gmail.com</email>
</author>
<published>2015-04-16T08:56:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=6b2887e16acefada94a496ef786882d04b9b89a2'/>
<id>urn:sha1:6b2887e16acefada94a496ef786882d04b9b89a2</id>
<content type='text'>
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 &lt;andreas.fritiofson@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/2425
Tested-by: jenkins
Reviewed-by: Paul Fertser &lt;fercerpav@gmail.com&gt;
</content>
</entry>
<entry>
<title>ChibiOS: fix crash on auto detection</title>
<updated>2015-04-14T11:16:50Z</updated>
<author>
<name>Richard Braun</name>
<email>rbraun@sceen.net</email>
</author>
<published>2015-03-11T13:04:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=7090edc813525caaade84a6322fdce89d3cd8f6a'/>
<id>urn:sha1:7090edc813525caaade84a6322fdce89d3cd8f6a</id>
<content type='text'>
The detection framework assumes rtos-&gt;symbols is dynamically allocated,
an assumption that the ChibiOS variant breaks by providing a raw statically
allocated symbol list.

Change-Id: I379bcc2af99006912608ddd3f646ff7085606f47
Signed-off-by: Richard Braun &lt;rbraun@sceen.net&gt;
Reviewed-on: http://openocd.zylin.com/2597
Tested-by: jenkins
Reviewed-by: Stian Skjelstad &lt;stian@nixia.no&gt;
Reviewed-by: Tomas Vanek &lt;vanekt@fbl.cz&gt;
Reviewed-by: Paul Fertser &lt;fercerpav@gmail.com&gt;
</content>
</entry>
<entry>
<title>RTOS: Add logging to FreeRTOS and general RTOS</title>
<updated>2015-04-14T10:42:58Z</updated>
<author>
<name>Evan Hunter</name>
<email>ehunter@broadcom.com</email>
</author>
<published>2014-11-21T17:07:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=0836a0fa21e7f2363891c04b195ddb91f94abf28'/>
<id>urn:sha1:0836a0fa21e7f2363891c04b195ddb91f94abf28</id>
<content type='text'>
Change-Id: I43d14f3b59daae7f90c344abdf71eaa8f74ef7ef
Signed-off-by: Evan Hunter &lt;ehunter@broadcom.com&gt;
Reviewed-on: http://openocd.zylin.com/2391
Tested-by: jenkins
Reviewed-by: Spencer Oliver &lt;spen@spen-soft.co.uk&gt;
</content>
</entry>
</feed>
