This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

initial_sp

Hi!

Regarding the __initial_sp in the map, studied some articles on the web and even map file: used as STACK for arm_startup_nrf52840.o!

Ok, let us have an example (from map file):

_my_array 0x20002814 Data 125 xxxxx.o(.data) __initial_sp 0x20002891 Data 0 arm_startup_nrf52840.o(STACK)

Just some questions:

  1. How the STACK/ __initial_sp will be used by arm_startup_nrf52840 in real time?
  2. What happens if a function in the application, frequently in the real time do memset of _my_array with wrong size, for example 160 bytes (instead of 125)?

This will damage the top of the STACK used by arm_startup_nrf52840.o?

The consequences?

BR Mehrdad

Parents
  • Hi Björn!

    Right that: "there are no safety mechanisms when it comes to stack usage on the nRF5x series, i.e. its the developers responsibility to make sure that the stack does not grow outside its limits"!

    But my question was:

    What happens if the application by calling the "memset of an array" with wrong size corrupts the STACK header? Consequences?

    BR M

Reply
  • Hi Björn!

    Right that: "there are no safety mechanisms when it comes to stack usage on the nRF5x series, i.e. its the developers responsibility to make sure that the stack does not grow outside its limits"!

    But my question was:

    What happens if the application by calling the "memset of an array" with wrong size corrupts the STACK header? Consequences?

    BR M

Children
Related