unable to open and write  file  using MPC5554

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

unable to open and write  file  using MPC5554

8,140 次查看
tkm_moog
Contributor I
I am using MPC5554EVB with code Warrior version 2.3 and Nexus (P&E) debugger.
I want to open a file and write some data or string into the file..
I have added fopen() and fwrite() with MSL macros and source files in my default project.. and runnning it
on NEXUS (P&E) debugger. I have not found any errors while compiling and linking with codewarrior.
But after running test.elf build file on P&E debuuger its not opening any file..no run errors..
 
Please guide me what needs to be used to use file handling in Codewarrior for MPC5554 board.
 
Thanks
Taranath
 
标签 (1)
0 项奖励
回复
16 回复数

3,916 次查看
tkm_moog
Contributor I
Hi Crasy,
I am able to build the project in RTRT using the library files of Code Warrior.
Its working fine with no stubs and I am able to debug it in nexus debugger.
 
Now I have a problem with the stubs in RTRT, its giving undefined Stub name..
Following are the errors I am getting by adding the stubs..........................
 
TestRT attolcc1 - INFO: Function UartControlStatus renamed
Linking .\PowerPc5554\Test.elf...
### mwldeppc.exe Linker Error:
#   undefined: 'UartControlStatus'    #Stub call
#   Referenced from 'CheckGroundInterlocks' in COMCheckGroundInterlocks.o
### mwldeppc.exe Linker Error:
#   Link failed.
exit from the link Function before return
Executing .\PowerPc5554\Test.elf...
No trace PowerPc5554\TTest.rio generated.
 
 
Looking for more information . I can give the necessary files if you need.
Thanks,
Taranath
0 项奖励
回复

3,913 次查看
CrasyCat
Specialist III
Hello
 
I would recommend you to submit a service request for that.

Click here to submit a service request.

Make sure to attach a reproducible project and installed product information to the service request.
To generate the required information:
- Start CodeWarrior
- Open the project
- Select "Help" -> "Pack and Go" and follow instructions on the screen.

Attach the generated .zip file to the SR.
CrasyCat
0 项奖励
回复

3,916 次查看
tkm_moog
Contributor I
Thanks for your reply Crasy,
I would do that.
 
Taranath
0 项奖励
回复

3,913 次查看
FournierDavid
Contributor I

Hi everybody,

 

i saw the post from Taranath and i wonder what can be the solution to his problem... since i have the EXACT SAME PROBLEM right now when i try to use RTRT with CodeWarrior for Mobile GT. 

 


 
Hi Crasy,
I am able to build the project in RTRT using the library files of Code Warrior.
Its working fine with no stubs and I am able to debug it in nexus debugger.
Now I have a problem with the stubs in RTRT, its giving undefined Stub name..
Following are the errors I am getting by adding the stubs..........................
 
TestRT attolcc1 - INFO: Function UartControlStatus renamed
Linking .\PowerPc5554\Test.elf...
### mwldeppc.exe Linker Error:
#   undefined: 'UartControlStatus'    #Stub call
#   Referenced from 'CheckGroundInterlocks' in COMCheckGroundInterlocks.o
### mwldeppc.exe Linker Error:
#   Link failed.
exit from the link Function before return
Executing .\PowerPc5554\Test.elf...
No trace PowerPc5554\TTest.rio generated.
 
Looking for more information . I can give the necessary files if you need.
Thanks,
Taranath

 

I am pretty new to RTRT so if you have any clue and/or a solution for this problem, I'd like to hear that!

 

Thanks in advance!!

 

David

0 项奖励
回复

3,913 次查看
tkm_moog
Contributor I
Hi David,

Use this option for the Preprocessor, it works fine for me with the integers but i have problem with the floating point values,,, please let me know if you are able to solve this...

SystemP("$cc -E -ppopt pragma -ppopt line -ppopt full $defines $includes \"$src\" > atltmp.i");

Taranath
0 项奖励
回复

3,913 次查看
FournierDavid
Contributor I

Thank you very much Taranath, it works fine for me too.  You saved the day!

 

If i use floating point (but for now i don't think so) i will let you know.

 

Have a good day!

0 项奖励
回复

3,913 次查看
CrasyCat
Specialist III
Hello
 
Support for file I/O function is not available in the MPC55xx bare board tool chain.
Usage of file I/O requires a file system and probably an operating system.
 
Look at {Install}\Help\PDF\MSL C Reference.pdf.
In chapter "Configuring MSL" there is a section speaking about configuring file I/O.
Look at "Configuring Input and Output".
 
Basically you need to provide your implementation of fopen, fwrite, and so on.
If you have an underlying operating system providing file I/O capability, you can they hook up the OS system call to the MSL function.
 
CrasyCat
0 项奖励
回复

3,913 次查看
tkm_moog
Contributor I
Thanks for your reply Crasy,
I followed the Help/PDF/MSL c reference ..in that configuring input and output. (Console IO)
 
I am adding these in my default project c source  file, which was created while opening the default project in the IDE.
 
#inlcude<stdio.h>
#inlcude<stdlib.h>
and the following MSL pragmas is set in my c file to..
#define _MSL_OS_DISK_FILE_SUPPORT 1
#define _MSL_CONSOLE_SUPPORT 1
#define _MSL_BUFFERED_CONSOLE 1
#define _MSL_CONSOLE_FILE_IS_DISK_FILE  1
#define  _MSL_FILE_CONSOLE_ROUTINES  1
#define  _MSL_NULL_CONSOLE_ROUTINES  0
 
i was able to build with this, and this is running in nexus debugger(P&E) but no file is opened by this..
I have attached the project folder which i am using..
Thanks
Taranath


Copy of MPC5554test.zip
Message Edited by t.dowe on 2009-08-31 04:13 PM
0 项奖励
回复

3,913 次查看
CrasyCat
Specialist III
Hello
 
Did you provide an implementation for the file I/O function?
Function available in the MSL library are empty. You need to provide source code for fopen.
 
CrasyCat
0 项奖励
回复

3,913 次查看
tkm_moog
Contributor I
Hello Crasy,
Thanks for your suggestion, i will try to provide the fopen implementation for file I/O.
 


Message Edited by 05-Oct-2008 on 2008-10-20 03:15 AM
0 项奖励
回复

3,913 次查看
tkm_moog
Contributor I
Hi Crasy,
I tried to provide the fopen implementation.. i have observed some functions in  
${CWFOLDER}/MSL/MSL_C/MSL_Common/src/file_io.c ..does these functions have the full implementation for fopen(), fclose() etc.. 
 
can you give more details about this..
 
Thanks
Taranath
0 项奖励
回复

3,913 次查看
CrasyCat
Specialist III
Hello
 
This will not be enough. Functions in module file_io.c are calling other functions like __open_file, __read_file, __write_file, .. which need to be implemented.
 
The file \PowerPC_EABI_Support\MSL\MSL_C\PPC_EABI\SRC\file_io.stub.c includes containers for these functions.
But you need to provide the actual implementation.
 
CrasyCat
0 项奖励
回复

3,913 次查看
tkm_moog
Contributor I
Hi Crasy,
I am trying to add some functions to these...if i find and problems in between i will get back to you..
please suggest me which is better..without having file I/O is that good enough to dump data using the break point ..Actually i am using RTRT with this..
 
Thanks
Taranath
0 项奖励
回复

3,913 次查看
CrasyCat
Specialist III
Hello
 
According to my understanding you are trying to dump content of memory when you reach a breakpoint.
Is that correct?
 
The debugger delivered with MPC5554 comes from P&E.
So I would recommend you to ask them how you can achieve that.
 
They have a forum at following URL:
 
CrasyCat
0 项奖励
回复

3,913 次查看
tkm_moog
Contributor I
Hello CrasyCat,
I am able to dump memory from the debugger back to RTRT..
 
I have one question if i am able to work with file handlers in Codewarrior thats fine, then no break point is required in P&E debugger for RTRT to collect the runtime data..  does Frescale have the updated library which is not available in the current version for the file handling. Then instead of breakpoint i can Automate the process by collecting data in a file.
 
I tried to update the functions available in the MSL library for file handling but i am not understanding this completley.
 
Thanks
 


Message Edited by 05-Oct-2008 on 2008-11-12 02:35 AM
0 项奖励
回复

3,913 次查看
CrasyCat
Specialist III
Hello
 
I do not know is something like that is available.
I would recommend you to submit a service request to ask for this library.

Click here to submit a service request.

CrasyCat
0 项奖励
回复