cancel
Showing results for 
Search instead for 
Did you mean: 

Moving code from G030 to C011

stevecimo
Associate III

Hi All

I have a breakout board, I've been testing some ws2812 code , I'm using  TIM1 with DMA + PWM

I developed the code on the G030, it's a 32 pin package.

I'm using internal clock and have it running at 48MHz for Timers.

Works has intended. 

 

Switch to C011 in an 8 Pin package.

Created new project in MX and just copied over the code I added.

I'm using internal clock and have it running at 48MHz for Timers.

Code does not work.  complies fine, but the leds not work.

 

In both porjects I am using TIM1 , configured the same way.

 

I don't have a Scope where I can view the PWM output

Question:  Does anyone of a any differences between how TIM1 works between both MCU? I looked through  AN5969   Migrating between STM32G0 and STM32C0 MCUs  and nothing jumped out.

Can I use CudeMonitor to review the PWM?

 

Any suggestions would be highly appreciated.

 

Regards, Stephen 

 

 

 

19 REPLIES 19

Just checked my order, parts order where STM32C011J6M6  

 

I might try a different timer.

stevecimo
Associate III

I added a simple led  toggle on a gpio pin and it never toggles

while (1)

{

int z = 9;

while (z >= 0) {

Set_Display(z, "orange");

WS2812_send();

HAL_Delay(1000);

--z;

}

HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);

z=0;

while (z <= 9) {

Set_Di

splay(z, "green");

WS2812_send();

HAL_Delay(1000);

++z;

}

z=9;

/* USER CODE END WHILE */

 

/* USER CODE BEGIN 3 */

}

 

I'll keep looking :)

 

Dear stevecimo,

I guess there is lack of basically thing.
You should not think easily migration from STM32G0.
Build a project as “STM32C0" from scratch.

Also don't forget to read the datasheet/reference-manual/errata-sheet carefully.

Best regards,
Nemui.

What you have shown looks okay.

Can you set that pin statically to 0 and 1 and measure the output level, i.e. a classic blinky? Could it be a soldering issue?

hth

KnarfB

I'll give it a try, I have received some samples MCU, Including G , F, H series in different packages....

including a Nuceo-F103RB

But I did build the project from scratch, started a new project , selected the MCU, configured the timer and clock using cubeMX , then just copied my code across.....

 

This is what ST recommend when moving between MCU?

I just used the same process to move the code to a Nucleo F103RB and is working....

 

I think I'm going to move to 20pin package and have some G and F in 20pins .

 

:)

 

Dear stevecimo,

Here is my simplest STM32C0 project("moving from" G0 project below).
https://nemuisan.blog.bai.ne.jp/?eid=192848#STM32C0

STM32G0 is here.
https://nemuisan.blog.bai.ne.jp/?eid=192848#STM32G0


Those project includes timer setting(for uSec wait timer).
And NO-CUBEIDE/NO-CUBEMX to avoid buggy code generation.

I do not have intend to answer anymore,but may be I told the just answer :)

Best regards,
Nemui.

Thanks, I'll take a look :)

stevecimo
Associate III

I have yet to figure this out, I've received some 20 pin G030 and my code works fine on them, so I'll stick with the G030 for now . :)

I also purchased a F103 Nucleo board and a C011 Discovery board and a Chinese Bluepill (F103 I think it's using a real STm32)  .

My code moves to the F103 fine (both boards) , still does not work on the C011 Discovery.......

When I get an Oscilloscope  , I'll take another look :)

 

Thanks for help :)

 

 

You can miss many thinks, but primary read first carefuly about mcus.

C011

MM1_0-1747478427917.png

G030

MM1_1-1747478459630.png

no PLL vs PLL usw.