cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in using sscanf in SPC5studio

Santhamurthy R
Associate II
Posted on February 22, 2017 at 10:50

Hello All,

I am  working on SPC560B54L5 controller and I am using SPC5studio version 5.2.1

I am trying to use sscanf() in my application but SPC5studio throwing the following errors, even I include stdio.h library file in my project.

undefined reference to 'close'

undefined reference to 'lseek'

undefined reference to 'read'

undefined reference to 'write'

0690X00000605vqQAA.png

kindly suggest in resolving the issue.

Thanks in advance,

Best Regards,

R.Santhamurthy

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee
Posted on February 24, 2017 at 09:55

Hello Santhamuthy R ,

Several choices

1) Recompile newlib with  

pcc-freevle-eabi- and some stubs

2) You can use the output formatter (a component in SPC5Studio)

3) Create a lighter sscanf.

Anyway, sscanf uses a lot of stacks and a lot of memories in the embedded world

i recommend to create a lighter sscanf or uses the output formatter.

             Best regards

                              Erwan

View solution in original post

4 REPLIES 4
Oliver Beirne
Senior
Posted on February 23, 2017 at 09:17

Hello

I have moved your question to the 

https://community.st.com/community/automotive-mcus-community/spc5-automotive-mcus

 forum where someone should be able to assist you.

Thanks

Erwan YVIN
ST Employee
Posted on February 23, 2017 at 13:48

Hello 

R.Santhamurthy ,

this toolchain ppc-freevle-eabi- is optimized for PowerPc core (e200 cores)

for your information, sscanf is working with hightec compiler not in freegcc 

in pcc-freevle-eabi- you need a small work of stubs

we have a change request for this task for newlib

              Best regards

                         Erwan

Posted on February 23, 2017 at 14:14

Hi Erwan,

Thank you very much for reply.

I understand the concern and it will very grateful if you suggest any other alternative approach for quickly fulfilling my request

Thanks,

R.Santhamurthy

Erwan YVIN
ST Employee
Posted on February 24, 2017 at 09:55

Hello Santhamuthy R ,

Several choices

1) Recompile newlib with  

pcc-freevle-eabi- and some stubs

2) You can use the output formatter (a component in SPC5Studio)

3) Create a lighter sscanf.

Anyway, sscanf uses a lot of stacks and a lot of memories in the embedded world

i recommend to create a lighter sscanf or uses the output formatter.

             Best regards

                              Erwan