How to map port lines on 8 pin STM32C011

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
pwdandekar
Posts: 1
Joined: Fri Feb 09, 2024 12:48 pm

How to map port lines on 8 pin STM32C011

Post by pwdandekar »

Hello all,

I am a regular developer on Arduino using Atmel and ESP32 MCUs. I have also programmed several ST ARM MCUs (Nucleo eval boards) using mbed compilers. Recently, I decided to use very low end ST ARM MCUs such as STM32C0xxx and STM32G0xxx with low cost STLink programmer as flash burner.

I have an application needing 1 analog input, 2 digital outputs and serial port USART output to console and I decided to start with STM32C011JxM SO8N pinout. Each pin in this MCU can have many port pins and each port pins can be assigned many functions.

I am aware that if I use ST's CubeIDE, I can assign port pins to each of the 8 pins but I wish to use Arduino IDE only.

I made following connections for power and programming:
Pin No 2 - VDD 3.3V
Pin No 3 - VSS Ground
Pin No 7 - SWDIO connected to ST Link hardware programmer
Pin No 8 - SWCLK connected to ST Link hardware programmer

Pin No 1 - PB7 to drive LED
Pin No 5 - PA8 as Tx for Soft Serial @max38400 baud
Pin No 6 - PA10 as Rx for Soft Serial

I am able to send data to PC using softSerial, using a separate TTL-USB serial converter board.

I am facing following issues, so I request all of you to help me:

1. On power-on-reset, how to assign one port pin to a particular hardware pin, so that it can then be initialized for a particular function such as I/O or USART?
Using the hardware manual, I can glean from that which hardware pin can take which function. I can also get that info from pin Configuration in Cube IDE.
2. I looked up the manual and using power -on- reset port pin allocated there, I tried to use simple code for digital output or serial output or analog input but I failed.
3. Only thing that works is blink on pin 1,4 and 6 and software serial output on pin 5. These operations could not be rep;icated on other port pins.
4. Analog input is not working.

Thanks in advance.
Post Reply

Return to “General discussion”