Skip to content

esp_execute_shared_stack_function Documentation Issue & Alternative Approach (IDFGH-16500) #17639

@Narukara

Description

@Narukara

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

I have a few questions regarding the Call Function with External Stack feature and the esp_execute_shared_stack_function:

  1. The official documentation mentions that the user-defined function is deferred as a callback, suggesting it is called asynchronously. However, in both the RISC-V and Xtensa implementations, the function is executed immediately within the current thread (albeit using an external stack). Should the documentation be updated to reflect this behavior?
  2. The current implementation of esp_execute_shared_stack_function is quite intricate. It directly modifies the current task’s stack pointer, which can lead to issues such as incorrect backtraces, as noted in the documentation. I’m wondering if a more robust approach would be to create a dedicated task and delegate the function execution to it. This method would better align with the documented idea of "deferred as a callback." Would this be a feasible alternative implementation?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions