sscanf nano library

Asked by Adriano

I'm trying to use sscanf to retire values from a buffer of char like in the following example:

sscanf(buffer_tx,"%d:%d:%d",&set_hour,&set_minute,&set_second);

The program block when i use the this with the nano library and give overflow f the ram when use the C library.

I don't understand why the program block with the nano library.

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Joey Ye (jinyun-ye) said :
#1

How much ram do you have. It might still go overflow with nano if ram not
sufficient. Unexpected behavior happen in case of overflow
On Jan 24, 2013 3:31 AM, "Adriano" <email address hidden>
wrote:

> Question #219957 on GCC ARM Embedded changed:
> https://answers.launchpad.net/gcc-arm-embedded/+question/219957
>
> Description changed to:
> I'm trying to use sscanf to retire values from a buffer of char like in
> the following example:
>
> sscanf(buffer_tx,"%d:%d:%d",&set_hour,&set_minute,&set_second);
>
> The program block when i use the this with the nano library and give
> overflow f the ram when use the C library.
>
> I don't understand why the program block with the nano library.
>
> --
> You received this question notification because you are an answer
> contact for GCC ARM Embedded.
>

Revision history for this message
Adriano (adriano-pinto-2006) said :
#2

The microprocessor i'm using is the stm32f103rbt6 with 128 Kbytes of flash and 20 Kbytes of ram. I'm using the Coide from coocox. And when i select the nanolibrary the error of ram overflow disappear.

Revision history for this message
chengbin (can-finner) said :
#3

Could you please provide more information about this problem when using nano library?
What's the content of input buffer? What does it mean "The program block..."

Thanks

Revision history for this message
Joey Ye (jinyun-ye) said :
#4

Also it will be useful to know where it blocks by break it and check the stack frames

Can you help with this problem?

Provide an answer of your own, or ask Adriano for more information if necessary.

To post a message you must log in.