crafcat7 commented on PR #12968: URL: https://github.com/apache/nuttx/pull/12968#issuecomment-2295602129
> What's the flash usage and ram usage impact? Lots of MCU's use an MPU only on startup, I see there are usecases for making it dynamic. But I really would like to know the cost of it. I am happy to introduce this MPU upgrade: 1. The memory usage is the same as before because no memory application is used. 2. The usage logic is compatible with the original method, so the previous flash configuration is also allowed. Among these three changes, the main one is to adjust the allocation method of g_region. This is a change from simply representing each region with a number to using each bit to indicate whether the region is allocated. We also add an interface to initialize the mpu through the static table(mpu_initialize). During the adjustment process, I noticed that many boards were configured by initializing the configuration through mpu_configure_region. My logic is to return it from void -> unsigned int type value. If we do not plan to adjust the region range later, we do not need to save the return value. The return value represents the currently configured region segment. By holding the region info, we can modify the properties of this region/free this region. However, please note that some platforms do not support overlap (such as armv8m), which may cause unexpected errors. Therefore, when configuring, you need to consider whether the configuration of each region will overlap. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
