Skip to main content
OAgui.1
Associate II
October 14, 2022
Question

MPU G0+

  • October 14, 2022
  • 4 replies
  • 2125 views

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:

https://www.st.com/resource/en/reference_manual/rm0444-stm32g0x1-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

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.

https://www.st.com/content/ccc/resource/technical/document/application_note/group0/bc/2d/f7/bd/fb/3f/48/47/DM00272912/files/DM00272912.pdf/jcr:content/translations/en.DM00272912.pdf

Thanks for your help!

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
October 14, 2022
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
OAgui.1
OAgui.1Author
Associate II
October 14, 2022

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!

Tesla DeLorean
Guru
October 15, 2022

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

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Semer CHERNI
ST Employee
October 21, 2022

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.
AScha.3
Super User
October 21, 2022
  • if not in Cube - not in chip. (most likely)

seems the "protection unit" is here, but a very simple level:

0693W00000UoY7LQAV.png0693W00000UoY7aQAF.pngso there is no special "MPU-unit" to activate in Cube, just some registers for flash protection:

0693W00000UoY89QAF.png 

"If you feel a post has answered your question, please click ""Accept as Solution""."
Tesla DeLorean
Guru
October 21, 2022

The product page seems pretty explicit.. Both in the text, and the infographic.

https://www.st.com/en/microcontrollers-microprocessors/stm32g031k8.html

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
OAgui.1
OAgui.1Author
Associate II
October 25, 2022

Thank you all, for your help!