esp32 pid controller and cache/mmu for external memory

yamamoto
Posts: 6
Joined: Mon Aug 26, 2024 5:34 am

esp32 pid controller and cache/mmu for external memory

Postby yamamoto » Fri Sep 13, 2024 3:45 am

hi,

i'm experimenting to use pid controller to switch mmu mappings for external memory.
(my current focus is spiram, not flash)

i have a few questions.

* is this a viable approach at all? (known erratas etc?)
* is the cache tagged with virtual address? (vivt?)
* when using pid controller, does the cache tag contain pid as well?

yamamoto
Posts: 6
Joined: Mon Aug 26, 2024 5:34 am

Re: esp32 pid controller and cache/mmu for external memory

Postby yamamoto » Tue Sep 24, 2024 11:57 am

i noticed that, when using psram, nuttx uses pid 1 instead of pid 5.
https://github.com/apache/nuttx/blob/82 ... .h#L64-L65
does it imply that pid 0/1 have something special wrt cache/mmu?

MicroController
Posts: 1605
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: esp32 pid controller and cache/mmu for external memory

Postby MicroController » Tue Sep 24, 2024 2:08 pm

ESP32 TRM:
The MMU mapping configuration registers [...] are only accessible from processes with a PID of 0 or 1;
because
processes with PID of 0 or 1 are elevated processes with higher authority compared to processes with PID
ranging from 2 ~ 7.

yamamoto
Posts: 6
Joined: Mon Aug 26, 2024 5:34 am

Re: esp32 pid controller and cache/mmu for external memory

Postby yamamoto » Tue Sep 24, 2024 4:26 pm

thank you for the comment. but i don't think it explains.
in case of nuttx, pid 1 vs 5 is about userspace. the control registers are accessed by the kernel, which is always pid 0.

MicroController
Posts: 1605
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: esp32 pid controller and cache/mmu for external memory

Postby MicroController » Tue Sep 24, 2024 6:29 pm

I think in that case you'd have to check with the NuttX developers on why they need a dedicated PID for external memory allocation in the first place when the kernel running at PID 0 could just do it directly.
My assumption is that these allocations/MMU register accesses are actually not done by the PID 0 kernel itself.

yamamoto
Posts: 6
Joined: Mon Aug 26, 2024 5:34 am

Re: esp32 pid controller and cache/mmu for external memory

Postby yamamoto » Wed Oct 02, 2024 5:22 am

i found a possible cause since then.
https://github.com/apache/nuttx/issues/13761
i guess the use of pid 1 was a workaround for this problem.

Who is online

Users browsing this forum: No registered users and 52 guests