Git Product home page Git Product logo

Comments (4)

yuhui-zheng avatar yuhui-zheng commented on August 28, 2024

Thank you for raising this issue.

For our side:
I think it's a good practice to always have an else branch. And in this case, adding a #warning for portMPU_TYPE_REG != portEXPECTED_MPU_TYPE_VALUE would be something quick dirty we can do to at least ease the pain.

For your side:
I'm not sure how far you went with your project. But in case you may need to jump start on 16-entry MPU...

  • prvSetupMPU() This function as you are already aware of, is for setting up MPU entries for none task specific regions. If your linker script has the same symbols and section size/alignment, you may likely be able to just use this part with minimum modification.
  • And since now we have more entries, these can be used (partially or however suits your application scenario) for either task specifics or global settings. If global, could append prvSetupMPU(). If task specific, need to save settings in task context -- related functions, namely vPortRestoreContextOfFirstTask(), and vPortStoreTaskMPUSettings().

from freertos-kernel.

rahmanih avatar rahmanih commented on August 28, 2024

Hi @yuhui-zheng,

thanks for the answer, but I didn't really catch your comment above, could you please explain further?
Do you mean that the prvSetupMPU() doesn't need to be updated to support the 16 regions MPU?

sorry for the disturbance.

regards
Haithem.

from freertos-kernel.

yuhui-zheng avatar yuhui-zheng commented on August 28, 2024

Before more words to confuse you... Supporting 16-entry MPU out-of-box is of our interest, though I don't have a concrete timeline to share when typing this line. The bullet points are mostly for "in case you need it yesterday" and you were planning to customize existing MPU port.

Expanding comments on prvSetupMPU() a little bit. (In your first post you linked IAR/CORTEX_M4F_MPU port, so that below is specific to this port.)

The other part to MPU initialization is how memory is partitioned in your application (with linker script). As an example, CORTEX_MPU_STM32L4_Discovery_GCC_IAR_Keil/Projects/IAR this project uses this linker script along with IAR/CORTEX_M4F_MPU port. __privileged_functions_start__ is set to address 0x08000000, and __privileged_functions_end__ is set to address 0x08007FFF. So that these lines set up an MPU entry to grant privilege mode read-only access to functions in memory address range of [__privileged_functions_start__, __privileged_functions_end__]. (Also executable, see XN bit in MPU_RASR register.)

So if to setup a new project with STM32H743 evaluation board, may need to get a reasonable memory partition as well. Hope this clarifies a little bit.

Regards,
Yuhui

from freertos-kernel.

rahmanih avatar rahmanih commented on August 28, 2024

Thanks I'm closing this issue now.

regards
Haithem.

from freertos-kernel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.