Skip to content

Commit d5d77fe

Browse files
igrrgerekon
authored andcommitted
rtos: determine SP correctly for interrupt frames
Offset of -2 indicates that register is the SP, and it is determined as (top SP) + sizeof(frame). However this does not account for the extra stack space which might be reserved by the interrupted function. Use the A1 value saved in the interrupt frame instead.
1 parent 4ba3eb8 commit d5d77fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rtos/rtos_freertos_stackings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static int rtos_freertos_esp108_stack_read_voluntary(struct target *target, int6
3636
static const struct stack_register_offset rtos_freertos_esp108_stack_offsets[] = {
3737
{ 0x04, 32 }, /* PC */
3838
{ 0x0c, 32 }, /* A0 */
39-
{ -2, 32 }, /* A1 */ //0x10
39+
{ 0x10, 32 }, /* A1 */
4040
{ 0x14, 32 }, /* A2 */
4141
{ 0x18, 32 }, /* A3 */
4242
{ 0x1c, 32 }, /* A4 */

0 commit comments

Comments
 (0)