[riot-commits] [RIOT-OS/RIOT] 2f55fd: cortexm_common: Correct offset for hardfault stack

Kaspar Schleiser kaspar at schleiser.de
Thu Nov 2 15:59:38 CET 2017


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: 2f55fdcec4b6caebabd59a65548cc61ba32ab7a9
      https://github.com/RIOT-OS/RIOT/commit/2f55fdcec4b6caebabd59a65548cc61ba32ab7a9
  Author: Joakim NohlgÄrd <joakim.nohlgard at eistec.se>
  Date:   2017-10-30 (Mon, 30 Oct 2017)

  Changed paths:
    M cpu/cortexm_common/ldscripts/cortexm_base.ld
    M cpu/cortexm_common/vectors_cortexm.c

  Log Message:
  -----------
  cortexm_common: Correct offset for hardfault stack

The required space for the hardfault handler is defined by
HARDFAULT_HANDLER_REQUIRED_STACK_SPACE, which is given in bytes,
this length is added to &_sram to find a lower limit on the amount of
stack space that the hard fault handler can work with. The _sram
variable, was mistakenly defined as a uint32_t, which makes &_sram into
a uint32_t*, which through pointer addition, made the required space 4
times as big as it was supposed to. By changing the type of _sram to
uint8_t, the required stack space is correctly computed.

The symptom was that the hardfault handler always reported that the
stack pointer had been corrupted and it was impossible to get any useful
information from the crash text.


  Commit: 7c9f6a476346cecca5f2d90a88cb58286d8cf5eb
      https://github.com/RIOT-OS/RIOT/commit/7c9f6a476346cecca5f2d90a88cb58286d8cf5eb
  Author: Kaspar Schleiser <kaspar at schleiser.de>
  Date:   2017-11-02 (Thu, 02 Nov 2017)

  Changed paths:
    M cpu/cortexm_common/ldscripts/cortexm_base.ld
    M cpu/cortexm_common/vectors_cortexm.c

  Log Message:
  -----------
  Merge pull request #7907 from gebart/pr/cortexm-fix-hardfault-print

cortexm_common: Correct offset for hardfault stack


Compare: https://github.com/RIOT-OS/RIOT/compare/c9448f471f35...7c9f6a476346


More information about the commits mailing list