Skip to main content
ferrarofcf
Associate III
September 23, 2015
Question

RTC sub second register in STM32L151RBT6

Posted on September 23, 2015 at 16:58

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.

    12 replies

    Tesla DeLorean
    Guru
    September 23, 2015
    Posted on September 23, 2015 at 19:15

    And you're using what debugger? Could it just be showing you a subset?

    What if you park a ''Memory View'' of the RTC registers rather than a ''Peripheral View'', can you see those registers there?

    What exactly are you reading/seeing from the register(s)? And what would that be if it were doing it correctly?

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    ferrarofcf
    Associate III
    September 24, 2015
    Posted on September 24, 2015 at 13:42

    Thanks for your reply… your posts are the most useful of the forum.

    I use IAR 6.5 companion STLINK/V2. 

    If I view the memory at address  0x40002828 it is stopped at value 0x1000. (at address  0x40002800 to count correctly the time) 

    In effect I read always 4096dec=1000hex and don’t countdown of my synchronous prescaler setting in RTC_PRER register at PERIPH_BASE+ 0x2800+offset 0x10 (PERIPH_BASE=0x40000000) 

    my value are:

    SynchPrediv = 0x120; /* (37KHz / 128) - 1 = 0x120*/

    AsynchPrediv = 0x7F;

    I use this routine in stm32lxx_rtc.c to read SSR register.

    uint32_t RTC_GetSubSecond(void)

    {

      uint32_t tmpreg = 0;

      

      /* Get subseconds values from the correspondent registers*/

      tmpreg = (uint32_t)(RTC->SSR);

      

      /* Read DR register to unfroze calendar registers */

      (void) (RTC->DR);

      

      return (tmpreg);

    }

    there will be a bug in the die :(

    Tesla DeLorean
    Guru
    September 24, 2015
    Posted on September 24, 2015 at 14:19

    there will be a bug in the die :(

    Well as I recall there was a significant design revision in the L15x parts several years back, and there are at least 5 die steppings. May be the part you have doesn't actually have the features you expect. So it would help to determine exactly what you have.

    You'd need to provide the full markings on the package, and talk to an FAE or ST representative. You could post here, but there's no guarantee of a response, as it's primarily a user forum.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    waclawek.jan
    Super User
    September 24, 2015
    Posted on September 24, 2015 at 14:28

    [double post, courtesy of the crappy forum software]

    waclawek.jan
    Super User
    September 24, 2015
    Posted on September 24, 2015 at 14:29

    Have you tried to set BYPSHAD? Post the RTC registers content.

    Changes in silicon in production versions are documented through errata. I don't see any RTC-related erratum for 'L15x.

    JW
    Tesla DeLorean
    Guru
    September 24, 2015
    Posted on September 24, 2015 at 15:01

    /**
    * @brief Gets the RTC current Calendar Subseconds value.
    * @note This function freeze the Time and Date registers after reading the
    * SSR register.
    * @param None
    * @retval RTC current Calendar Subseconds value.
    */
    uint32_t RTC_GetSubSecond(void)
    {
    uint32_t tmpreg = 0;
    /* Get subseconds values from the correspondent registers*/
    tmpreg = (uint32_t)(RTC->SSR);
    /* Read DR register to unfroze calendar registers */
    (void) (RTC->DR);
    return (tmpreg);
    }

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    ferrarofcf
    Associate III
    September 24, 2015
    Posted on September 24, 2015 at 15:43

    OK thank you very much.

    Another strange thing: the bits in BYPSHAD RTC_CR not seen on the window of the RTC registers.

    My project before was all components ST: MCU, Sensor, logic port, Power Supply, bluetooth BlueNRG...

    but ST has not interesting to support you, and tells...write on forum, Why? ....you can not expect users to do the work for the ST.

    So, I rework my pcb and left only the ST MCU, LSM303D and L3G. About sensors I have asked help on the forum without success :(

    Now also MCU problem :(( 

    Already I was very worried because in ''CD00278726 Errata sheet'' read:

    2.1.2 Bootloader unavailability

     

    Description

     

    The boot loader can not be used the two issue described in Section 2.1.3: Undefined instruction exception During IAP.

     

    Workaround

     

    No workaround is available

     

    Although actually trying it works (inside proprietary bootloader code at address 0x1FF00000), but I can trust ??? (I took your advice of the magic word in RAM after the reset)

    Sorry for the outburst, one my marking code is:

    ARM v

     

    STM32L151

     

    RBT6

     

    GH23B  VG

     

    CHN GH 419

     

    ST

     

    waclawek.jan
    Super User
    September 24, 2015
    Posted on September 24, 2015 at 18:56

    > Another strange thing: the bits in BYPSHAD RTC_CR not seen on the window of the RTC registers.

    Bit

    s

    ? It's just one bit, namely bit 5 of RTC_CR. If you can't see/change it in the debugger, there is some problem with the debugging software or its settings.

    > But ST has not interesting to support you, and tells...write on forum, Why?

    Because support is very expensive.

    JW

     

    Tesla DeLorean
    Guru
    September 24, 2015
    Posted on September 24, 2015 at 21:59

    >> But ST has not interesting to support you, and tells...write on forum, Why?

    >Because support is very expensive.

    Indeed, I don't think the engineers deploy at less than $1M/annum in sales. You have to work up your distribution chain first, and their support infrastructure. Places like DigiKey are taking a 50% margin from the ''customer'' to provide some level of front line service.

    The forum is Emergency Room Triage, stopping you from bleeding to death in the 5-30 minute time frame, as your fellow engineers apply pressure to the wound, it's not there to manage project staffing issues.

    I'm not using L1 parts enough to know if this feature is on all die or not.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    ferrarofcf
    Associate III
    September 24, 2015
    Posted on September 24, 2015 at 22:34

    @waclawek bit sorry no bits, see the attached image.

    support ...

    it's just a political choice, other brands are close to small and great.

    I buy only Hundreds pieces and therefore are anyone.

    You want use a forum e2e, but do not is very expensive to have skilled moderators to following some problems and to interface the customer with the company.

    ________________

    Attachments :

    memory.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I10F&d=%2Fa%2F0X0000000bgx%2FQpXgQ_HP6csIXaetvzHMmaK7._ao1ZqppcylRECDZJM&asPdf=false

    rtc_register.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0zR&d=%2Fa%2F0X0000000bgy%2F3HzLCeM6OXjUE7e_mRc9mdIeM4NtKJRPhN5smfB5RCY&asPdf=false