cancel
Showing results for 
Search instead for 
Did you mean: 

DRP1M1_DRP example on G0B1RE

NMartin
Associate III

Hello,

I am trying to evaluate the DRP USB C solution ST has to offer.

I have available to me a NUCLEO-G0B1RE and an X-NUCLEO-DRP1M1.

I understand that the code written in the DRP1M1_DRP example was written for the NUCLEO-G071RB, but I cannot find any reason this code wouldn't run on the NUCLEO-G0B1RE. Pinouts seem fine, Capabilities seem fine, and the readme.md file in this example says it should work on STM32G0XX devices.

However, when I debug this code on the board it enters a hard fault loop while trying to run MX_USBPD_Init(). Digging further down, it seems as though it fails to validate that the GUI area hasnt been corrupted. Specifically, at line 80 in "bsp_gui.c":

if ((0xFFFFFFFFu != *((uint32_t *)_addr)) && (MagicNumber != *((uint64_t *)_addr)))

The call stack looks like this:

NMartin_0-1697664479076.png


Are there things I need to adjust to get this code working on the NUCLEO-G0B1RE rather than the NUCLEO-G071RB?

Thanks,

Nate

1 ACCEPTED SOLUTION

Accepted Solutions

Currently STM32CubeIDE doesn't support the feature to switch project from one MCU to another.

You can generate your project with STM32CubeMX as a stand alone tool and select STM32CubeIDE as target IDE.

For more details, please have a look at this article: MCU1 to MCU2 migration option within STM32CubeIDE.

Please note that we also have a wiki on how to build a DRP here. You could also follow it for a G0B1 target.

Best regards

View solution in original post

4 REPLIES 4
HFISTM
ST Employee

Hello,

You are right, G0B1 + DRP1M1 is possible, but you cannot use the G071 project "as is" or you will encounter this behavior.

In fact flash size are not the same between G0B1 and G071 and I suspect you did not modified the project accordingly, which leads to the hardfault because you are compiling G071 system files for a G0B1:

  • Use startup_stm32g0b1xx.s instead of the one for G071 in your project files
  • Change the device to a G0B1 in your project configuration
  • Change the CMSIS define to STM32G0B1xx in your precompiler options

Best regards

NMartin
Associate III

Thank you for the response,

It seems that the device setting in the project configuration is greyed out and cannot be changed:

NMartin_1-1697742934065.png

Is there a different place I should be looking to change the device?

Nate

 

Currently STM32CubeIDE doesn't support the feature to switch project from one MCU to another.

You can generate your project with STM32CubeMX as a stand alone tool and select STM32CubeIDE as target IDE.

For more details, please have a look at this article: MCU1 to MCU2 migration option within STM32CubeIDE.

Please note that we also have a wiki on how to build a DRP here. You could also follow it for a G0B1 target.

Best regards

NMartin
Associate III

Thank you, that guide is exactly what I needed.

Nate