Skip to main content
matas
Associate III
July 7, 2015
Question

STM32F4 discovery RTC problem

  • July 7, 2015
  • 2 replies
  • 683 views
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.
    This topic has been closed for replies.

    2 replies

    matas
    matasAuthor
    Associate III
    July 7, 2015
    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 :)
    Foo Bar
    Tesla DeLorean
    Guru
    July 7, 2015
    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 VenmoUp vote any posts that you find helpful, it shows what's working..