pussuw commented on code in PR #7246: URL: https://github.com/apache/incubator-nuttx/pull/7246#discussion_r989022701
########## arch/risc-v/src/mpfs/mpfs_mm_init.c: ########## @@ -205,6 +210,19 @@ static void map_region(uintptr_t paddr, uintptr_t vaddr, size_t size, void mpfs_kernel_mappings(void) { + /* Ensure the sections are aligned properly, requirement is 2MB due to the + * L3 page table size (one table maps 2MB of memory). This mapping cannot + * handle unaligned L3 sections. + */ + + DEBUGASSERT((KFLASH_START & RV_MMU_SECTION_ALIGN) == 0); + DEBUGASSERT((KSRAM_START & RV_MMU_SECTION_ALIGN) == 0); + DEBUGASSERT((PGPOOL_START & RV_MMU_SECTION_ALIGN) == 0); + + /* Check that the L3 table is of sufficient size */ + + DEBUGASSERT(PGT_L3_SIZE >= PGT_L3_MIN_SIZE); Review Comment: > Hiding it behind a debug feature will probably make someone waste some debugging time when facing this issue. Someone like me :)? The reason for making this patch is exactly this. But I had (unknowingly) `CONFIG_DEBUG_ASSERTIONS=y` enabled -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org