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

GPS stack size usage

Is there in any way a method to monitor the GPS stack usage, so that the usage might be printed?

Parents
  • Hi Tron,

    I do not think there is something that will do this out of the box. 

     Zephyr has the Stack Sentinel  and  Stack Canary features in addition to other stack protection features that can be enabled to detect stack corruption issues, but it will be hard to correlate this to the stack usage of the GPS itself. 

    One approach could be to enable the stack canary and then start to increase the GPS thread size from low to high until your test is complete and no stack overflow trigger has happened.

    Zephyr also do static analysis of the theoretical stack use of non-reentrant functions, but that's a theoretical standpoint that cannot align for dynamic allocation of memory, or asynchronous operations (interrupts)

    To do this you build the project with -t ram_report , e.g "west build -b nrf9160_pca10090ns -t ram_report"
    Best regards
    Bjørn
Reply
  • Hi Tron,

    I do not think there is something that will do this out of the box. 

     Zephyr has the Stack Sentinel  and  Stack Canary features in addition to other stack protection features that can be enabled to detect stack corruption issues, but it will be hard to correlate this to the stack usage of the GPS itself. 

    One approach could be to enable the stack canary and then start to increase the GPS thread size from low to high until your test is complete and no stack overflow trigger has happened.

    Zephyr also do static analysis of the theoretical stack use of non-reentrant functions, but that's a theoretical standpoint that cannot align for dynamic allocation of memory, or asynchronous operations (interrupts)

    To do this you build the project with -t ram_report , e.g "west build -b nrf9160_pca10090ns -t ram_report"
    Best regards
    Bjørn
Children
Related