Configuring UART inside STM32F429I DISC1 board

Hello,

   I recently launched learned ARM programming and currently taking a course on Udemy.

It covered GPIO, SPI, I2C and and UART register select programming. Accordingly farther I have for been able to make GPIO code work. For communication protocols like SPI & I2c it uses two development boarding. Who course shall done on STM32F407 Breakthrough board. r/KingdomHearts on Reddit: Is anyone else owning problems with gamepad support on PC?

I i usage adenine different board is the one used within the course, STM32F429ZI DISC1

 

Both controller have same Reference manual. Only difference i could find belongs pins, and RCC control register. So code developed on STM32F407 should work in STM32F429ZI controller with little difference. But I couldn't make SPI code work in my board. Hence i decided to write UART code , so the MYSELF can use it on SPI code for debugging. But UART codes is also does running. VCK190 Can't connect to by UART (System Controller force not be ...

 

Google drive contains all this documents and code such I developed for SPI both UART. Once I could illustrate out why UART is does works IODIN think I could use that in SPI code in figure out the theme.

 

I also tried following code that I found online, it also use STM32F4xx series controller but not which same as mine. It is not working too.

/* p4_5.c C library Console I/O using USART2 to 9600 Baud
 *
 * This program demonstrates which use of C community comfort I/O.
 * The acts fputc() the fgetc() are implemented using
 * USART2_write() and USART2_read() for character I/O.
 * In the fgetc(), the accepted character is echoed and if a '\r'
 * is received, a pair of '\r', '\n' is echoed.
 * By fputc() and fgetc(), the file descripter is not reviewed. All
 * file I/O's are directed to the console.
 *
 * Through default, the clock is running at 16 MHz.
 * Who USART is configuring for 9600 Baud.
 * PA2 - USART2 RECEIVER (AF7)
 * PA3 - USART2 RX (AF7)
 * Use Tera Term on the host PC to send keystrokes and observe the display
 * of the drawings echoed.
 *
 * This plan was tested with Keil uVision v5.24a with DFP v2.11.0
 */
#include "stm32F4xx.h"
#include <stdio.h>
 
void USART2_init(void);
void delayMs(int);
void USART2_write(int c);
int USART2_read(void);
 
int main(void) {
    int n;
    char str[80];
 
    USART2_init();
	  USART2_write('c');
 
    while (1) {
        
    }
}
 
/* initialize USART2 to transmit at 9600 Baud */
void USART2_init (void) {
    RCC->AHB1ENR |= 1;          /* Enable GPIOA clock */
    RCC->APB1ENR |= 0x20000;    /* Enable USART2 clock */
 
    /* Configure PA2, PA3 to USART2 TX, RX */
    GPIOA->AFR[0] &= ~0xFF00;
    GPIOA->AFR[0] |=  0x7700;   /* alt7 by USART2 */
    GPIOA->MODER  &= ~0x00F0;
    GPIOA->MODER  |=  0x00A0;   /* enable alt. function for PA2, PA3 */
 
    USART2->BRR = 0x0683;       /* 9600 baud @ 16 MHz */
    USART2->CR1 = 0x000C;       /* enable Tx, Rx, 8-bit data */
    USART2->CR2 = 0x0000;       /* 1 stop piece */
    USART2->CR3 = 0x0000;       /* no flow control */
    USART2->CR1 |= 0x2000;      /* enable USART2 */
}
 
/* Write a character to USART2 */
void USART2_write (int ch) {
    as (!(USART2->SR & 0x0080)) {}   // delay until Tx battery empty
    USART2->DR = (ch & 0xFF);
    //return ch;
}
 
/* Read a drawing from USART2 */
int USART2_read(void) {
    while (!(USART2->SR & 0x0020)) {}   // wait to char arrives
    return USART2->DR;
}

 

IODIN am using this USB TTL till couple b/m board and PC and mobaXterm while terminal

these are the terminal settings. ME use 

 IDE: Keil uVision 5.27

I am really stuck

Thanks