Author Topic: M52259DEMO and FTP hanging  (Read 9412 times)

Offline Nord66

  • Newbie
  • *
  • Posts: 3
    • View Profile
M52259DEMO and FTP hanging
« on: May 20, 2010, 05:53:56 PM »
Hello!

I'm using M52259DEMO and CodeWarrior 7.1 with 7.1.1 patch
When I'm flashing demo uTaskerV1.3_M52259DEMO_USB_ETHERNET.s19 into my boards, everything is OK
And when I trying to build the uTasker sources by myself and flash the result - everything is OK too except for the ftp. It hangs after LIST command. And after 2 seconds of hanging watchdog timer resets the board. Disabling watchdog do not solve the problem - board just has not been automatically reseted after hang

The behavior is the same like described in this topic - http://www.utasker.com/forum/index.php?topic=682.0
So I think that I have wrong filesystem configuration too.
But I did not changed anything there:
 #define PARAMETER_BLOCK_START 0x21000                    // {45} FLASH location at 132k start
 #define uFILE_START 0x23000                              // FLASH location at 140k start
 #define SINGLE_FILE_SIZE (1*FLASH_GRANULARITY)           // each file a multiple of 4k
 #define FILE_SYSTEM_SIZE (93*SINGLE_FILE_SIZE)           // 374k reserved for file system

I tried to change size in last line to 14*SINGLE_FILE_SIZE, but the behavior remains the same

Where can be the problem?

Thanks

Offline Nord66

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: M52259DEMO and FTP hanging
« Reply #1 on: May 20, 2010, 06:10:29 PM »
Some additions:

I could not run uTasker with default linker options. CodeWarrior produces file that contains only one "code section" while uTaskerV1.3_M52259DEMO_USB_ETHERNET.s19 contains 4:

nord@nord-note:/tmp$ srec_info uTaskerV1.3_M52259DEMO_USB_ETHERNET.s19
Format: Motorola S-Record
Execution Start Address: 00001008
Data: 000000 - 0002D5
        000400 - 000417
        000420 - 00079F
        001000 - 016AF5

nord@nord-note:/tmp$ srec_info uTasker_52259.S19
Format: Motorola S-Record
Execution Start Address: 00001008
Data:   001000 - 0178A3

So the only working solution was to flash uTaskerV1.3_M52259DEMO_USB_ETHERNET.s19, then erase all blocks except the 000-FFF, and flash my uTasker_52259.S19. Also I have set struct alignment to 68k (WORD). For some reasons it not worked with DWORD alignment.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: M52259DEMO and FTP hanging
« Reply #2 on: May 20, 2010, 08:49:04 PM »
Hi

I would solve the second problem first because it may be related - apart from the file system trying to access none-existent memory (as in the link that you pointed out) I don't see the reason for the board to crash when it tries to list the files (check also that SD Card is disabled - although this shouldn't actually disturb since without a connected SD card it will default to the internal file system).

In the problem 2 it looks as though you are compiling for a boot-loader target with the start code linked to 0x1000. It should be linked to start at 0x0000 and then will also have the other sectors (these are FLASH configuration, start-up and then the application).
For the M52259 use the M5223X_ROM target - the linker script is the same as used for M5223X and the only thing to change when debugging is the target (from M52235 to M52259) so that the registers are displayed correctly (actually compiling will not result in differences). Only use M5225X_BM_ROM (Bare-Minimum boot loader) when there is a boot loader installed. The USB demo has a boot loader installed and that is why it jumps to the start of your code when it is in place (!).  It may also allow you to load a BM-target via USB if this is the build ;-) (although it may be size limited (?)).

Note that the BM build uses the linker script file M5225X_BOOT_APP_FLASH.lcf with following FLASH configuration:
    flash   (RX)   : ORIGIN = 0x00001000, LENGTH = 0x0003F000
The M5223X_ROM build uses M52235EVB_FLASH.lcf with:
    flash1  (RX)   : ORIGIN = 0x00000000, LENGTH = 0x000400
    flashconfig   (RX)   : ORIGIN = 0x00000400, LENGTH = 0x00000018 
    flash2  (RX)   : ORIGIN = 0x00000420, LENGTH = 0x003FBE0


I have understood that you only ran the code together with the boot loader part from the USB demo binary. If this is the case it may be restricting something (like the file system listing) - I can't actually explain what it could be but I would get the project working stand-alone first and then see whether it helps. If not I would disable the watchdog and try to debug the exception according to this guide: http://www.utasker.com/forum/index.php?topic=123.msg468#msg468 . If it is really try to access unavailable FLASH (a valid reason for a crash) it would probably be quite obvious and the cure also.

Good luck.

Regards

Mark


Offline Nord66

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: M52259DEMO and FTP hanging
« Reply #3 on: May 21, 2010, 03:46:30 PM »
Mark, thank you for help!
My problem was with enabled SPI_FILE_SYSTEM

And you are right, I used M5225X_BM_ROM target. Changed to M5223X_ROM and it helps

Thank you very much!