CONFIG_HW_STACK_PROTECTION implementation on nrf52840

What is the implementation of CONFIG_HW_STACK_PROTECTION on the nrf52840, using Zephyr (ncs 1.9.2)?

How does it differ from using  CONFIG_STACK_SENTINEL?

Parents
  • Hello,

    Sorry for the delayed response and my last response was bit confusing as I included ArmV8 in that. In simple words CONFIG_HW_STACK_PROTECTION is a Hardware based platform feature to check the stack overflow. And CONFIG_HW_STACK_PROTECTION is enabled automatically if CONFIG_USERSPACE=n (disabled),AFAIK cortex M4 based IC lacks of hardware based stack overflow checking. But CONFIG_STACK_SENTINEL feature will enable stack overflow protection for those systems which lack hardware support.

    Kind Regards,

    Abhijith

Reply
  • Hello,

    Sorry for the delayed response and my last response was bit confusing as I included ArmV8 in that. In simple words CONFIG_HW_STACK_PROTECTION is a Hardware based platform feature to check the stack overflow. And CONFIG_HW_STACK_PROTECTION is enabled automatically if CONFIG_USERSPACE=n (disabled),AFAIK cortex M4 based IC lacks of hardware based stack overflow checking. But CONFIG_STACK_SENTINEL feature will enable stack overflow protection for those systems which lack hardware support.

    Kind Regards,

    Abhijith

Children
  • Hi, and thanks for the answer but I still need some clarification.

    CONFIG_STACK_SENTINEL uses a software implementation and it can also be used, this is clear.

    But CONFIG_HW_STACK_PROTECTION is based on hardware implementation which is not supported in arm cortex m4, but it still raises an assertion when I test a case for stack overflow. It is also enabled for the nrf52840dk in:

    zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig

    So what is the implementation of CONFIG_HW_STACK_PROTECTION for the nrf52840?

Related