STM32C011 (WeAct) - first step

Post here first, or if you can't find a relevant section!
Post Reply
STM32ardui
Posts: 3
Joined: Mon May 06, 2024 1:46 pm

STM32C011 (WeAct) - first step

Post by STM32ardui »

Today my STM32C011F6P6-boards from WeAct Studio arrived.

As you can see from this picture they don't USB connector, but the 4 pins GND, CLK, DIO, 3V3 for a ST-Link. At the moment I don't have one at home. So can I upload a program also with a USB to UART-adapter like I made it with a BlackPill-board?

So I look around the documentation ...

STM32C0x1 Reference Manual, chapter 2.5 Boot configuration, page 46:

Code: Select all

Embedded boot loader
The embedded boot loader is located in the System memory, programmed by ST during
production. It is used to reprogram the Flash memory using one of the following serial
interfaces:
• USART1
• I2C1
For further details, refer to the device data sheets and the application note AN2606.

AN2606, chapter 5.1 Bootloader configuration (page 49):

Code: Select all

USART1 Enabled Once initialized, the USART1 configuration is 8 bits, even parity, and one stop bit.
USART1_RX pin Input PA10 pin: USART1 in reception mode. Used in input pull-up mode.
USART1_TX pin Output PA9 pin: USART1 in transmission mode. Used in alternate push-pull, pull-up mod

STM32C011x4/x6 datasheet, chapter 4 Pinouts, pin description:
page 27 Fig. 5 shows pinout in TSSOP20 package:
- 17 PA12[PA10]
- 16 PA11[PA9]

Also table 12 on page 29 contains in column "function upon reset" for TSSOP20:
- 16 PA11 [PA9]
- 17 PA12[PA10]

I don't know the meaning of such double numbering, but I think, these pins are the serial interface?

Bye, Jürgen

Windows 10
ArduinoIDE 2.3.2 (as portable version)
with Platform STMicroelectronics:stm32@2.7.1
STM32ardui
Posts: 3
Joined: Mon May 06, 2024 1:46 pm

Re: STM32C011 (WeAct) - first step

Post by STM32ardui »

WeAct Studio placed a demo on the STM32C011-board. The LED at PA4 flashes and with a connection from UART1 (PA11/PA12) via adapter to PC, I can see a kind of timestamps in a terminal program (115200 baud):

Code: Select all

2023.01.01 00:01 24
2023.01.01 00:01 25
2023.01.01 00:01 26
2023.01.01 00:01 27
...
But it seems to be impossible to use UART1 for programming.

For a STM32F411CEU6 the AN2606 says pattern 1: Boot0(pin) = 1 and Boot1(pin) = 0
So that's what you're doing by holding BOOT0 down, press NRST and release them again?

STM32C011 has   pattern 11:
nBoot0(bit) = 0, nBoot1(bit) = 1, nBOOT0_SEL(bit) = 1 and BOOT_LOCK(bit) = 0
Boot0(pin) = 1, nBoot1(bit) = 1, BOOT_LOCK(bit) = 0 and nBOOT0_SEL (bit) = 0
nBoot0(bit) = 1, nBOOT0_SEL(bit) = 1, BOOT_LOCK(bit) = 0 and main flash memory empty
Boot0(pin) = 0, nBOOT0_SEL(bit) = 0, BOOT_LOCK(bit) = 0 and main flash memory empty

I read something about "option byte", but don't know exactly the meaning.
Also I don't know, if the behavior comes from the demo and a fresh chip can be programmed via UART1.

I found an old Waveshare ST-Link V2 Mini. After a firmware upgrade STM32CubeProgrammer gets a connect. In the log I see:

Code: Select all

  17:25:22 : Voltage     : 3.25V
  17:25:22 : SWD freq    : 4000 KHz
  17:25:22 : Connect mode: Normal
  17:25:22 : Reset mode  : Software reset
  17:25:22 : Device ID   : 0x443
  17:25:22 : Revision ID : Rev A
  17:25:22 : Debug in Low Power mode is not supported for this device.
  17:25:22 : UPLOADING OPTION BYTES DATA ...
  17:25:22 :   Bank          : 0x00
  17:25:22 :   Address       : 0x40022020
  17:25:22 :   Size          : 100 Bytes
  17:25:22 : UPLOADING ...
  17:25:22 :   Size          : 1024 Bytes
  17:25:22 :   Address       : 0x8000000
  17:25:22 : Read progress:
  17:25:22 : Data read successfully
So STM32CubeProgrammer resets those "option byte(s)"?

Bye, Jürgen
Post Reply

Return to “General discussion”