-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Many places in the ESP_SYSTEM are using CONFIG_FREERTOS_UNICORE instead of CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE (IDFGH-11333) #12481
Conversation
👋 Welcome FL0WL0W, thank you for your first contribution to 📘 Please check Contributions Guide for the contribution checklist, information regarding code and documentation style, testing and other topics. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for espressif/esp-idf project. Pull request review and merge process you can expectEspressif develops the ESP-IDF project in an internal repository (Gitlab). We do welcome contributions in the form of bug reports, feature requests and pull requests via this public GitHub repository.
|
@@ -424,7 +424,7 @@ static void IRAM_ATTR NOINLINE_ATTR s_do_mapping(mmu_target_t target, uint32_t v | |||
|
|||
cache_bus_mask_t bus_mask = cache_ll_l1_get_bus(0, vaddr_start, size); | |||
cache_ll_l1_enable_bus(0, bus_mask); | |||
#if !CONFIG_FREERTOS_UNICORE | |||
#if !CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FL0WL0W In your AMP concept, what meaning do you associate with CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE?
- Does it mean that only one core is used — FreeRTOS running on CPU 0, and nothing at all runs on CPU1
- Or does it mean that only one core is used by an IDF app, but there may possibly be a bare-metal app running on CPU1?
Or, putting the same question the other way, what will be the value of CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE in an AMP scenario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @igrr
I will be creating another pull request for AMP. This one is more of a logical reason. These places are not FreeRTOS bits of code and are part of the ESP_System.
To answer your question. In AMP, CONFIG_FREERTOS_UNICORE will be defined and CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE will not be defined. FreeRTOS will be running on one core, while the other core runs a bare metal application.
FREERTOS_UNICORE means FreeRTOS is only running on a single core, but should not necessarily mean nothing is running on the other core
ESP_SYSTEM_SINGLE_CORE_MODE means only 1 core is running code and the other core is disabled and held in reset.
Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, I don't think all the changes in this PR are correct. For example, when we disable the cache during flash operations, we should only synchronize with the CPU1 if there is an ipc1 task running there. However, in the AMP case there is no ipc1 task running on CPU 1, so the task writing to flash on CPU 0 will get blocked forever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are correct, I switched that to use ipc_isr instead when in AMP mode. But that is a larger change that will need more effort to review. I want to get this PR finished first since it is effectively not changing anything given currently ESP_SYSTEM_SINGLE_CORE_MODE = FREERTOS_UNICORE
Hello @FL0WL0W , Thank you for your contribution! Your MR does correct the assumptions that Regarding the future AMP feature, it has been discussed in this Github issue in the past: #10410 While merge this AMP feature as part of IDF experimental features is theoretically feasible, we would rather prefer it to be an external component since we don't plan on supporting or maintaining it. Of course, AMP feature would still be supported by Espressif Zephyr team as part of the Zephyr Project. |
I consider this PR as ready for merging. I understand that Espressif is not interested in supporting the AMP feature. There are a lot of moving parts that make it difficult to support it. As @igrr mentioned in #10410 there are silicon bug workarounds and memory considerations that make it impossible to make this a separate component from the IDF Kernel. I would be happy to have AMP merged as an experimental feature, with the expectation that many features outside of basic GPIO and heap memory allocation may not work as expected. We can talk more about this in the upcoming PR. Thank you |
Does "Selected For Development" mean you want me to continue developing the AMP feature? or that you are testing this change in your internal development GITLab? Looking at the best way to implement the AMP feature, What is the logical difference between portNUM_PROCESSORS and configNUM_CORES? they are always the same value and seem to be used interchangeably. Can i assume that portNUM_PROCESSORS should be ESP_SYSTEM related and configNUM_CORES is FREERTOS related? |
Hello @FL0WL0W , Sorry for the delay of response, |
@FL0WL0W In order to preserve your as the commit author, would you mind squashing your first two commits, rebase on master and modify the description to something more explicit such as:
If you don't mind losing the SHA and the commit author for your changes (due to Tell me what you prefer |
eb35ab3
to
a4a01d1
Compare
@o-marshmallow First time I have used rebase, but I think I did it correctly. If not, feel free to perform the modifications yourself. |
@FL0WL0W Thank you, it's much better! |
sha=c235f7b0a166b9633fe0d70398f94943dc6997c8 |
…RTOS Mergeshttps://github.com//pull/12481
I think this can be closed now that it is pulled in. |
Components of the ESP system that are unrelated to FREERTOS should use the appropriate build definitions. Since these are part of the ESP system they should be using CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE instead of CONFIG_FREERTOS_UNICORE.
Since CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE is directly set by CONFIG_FREERTOS_UNICORE, there will functionally be no difference to how it is now. So there is no risk in making these updates
I am working on making Asymetric Multicore Processing (AMP) work using FREERTOS on one core and bare metal application on the other. This is the first step towards making that possible. This change alone will not make this possible. I will create another issue and PR for making that possible as there are more risky changes the need to be made for that.
See Issue #12480