[ARM] A question about sprintf and displaying to LCD on STM32 ?

Status
Not open for further replies.

bianchi77

Advanced Member level 4
Joined
Jun 11, 2009
Messages
1,313
Helped
21
Reputation
44
Reaction score
20
Trophy points
1,318
Location
California
Visit site
Activity points
9,442
can not display sprintf to LCD ?
Guys,

Why suddenly sprintf doesn't work ?
It was working yesterday, I shut down the power supply now, it's not giving me a good response

code :

Code:
uint32_t /*Tmp,*/THH,TMM,TSS,WEEKDAY,DATE,MONTH,YEAR;
 unsigned char date[10],day[10],month[10],year[10],hour[10],min[10],sec[10];

  struct tm *utcTimeSnapshot;
 Tmp = RTC_GetCounter();

TSS = utcTimeSnapshot->tm_sec;
sprintf(sec,"%02d",TSS); 

lcd_string(sec);

If I commented out sprintf, now it's running properly, I can see RTC on USART, but if I use sprintf, it's running 2 seconds and freeze......any ideas ?

Thanks
 

Effective Embedded C debugging could almost be considered an artform, you gain much of it by experience coupled with studying the capabilities of your compiler and IDE, along with a few tips from other experienced programmers.

A good place to start when utilizing the KEIL MDK-ARM toolset and µVision IDE is the extensive online documentation:

KEIL µVision IDE Online Documentation

KEIL MDK-ARM Product Manuals

There are also a number of KEIL MDK-ARM and µVision IDE tutorials readily available on YouTube.


BigDog
 
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…