TI Team,
Can you confirm whether or not the LM3S3B93 has a faulty Hibernation module? The errata indicates that writing to certain hibernation registers will fail due to a system clocking issue. (see link below) It also states the the silicon version that is affected is "C5." Below are the part markings on the devices I use. Can you confirm that this issue would indeed appear on my device.
I'm simply attempting to use the RTC, but I cannot write the RTCEN bit of the HIBCTL register.
Errata Link
http://www.ti.com/lit/er/spmz638a/spmz638a.pdf
Part Markings
LM3S2B93IQC80C5SD$A-18P001H
If the hibernation module is faulty, that okay as long as I can use the RTC. In this event, how do I enable the RTC? I don't care if I go into hibernation. Also, what other information do you need to determine what the problem is. I'd like to run my RTC code on the evaluation board, but I don't have one. I can send this to you if you need it.
-David
Hello David,
The LM3S2B93 IQC80C5SD will have the "Write to certain hibernation modules register sometimes fail" errata. Have you tried the workaround provided in the Errata ?
The data sheet provides the steps required to initialize the hibernate RTC (no hibernation) in page 303.
RTC Match Functionality LM3S2B93 Data Sheet: http://www.ti.com/lit/gpn/lm3s2b93#page=303
Also, the LM3S2B93 timers (A/B) can be used in RTC mode. For more information how to enable this feature see the Data Sheet in page 559.
David Escandon Also, what other information do you need to determine what the problem is. I'd like to run my RTC code on the evaluation board, but I don't have one.
Also, what other information do you need to determine what the problem is. I'd like to run my RTC code on the evaluation board, but I don't have one.
What problem are your referring to in your comment above?
The LM3S9B92 Evaluation Kit can be used to test the RTC features.
LM3S9B92 Evaluation Kit: http://www.ti.com/tool/ek-lm3s9b92
Let me know if you have additional questions.
- Erick
---------------------------------------------------------------------------------------------------------Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------------------------------
The LM3S9B92 Evaluation Kit I suggested above does not have the hibernation module, instead you would have to use the LM3S9B90 Evaluation Kit.
LM3S9B90 Evaluation Kit: http://www.ti.com/tool/ek-lm3s9b90
I'm sorry for the confusion.
Let me know if you have any questions.
Regards
Erick,
Over the last month, 'we've conducted several tests on our production boards to test the functionality of the hibernation module. We need not only need the RTC to work--this requires the hibernation module to function--but we also need to device to enter hibernation to meet our final application requirements. Again, let me stress that the operation of the hibernation module is an absolute necessity.
We are using the LM3SB93 device, but have experienced a 20% failure rate with the parts we ordered from an authorized distributor. The failure, as explained in the previous thread, is seen across all the devices with C5 silicon (see attached table) with the exception of 1. To understand the nature of the failure, we tried a few different options listed below:
With the failures spread across 3 different compatible parts, as well as the three separate evaluation modules of the same family, we are concerned that this issue is something new and has not been addressed on the latest errata. We are now working with the local TI sales group to have the original LM3SB93 undergo a failure analysis. Even so, we our deadline looming here in the next wee, we need the factory to provide guidance on how we should proceed with dealing with the problem. I'm also attaching a copy of the "golden file" that we have used for our testing.
Again, I can't stress enough the importance of getting answers from the factory about the nature of this failure. A workaround to this problem is imperative. We are open to any suggestions you may have. Thanks for your help.
Golden File
#include "inc/zero_types.h"#include "inc/hw_types.h"#include "inc/hw_hibernate.h"#include "driverlib/sysctl.h"#include "driverlib/systick.h"#include "driverlib/hibernate.h"#include "driverlib/interrupt.h"
static u32 hibernate_request_seconds = 0;
static void ZeroMcuHibernateIntHandler( void ){ u32 status;
// Clear the interrupt status = HibernateIntStatus( 0 ); HibernateIntClear( status );
// If the hibernate request variable has been set to a value other // than zero, it means a hibernation was requested. Here in the ISR, // since the RTC had to have just incremented to get us here, we are // safe to adjust the hibernation match register, so we do that. // Then we set the hibernate request variable back to 0 to signal to the function // which set it, that we're now ready to enter hibernation. if( hibernate_request_seconds != 0 ) { HibernateRTCMatch0Set( HibernateRTCGet() + hibernate_request_seconds ); hibernate_request_seconds = 0; } // Otherwise, set us up for another interrupt in 1 second. else { HibernateRTCMatch0Set( HibernateRTCGet() + 1 ); }}
int main( void ){ u32 status;
///////////////// Configure System Clock //////////////////
SysCtlClockSet( SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ );
///////////////////// Configure RTC ///////////////////////
SysCtlPeripheralEnable( SYSCTL_PERIPH_HIBERNATE ); // Ensure 5 clock cycles pass after enabling peripherals SysCtlDelay( 2 ); HibernateEnableExpClk(SysCtlClockGet()); SysCtlDelay( SysCtlClockGet() / (50/3) ); // wait 20ms HibernateClockSelect( HIBERNATE_CLOCK_SEL_DIV128 ); SysCtlDelay( SysCtlClockGet() / (50/3) ); // wait 20ms
HibernateRTCEnable();
HibernateRTCSet( 0 );
/////////////////////// Test RTC /////////////////////////
while( 1 ) { if( HibernateRTCGet() != 0 ) { break; } SysCtlDelay( SysCtlClockGet() / 300 ); // wait 10ms }
/////////////////////// Configure Hibernate /////////////////////////
// According to the stellaris errata, we need to ensure that we never write to // hibernation module registers HIBRTCC, HIBRTCM0, HIBRTCM1, HIBRTCLD, HIBRTCT, or HIBDATA // at the time that the RTC counter increments. Since this is an initialization routine, // we dont mind disabling the RTC for moment to perform the configuration. HibernateRTCDisable(); // Register the interrupt handler function HibernateIntRegister( ZeroMcuHibernateIntHandler );
// Set to interrupt once per second. Due to the errata mentioned above, // this will allow us to do any configuration of the hibernate module inside // the ISR which, since the ISR only executes immediatly after an RTC counter increment, // virtually guarantees the RTC will not be incrementing. HibernateRTCMatch0Set( HibernateRTCGet() + 1 );
IntMasterEnable(); HibernateIntEnable( HIBERNATE_INT_RTC_MATCH_0 ); // Re-enable RTC after configuration is done. HibernateRTCEnable();
///////////////////////// Test Hibernate ///////////////////////////
hibernate_request_seconds = 10; // Wait for ISR to set the wake up value for us. while( hibernate_request_seconds != 0 ); // Set up the wake condition. HibernateWakeSet( HIBERNATE_WAKE_RTC ); //Hibernate! HibernateRequest(); while( 1 );
return( 0 );
Thank you for the detailed write up. I can't see anything particulary wrong with the initialization of the hibernation module.
What board are you currently using to test the different chips, to replicate your setup on my end? If the board is a custom PCB can you provide the schematics?
Did you purchase the ek-lm3s9b90 I recommended before to test the hibernation? If yes, have you tested the golden code in this kit?
Regards,
Erick
I used three different LM3SB90 evaluation boards to verify the "golden" file. The part marking on all three boards is: LM3S9B90IQC80B1DA0948BP078
Again, the resultst were mixed with only one of three boards working.
I will send you the schematics later today. Thanks for your help.
Please provide your email address. I don't want to post the schematic file on this public forum. Thanks.
Erik,
Per our conversation this morning, I'm sending you a link to the RTC oscillator that has worked using all three version of the Stellaris device in question. Let me elaborate more on our testing with the RTC oscillator:
In an effort to get the hibernation circuit to work using an external crystal, we tried two smaller values for C1 and C2, 12pF and 8pF, on two different boards that were both failing previously (a B93 and a U93).. Neither value seemed to help the oscillator start on those boards, which again is not consistent with what is published on the errata as a viable workaround.
At this point, we tried wiring up a 32.768KHz oscillator to the B93, and that worked. We changed the initialization API for the clock source, but the RTC and hibernation modules worked on 5 different boards (two boards had a B93; 2 had U93, and 1 had a D93).
Thus, we have what we think is a working solution using an external oscillator, but we still need confirmation from the factory as to why the external circuit will not work all of the time. We'd prefer using the crystal because it is lower cost, so we'd still like to know definitively why the problem exists int he first place.
On that note, the part number of the 32.768KHz is ECS-327SMO-TR. http://www.ecsxtal.com/store/pdf/ecs-327smo.pdf
The golden file with the change is posted below:
#include "zero_types.h"#include "inc/hw_types.h"#include "inc/hw_hibernate.h"#include "driverlib/sysctl.h"#include "driverlib/systick.h"#include "driverlib/hibernate.h"#include "driverlib/interrupt.h"
SysCtlPeripheralEnable( SYSCTL_PERIPH_HIBERNATE ); // Ensure 5 clock cycles pass after enabling peripherals SysCtlDelay( 2 ); HibernateEnableExpClk(SysCtlClockGet()); SysCtlDelay( SysCtlClockGet() / (50/3) ); // wait 20ms //HibernateClockSelect( HIBERNATE_CLOCK_SEL_DIV128 ); HibernateClockSelect( HIBERNATE_CLOCK_SEL_RAW ); SysCtlDelay( SysCtlClockGet() / (50/3) ); // wait 20ms
hibernate_request_seconds = 10; // Wait for ISR to set the wake up value for us. while( hibernate_request_seconds != 0 ); // Set up the wake condition. HibernateWakeSet( HIBERNATE_WAKE_RTC | HIBERNATE_WAKE_PIN ); //Hibernate! HibernateRequest(); while( 1 );
return( 0 );}