Skip to main content
Visitor II
January 21, 2022
Question

Program STM32G030 by UART

  • January 21, 2022
  • 2 replies
  • 3372 views

I'm trying to program STM32G030 but I don't have a ST-LINK.

I wonder is it possiable to program this chip through UART interface? 

There is a LED-BLINKING program programed by distributer in main flash memory. I have tried to pull BOOT0 to VCC and reset the chip. But the LED on the board is still blinking. I got confused why this chip doesn't go to bootloader but still excute program in main flash memory instead.

If you got any idea about this question, please let me know. Thank you !

    This topic has been closed for replies.

    2 replies

    Graduate II
    January 21, 2022

    Boot0 and Reset may be remapped and set by option bits. Only possible way to attach to such a device in my understanding is:

    • Pull and keep reset low
    • Power up device
    • Connect via SWD under reset

    Get a working G0 nucleo or disco board to try out the procedures and your understanding. Then review the board you have and what is happening with the board.

    Laurie1Author
    Visitor II
    January 21, 2022

    Thank you for the information. I think I have to purches a ST-LINK as soon as possiable:ok_hand:

    Graduate II
    January 21, 2022

    Better buy a G0 Nucleo. You can practice your code on that board and you can use jumper wires to program your boardlater . An STLink is integrated on the Nucleo board.

    A standalone STLink has no reset buttom. To practice thye procedure above, you need to keep the reset buttom pressed by hand, as STLink can not do that programmatical.

    Graduate II
    January 22, 2022

    AN2606 start pattern 11

    Boot0(pin) = 0, nBOOT0_SEL(bit) = 0, BOOT_LOCK(bit) = 0 and main Flash memory empty

    when this is default config your MCU start system memory bootloader and you can load first code UART... , but for next starting you need method in your code to jump to system bootloader... read AN

    And what is your board have blinky and dont have onboard USB stlink?

    Laurie1Author
    Visitor II
    January 22, 2022

    If I set nBOOT0_SEL bit to 1, nBOOT0 bit to 1 (boot from main flash memory and BOOT0 pin are not connect to boot mode), and remap SWDIO, SWCLK to reset state (SWD are disabled). I wonder is it possiable to program this chip again?

    Thank you.0693W00000JMw9BQAT.png

    Graduate II
    January 22, 2022

    Yes seems your blinky board have WTF setup from line 4.

    Then you only can use SWD to get it back or replace chip on board with empty one.

    SWD under reset is always work onle RDP level 2 i mean bloack it.