-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[HELP] How to print MMU related information on ARM FVP? #13062
Comments
@lzc1001 look inside arch/arm64/src/common/arm64_mmu.c the virtual and physical addresses are no printed by default, you need to add a new "sinfo()" with that values you want to print |
@acassis Thanks for your answer!😀 So, I need to write a new "sinfo()" by myself? Because I found that this function was already written in the code, but it was wrapped in the macro. |
@lzc1001 hmm, I think I discovered the issue: there is not CONFIG_MMU_DEBUG. There need to exist an MMU_DEBUG symbol defined inside a Kconfig or you can just comment out these lines:
|
@lzc1001 if you get it working, please close this Issue |
@acassis i add "#define CONFIG_MMU_DEBUG 1" to arch/arm64/src/common/arm64_mmu.c, then run on FVP. But the related mmu information still do not print.😫 |
@lupyuen any idea? |
Hi @lzc1001 you mentioned FVP, could you verify that this is the Build Config that we used? $ tools/configure.sh fvp-armv8r:nsh
$ grep MMU .config
# CONFIG_ARCH_HAVE_MMU is not set I tried $ ./tools/configure.sh qemu-armv8a:nsh
$ grep MMU .config
CONFIG_ARCH_HAVE_MMU=y
# CONFIG_ARCH_USE_MMU is not set Update: Sorry I forgot to enable Scheduler Info Logging for QEMU, now I can see the MMU Log for QEMU. Here's how I enabled logging MMU Logging in arch/arm64/src/common/arm64_mmu.c: /***************************************************************************
* Pre-processor Definitions
***************************************************************************/
// Uncommented the MMU debug options
#define CONFIG_MMU_ASSERT 1
#define CONFIG_MMU_DEBUG 1
#define CONFIG_MMU_DUMP_PTE 1
// CONFIG_MMU_ASSERT needs this
#define trace_printf sinfo
// Existing code below...
#ifdef CONFIG_MMU_DEBUG And here's the MMU Log for QEMU: $ ./tools/configure.sh -l qemu-armv8a:nsh
$ make menuconfig
## TODO: Enable Scheduler Info Logging
$ make
$ qemu-system-aarch64 -cpu cortex-a53 -nographic \
-machine virt,virtualization=on,gic-version=3 \
-net none -chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel ./nuttx
arm64_mmu_init: xlat tables:
arm64_mmu_init: base table(L1): 0x403c5000, 64 entries
arm64_mmu_init: 0: 0x403be000
arm64_mmu_init: 1: 0x403bf000
arm64_mmu_init: 2: 0x403c0000
arm64_mmu_init: 3: 0x403c1000
arm64_mmu_init: 4: 0x403c2000
arm64_mmu_init: 5: 0x403c3000
arm64_mmu_init: 6: 0x403c4000
init_xlat_tables: mmap: virt 117440512x phys 117440512x size 536870912x Could you verify that MMU is enabled for NuttX on FVP? Thanks. |
@lupyuen Thanks for your answer! I ported NuttX to A53 based on FVP in the last few days and ARM A53 have MMU. Then, NuttX can boot and input command to terminal, like "ls", "hello", etc. So, I think MMU is enabled for NuttX on FVP. But I do't make sure that the porting code have some potential bug, hhh😀. |
@lzc1001 Can you verify that the NuttX Config supports MMU? $ grep MMU .config
CONFIG_ARCH_HAVE_MMU=y
# CONFIG_ARCH_USE_MMU is not set Is it possible that the MMU code is disabled due to other reasons? Perhaps we can add an Error Message in arch/arm64/src/common/arm64_mmu.c: int arm64_mmu_init(bool is_primary_core)
{
#error MMU is enabled
... |
@lupyuen Yes! The config support MMU |
@lzc1001 I wonder if |
|
@raiden00pl @lupyuen @lzc1001 maybe RAMLOG could solve this issue. |
@acassis RAMLOG is registered also late in boot process (in
|
Understood! Thank you @raiden00pl |
@acassis @raiden00pl @lupyuen Thank you very much! |
Description
I want to print virtual address and physical address when initialize MMU in arm64_mmu.c. So, I set CONFIG_MMU_DEBUG = 1 and set other configuration as following picture.
But the related mmu configuration information do not print.
Thanks for everyone!
Verification
The text was updated successfully, but these errors were encountered: