cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 discovery RTC problem

matas
Associate II
Posted on July 07, 2015 at 10:32

The original post was too long to process during our migration. Please click on the attachment to read the original post.
2 REPLIES 2
matas
Associate II
Posted on July 07, 2015 at 12:08

Found out the problem myself 🙂 The thing that stopped everything was this part:

 if (RCC->BDCR & 0x1)

        printf(''LSE On\n'');

      else

        printf(''LSE Off\n'');

 

  if (RCC->BDCR & 0x2)

        printf(''LSE Ready\n'');

    else

        printf(''LSE Not Ready\n'');

 

  if (RCC->BDCR & 0x4)

        printf(''LSE ByPass On\n'');

    else

        printf(''LSE ByPass Off\n'');

 

  if (RCC->BDCR & 0x8000)

        printf(''RTC Clock Enabled\n'');

    else

        printf(''RTC Clock Disabled\n'');

         

  switch(RCC->BDCR & 0x300)

    {

        case 0x100 : puts(''RTC Clock Source LSE''); break;

        case 0x200 : puts(''RTC Clock Source LSI''); break;

        case 0x300 : printf(''RTC Clock Source HSE/%d'', (RCC->CFGR >> 16) & 0x1F); break;

        default : puts(''RTC Clock Unknown'');

    }

it didn't know where to printout this stuff 🙂
Posted on July 07, 2015 at 14:22

You'd need some semi-hosting code to push the output to a USART

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..