Iam using Beagle board Rev C3 with CCS 5.0 ,CG tools version 4.9.1, compiler TMS470 for cortex A8 device. I have the following code to open a file.
fp_r = fopen("abcd.wav","rb");
In my project abcd.wav file does not exist. After this code is executed, Instead of having a NULL pointer in fp_r, fp_r is having an address and junk data is read into the buffer, when attempted to read using this file pointer.
I have tried older CG tools version 4.6.1. problem remains the same, even with older CGtools.
Is this the problem with CCS or am i missing some thing.
Start by considering all the issues described on this wiki page.
Thanks and regards,
TI C/C++ Compiler Forum ModeratorPlease click Verify Answer on the best reply to your questionThe CCS Youtube Channel has short how-to videosThe Compiler Wiki answers most common questionsTrack an issue with SDOWP. Enter your bug id in the Search box.
In reply to George Mock:
Thanks for the quick reply,
The code is simple file reading of 512 bytes. The same code works on CCS4.0.2, CGtools 4.6.1. Is this issue with latest CCS version 5.1.0.08012.
Thanks & Regards,
In reply to chandrakala madhira:
Well, let's try to determine whether the compiler or CCS is part of the problem.
Take the .out file you built with the v4.6.1 compiler. We know it works under CCS 4.0.2. That same out file should run just fine under CCS 5.0. So try that out and let us know what you get.
You could also do this the other way. Take the .out file you built with the v4.9.1 compiler. We know it does not work under CCS 5.0. See if works under CCS 4.0.2. Please try this out and let us know what you see.
Thanks George for the reply.
we tried testing .out generated by CCS 4.0.2. with CG tools 4.6.1 on CCS5.0. CCS5.0 is not able to open the input file .
CCS 4.0.2 with CGtools 4.9.1 is working fine.
iam using XDS100V2 USB emulator and CCS5.0 on windows XP machine. Is this the problem with emulator or do i need to install any kind of extra drivers.
I did some testing here in my system and managed to reproduce the same issues as you reported in CCSv4.2.4, CCSv5.0.x and even 5.1.x (I don't have 4.0.2 as it is rather old).
However, since I am running Windows 7 I noticed that this issue only occurs if I attempt to write to specific areas that are protected by the UAC (I was originally trying to write to C:\). The moment I redirected the file location to an unprotected area (I used C:\TMP) the code started working fine (check the screen below with the console output in CCSv5.1).
Check the testcase attached created with CCSv4.2.4 (can be imported to CCSv5). My debug platform is a Beagleboard C1 with a XDS100v2.
Hope this helps,
In reply to desouza:
we found that the issue is not with the access to restricted area. It is because of using boot code. please find the attached files. in Init.txt we have enabled MMU. boot.txt deals with stack initializations. if we remove these 2 files from the project, file reads are working fine. when these 2 files are added, file reads are not happening. The reason for adding these 2 files to the project, is to support MMU and VFPV3. Is there any problem in these 2 files.
these 2 files are used for CCS4.0.2 CGtools 4.6.1. there was no file read issue observed. Issue is observed with CCS5.0. CGtools 4.9.1and CGtools4.6.1. Is this problem is with CCS or the boot files.
I recognize the boot.txt file. It is the boot routine supplied with the TI ARM compiler, though it has been modified. I've never seen the init.txt file before, though it appears to do the same task as boot.txt. I don't see how your system could use both files. It must be one or the other. Who made the changes to boot.txt? Where does init.txt come from? It seems you need to talk with whoever supplied you those files to see why they work they way they do.
Yes, the boot.txt is the boot routine file supplied with the TI ARM compiler.
The changes in the boot routine code are:
Added some code for enabling I cache, D cache, L2 unified cache, branch prediction and removed NEON and VFP enable code.
Init.txt is the file written at our end to enable MMU, enable VFP and NEON before the main (_c_int00) function starts.
Init.txt has the code to invalidate I cache, D cache, page table generation, enable MMU bit, enable NEON and VFP, and then branch to main (_c_int00).
In Init.txt Start function has the code to enable MMU which will reduce cycles. It is the entry function for the project.
From this init.txt, after enabling NEON and VFP, MMU it branches to boot routine code (i.e., boot.txt).
By adding these two files in the project, the file open issue occuring. So please suggest me why the problem is occuring by adding them.
In reply to Vinay Kumar37373:
Sorry for the delay ...
We compiler experts are not familiar with system set up issues such as what happens when you enable the MMU. So we cannot comment on whether your changes to the system initialization are correct. I recommend you ask about it on the forum for the processor you are using.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.