Skip to content
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

ESP32-S3 APP_CPU flash support #82781

Merged

Conversation

marekmatej
Copy link

@marekmatej marekmatej commented Dec 10, 2024

This PR enables flash support for APP_CPU target on ESP32-S3 chip.

  • add cache node into .dts
  • update default_appcpu.ld to support flash
  • update the map_rom_segment to be used by both CPUs.

@zephyrbot
Copy link
Collaborator

zephyrbot commented Dec 10, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@marekmatej marekmatej added the platform: ESP32 Espressif ESP32 label Dec 16, 2024
@marekmatej marekmatej force-pushed the feature/appcpu_flash_support branch from 60e8a4f to b488392 Compare December 16, 2024 14:14
@marekmatej marekmatej force-pushed the feature/appcpu_flash_support branch from b488392 to 5b65a2f Compare January 9, 2025 21:08
@marekmatej marekmatej force-pushed the feature/appcpu_flash_support branch 3 times, most recently from da8bd65 to b41f514 Compare January 31, 2025 18:08
@marekmatej marekmatej force-pushed the feature/appcpu_flash_support branch from b41f514 to df1a4ec Compare February 10, 2025 15:08
@marekmatej marekmatej changed the title ESP32 app_cpu flash support ESP32-S3 APP_CPU flash support Feb 10, 2025
@marekmatej marekmatej force-pushed the feature/appcpu_flash_support branch from df1a4ec to f787892 Compare February 10, 2025 16:34
Create the cache memory node instead of hardcoding addresses.

Signed-off-by: Marek Matej <[email protected]>
@marekmatej marekmatej force-pushed the feature/appcpu_flash_support branch from f787892 to ba904fc Compare February 10, 2025 19:14
@marekmatej marekmatej marked this pull request as ready for review February 10, 2025 19:19
@zephyrbot zephyrbot added the area: Xtensa Xtensa Architecture label Feb 10, 2025
@zephyrbot zephyrbot requested a review from nashif February 10, 2025 19:20
@marekmatej marekmatej force-pushed the feature/appcpu_flash_support branch from ba904fc to b1a10e5 Compare February 10, 2025 19:27
Update to support APP_CPU flash access.

- fix the map_rom_segment so it can be used in other context
- add IROM and DROM region size in Kconfig
- update the memory.h by using dts records
- fix the appcpu ld file to support flash

Signed-off-by: Marek Matej <[email protected]>
@marekmatej marekmatej force-pushed the feature/appcpu_flash_support branch from b1a10e5 to 7d75f6f Compare February 10, 2025 21:01
Copy link
Member

@uLipe uLipe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be defined in DTS?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, current dts is not very good for making memory layouts, so I prefer this way of splitting the memory

#else
cache_hal_disable(CACHE_TYPE_ALL);
#endif /* CONFIG_SOC_SERIES_ESP32 */

/* Clear the MMU entries that are already set up,
* so the new app only has the mappings it creates.
*/
mmu_hal_unmap_all();
if (core == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are only building this file for core==0, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is true, however it is called 2nd time when creating maps for the APP_CPU.

@@ -68,28 +72,32 @@

#define HDR_ATTR __attribute__((section(".entry_addr"))) __attribute__((used))

#if !defined(CONFIG_SOC_ESP32_APPCPU) && !defined(CONFIG_SOC_ESP32S3_APPCPU)
#define PART_OFFSET FIXED_PARTITION_OFFSET(slot0_partition)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to use APPCPU_SLOT_OFFSET instead of PART_OFFSET?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, not blocking at all.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it doesn't, the code is used in both cases PRO_CPU and APP_CPU

@kartben kartben merged commit 9e49bbf into zephyrproject-rtos:main Feb 12, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Xtensa Xtensa Architecture platform: ESP32 Espressif ESP32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants