The objective if the lab will be to redirect printf to USART2 which is connected to ST-LINK Virtual COM port on your Nucelo board.
We will then use the terminal in the STM32CubeIDE to view the printf output.
*Code to be added:*
in main.c:
/* USER CODE BEGIN PFP */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
/* USER CODE END PFP */
////////////////////////////
while (1)
{
printf("** Hello World ** \n\r");
HAL_Delay(1000);
/* USER CODE END WHILE */
/////////////////////////////
/* USER CODE BEGIN 4 */
PUTCHAR_PROTOTYPE
{
HAL_UART_Transmit(&huart2, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
/* USER CODE END 4 */
_____
The STM32C0 series is our new general purpose 32-bit microcontrollers offering simplicity and affordability.
Designers will especially appreciate its pin-to-pin compatibility with the STM32 family and its comprehensive development ecosystem.
*Who should attend this course?*
- Engineers looking for a general purpose microcontroller for their embedded applications
- Engineers who wish to better understand the STM32C0's innovative architecture and embedded smart peripherals
- Engineers looking to design applications using a user-friendly development ecosystem
*Prerequisites:*
- NUCLEO-C031C6 board
- type A to type B micro USB cable
- Laptop PC running Windows® 7, 8, 10 or 11 with administrator rights and with preinstalled software from below link:
*Complete list of prerequisites is available within the below link:*
[ Ссылка ]
*Materials:*
Workshop presentations in pdf format are available here:
[ Ссылка ]
In case of any questions, suggestions, feel free to contact us at our forum at:
[ Ссылка ]
Please share with us your feedback on this MOOC using anonymous survey at:
[ Ссылка ]
Ещё видео!