Registers aren't changing when written
Dear community,
I am programming an ST32F407VE for the first time (I don't use the Cube32IDE though). First, I made an on board LED blink, so I am pretty certain that my toolchain and framework work properly. In the next step, I wanted to implement a low-power IrDA interface.
However, if I try to write to the registers of USART6 (see code below), according to my debugging tool, these registers don't change at all. They simply keep their reset state. Other registers like the Rx and GPIO registers do change according to my code.
#include "irda.h"
#include "Arduino.h"
#include "stm32f4xx.h"
static char irda_initialized = 0;
void initIrDA(void)
{
if (!irda_initialized)
{
USART6->GTPR |= (1<<USART_GTPR_PSC_Pos);
USART6->CR1 |= (1<<USART_CR1_UE_Pos);
/*
USART6->CR1 |= (1<<USART_CR1_UE_Pos) // Enable USART
| (1<<USART_CR1_PEIE_Pos) // Enable Interrupts for parity errors
| (1<<USART_CR1_IDLEIE_Pos) // Enable Interrupt when idle line is detected
| (1<<USART_CR1_TE_Pos) // Enable Transmitter
| (1<<USART_CR1_RE_Pos); // Enable Receiver
/* nothing to be configured in CR2 register */
// USART->CR2 = ;
USART6->CR3 |= (1<<USART_CR3_IREN_Pos) // IrDA mode enabled
| (1<<USART_CR3_IRLP_Pos); // select IrDA low power mode
irda_initialized = 1;
}
}Any help would be appreciated, I am really in desperation.
Sincerely,
