2022-10-14 02:29 PM
Hi community.
I am planning to use memory protection unit (MPU) in my project. My MCU is STM32G031K8 but I cannot find how to activate this function with CubeMX. I would want to do the same as this example;
https://community.st.com/s/article/how-to-configure-the-mpu-of-an-stm32-using-stm32cubemx
In addition in the reference manual there is no much information about this function or the registers involved:
or in the datasheet
https://www.st.com/resource/en/datasheet/stm32g031k8.pdf
An I wrong? or maybe this function is not available for this MCU. According to this is link I can use this function but I am not sure.
Thanks for your help!
2022-10-14 02:35 PM
Perhaps the Programming Manual?
2022-10-14 02:46 PM
Oh! That's great! Thank you so much. I am new working with STM32.
Last question, is it available to set with .ioc? Because I am unable to see It!
2022-10-14 07:07 PM
I don't use CubeMX/IDE
I believe the part has an MPU
STM32Cube_FW_G0_V1.3.0\Projects\NUCLEO-G031K8\Examples\Cortex\CORTEXM_MPU\CORTEXM_MPU.ioc
STM32Cube_FW_G0_V1.3.0\Projects\NUCLEO-G031K8\Examples\Cortex\CORTEXM_MPU\Src\main.c
STM32Cube_FW_G0_V1.3.0\Projects\NUCLEO-G031K8\Examples\Cortex\CORTEXM_MPU\Src\stm32_mpu.c
2022-10-21 08:53 AM
Hello @OAgui.1
First let me thank you for posting.
From CubeMx side the MPU configuration is not supported by the tool for the STM32G0x1 MCUs.
But as @Community member has mentioned you can inspire from the examples and build your project using the drivers from the FW package.
May be in the future this functionality could be add to CubeMx for this line of MCUs.
Kind regards,
Semer.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-10-21 09:55 AM
seems the "protection unit" is here, but a very simple level:
so there is no special "MPU-unit" to activate in Cube, just some registers for flash protection:
2022-10-21 09:59 AM
The product page seems pretty explicit.. Both in the text, and the infographic.
https://www.st.com/en/microcontrollers-microprocessors/stm32g031k8.html
2022-10-25 12:22 AM
Thank you all, for your help!