Author Topic: Problem with the tutorial (uTasker V1.3 - Tortorial for colfire M5233x)  (Read 12151 times)

Offline ZeroOne

  • Newbie
  • *
  • Posts: 12
    • View Profile
Hej.

I'm working through the coldfire tutorial and at the point where uTasker is suppose to create the file FLASH_M5223x.ini to store the webpages it simply doesn't. When I close down uTasker and start it up again I have to upload alle the webpages again.
Does anyone know what the problem might be?

ZeroOne

ps. I close doen uTasker by using File|Exit

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Problem with the tutorial (uTasker V1.3 - Tortorial for colfire M5233x)
« Reply #1 on: January 28, 2008, 05:01:45 PM »
Hi ZeroOne

This problem (or similar) has been reported by TheFrenchy - see http://www.utasker.com/forum/index.php?topic=146.0

I have received his project and tested it on my PC, where the files were saved correctly. In TheFrenchy's case this was accompanied by a crash but, because it worked on my PC, I couldn't investigate any further.

Which version of VS are you using? Does anyone have any ideas why this could occur on individual PCs? Are you using Vista?

Regards

Mark
« Last Edit: January 28, 2008, 06:24:47 PM by mark »

Offline ZeroOne

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem with the tutorial (uTasker V1.3 - Tortorial for colfire M5233x)
« Reply #2 on: January 28, 2008, 08:55:46 PM »
Hej again  :)

I'm using VS 2008 and running XP SP2.

My system is a laptop:
Dell inspriron 6400/E1505
1 GB ram
ATI x1400
80 GB Harddrive

ZeroOne

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Problem with the tutorial (uTasker V1.3 - Tortorial for colfire M5233x)
« Reply #3 on: January 28, 2008, 09:10:20 PM »
Hi

XP shouldn't be the issue - I wonder whether it is VS 2008?
If it doesn't crash, see whether you can see what is happening in fnSaveFlashToFile() in FileToDisk.c.
iFileIni should have a valid handle when the file is opened and then the write (_write) should save the (simulated) flash content. Check in the simulator directory whether the file is being created and what size it is.
If either of these (open of write) are failing you may be able to find the reason by looking at the return codes the functions give back.

Good luck

Regards

Mark

Offline ZeroOne

  • Newbie
  • *
  • Posts: 12
    • View Profile
Hello again.

I am sorry it's nearly been a little over a month since my last reply. There has been som urgent issues that I had to attend to instead of dealing with uTasker.

First I uninstalled VS 2008 and replaced it by Visual C++ 2005 express edition in the hope that this might solve the problem. I followed the instructions given by the FAQ concerning Visual C++ 2005 express edition and no problem there. I can compile and build, but the simulator still don't want to save to flash.

Then I followed the advise and debugged with a breakpoint at the beginning of the funktion fnSaveFlashToFile() in FileToDisk.c.

At the code line:

Code: [Select]
_sopen_s(&iFileIni, FLASH_FILE, (_O_BINARY |  _O_TRUNC  | _O_CREAT | _O_RDWR), 0, _S_IREAD | _S_IWRITE);
the debugger stops and a dialog box apears with the message: There is no source code available for the current location.

When I set a breakpoint below the above given code line, the breakpoint is never reached so the code is never executed.

I don't know what the problem might be. Any suggestions

ZeroOne

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Hi

Now I may have an idea!

When I check the code in the newest uTasker release I find the following at this position:

   _sopen_s(&iFileIni, FLASH_FILE, (_O_BINARY |  _O_TRUNC  | _O_CREAT | _O_RDWR), _SH_DENYNO, _S_IREAD | _S_IWRITE); /*{1}*/

There is a comment at the start of the file as follows:

   18.1.2007 Correct file sharing flag (_SH_DENYNO) for more recent VisualStudio versions {1}

Checking on the MSDN site for the description of this field and flag comes up with the following explanation:
Permits read and write access

Permits read and write access.
The pmode argument is required only when you specify _O_CREAT. If the file does not exist, pmode specifies the file’s permission settings, which are set when the new file is closed the first time. Otherwise pmode is ignored. pmode is an integer expression that contains one or both of the manifest constants


This suggests that this (or similar) problem was indeed solved some time back - only newer version of VS seem to require it - but you seem to be using the base version of uTasker without any service packs. Try installing the latest SP from http://www.utasker.com/software/softwareV1.3.html or add the _SH_DENYNO flag for a quick test.

Ensure that the file FLASH_M5223X.ini is first deleted before testing since it seems that it will only work when it is created again.

Good luck

Regards

Mark




Offline ZeroOne

  • Newbie
  • *
  • Posts: 12
    • View Profile
Hi

Problem solved  ;D
Updating to SP6 did the job. (It properly also would haved worked if I only would have updated to SP1)

Thanks for the great support  ;D

ZeroOne

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Hi

Your welcome - hope you like SP6!!

Regards

Mark