Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - neil

Pages: 1 2 3 [4] 5 6 ... 30
46
NXPTM M522XX, KINETIS and i.MX RT / Re: HID class on USB
« on: November 07, 2015, 08:59:04 AM »
Hi Mark,
  Thats correct, the task is receiving the code, and fnWrite is called which returns 64. The ucRawData is as expected after with 1 character and rest filled with zeros. But nothing is displayed on the console application (in  https://www.pjrc.com/teensy/rawhid.html link).

Also, a few questions, if you dont mind:

  1. The receive/transmit block to and from utasker  is always 64 bytes in length , even if 1 character is sent/received?

  2. If No 2, above is true, is there a way of known within the 64 bytes what was the number actually transmitted from the pc app? So if the app sent 4 bytes of data (non ascii) is there a way of known within the app if it was 4 bytes sent? Cant check for the zeros as this value can be sent too.

  3. If I place a break point write after the write line, I get an error in the console application saying the device is offline. Why is this?

Many Thanks
Neil

47
NXPTM M522XX, KINETIS and i.MX RT / Re: HID class on USB
« on: November 06, 2015, 06:33:22 PM »
Hi Neil

HID mouse uses an IN endpoint and the PC host polls it to receive movement and key press information (8 bytes).
The PC host can send a class command to control a few outputs on the mouse.
Therefore I don't know whether HID mouse is suitable generally.

HID keyboard is very similar in that the the PC host also polls for key strokes and can control some outputs (like CAPS lock LED). Again I don't know whether this is generally suitable.

More general and flexible if possibly USE_USB_HID_RAW which allows 64 byte blocks of data to be transferred in both directions.
I have implemented this so that it can be tested with the Teensy example application explained/found here: https://www.pjrc.com/teensy/rawhid.html
I also found a video of it at https://www.youtube.com/watch?v=iMuNbAv61OA (although 95% is how to get it working on Linix - right at the end it shows it operating).

It alows 64 byte blocks in both directions so can handle 64kBye/s to the PC host and higher from the PC host.

The implementation just echoes the data that the PC host sends back to it but this can easily be used as basis for communication between PC and application once commands are defined and handled. Since HID RAW doesn't need any driver it is also practical as base for PC applications.

Regards

Mark

Hi Mark,
  I used the small console application above , and it worked when I press a key , but nothing was returned from utasker. I placed a breakpoint at where the information should be echoed, so I know it received the information ok.

Regards
Neil

48
NXPTM M522XX, KINETIS and i.MX RT / Re: HID class on USB
« on: November 02, 2015, 03:05:39 PM »
Hi Mark,
  As I am using the 52259 processor, can you please email me the required files I need to use this feature? And is it just a matter of enabling the USE_USB_HID_RAW?

Many Thanks

Regards
Neil

49
NXPTM M522XX, KINETIS and i.MX RT / Re: HID class on USB
« on: November 01, 2015, 09:01:23 PM »
Hi Mark
  Thanks for the reply.  Does the latest uTasker have  USE_USB_HID_RAW included?  And does it currently simply echo what it receives from a PC app at the moment?

Thanks again


Regards
Neil

50
NXPTM M522XX, KINETIS and i.MX RT / HID class on USB
« on: November 01, 2015, 07:32:07 PM »
Hi Mark
   Finally I will be starting soon to hopefully use the USB HID. I found a small library that I can use on Visual Studio within the Windows platform. Looking at your previous post (a while back), I see you carried out mouse buttons simulation, who I assume the Windows HID will pick it up as mouse buttons. The library I have will read and send data to the USB port, does your code allow to read and send data ? If so how is this done?

Thanks in advance


regards

Neil

51
utFAT / Re: Files saved on SD card dont show on PC
« on: October 06, 2015, 01:27:56 PM »
Hi Mark,
  I copied across the utOpenDirectory() routine only, and all works well. I commented out the UTFAT_LFN_READ , which as you previously mentioned disables the LFN. I ran my own project for a while and was  fine, and was able to see the files that were created using the Dir command. The managed code works fine too, so all looks good.  I havent tried looking at it on the PC yet (still working from home), but will be in the office tomorrow  so will give it a try , and will let you know how I get on.

Thanks again for all your help

Regards
Neil


52
utFAT / Re: Files saved on SD card dont show on PC
« on: October 05, 2015, 06:54:00 PM »
Hi Mark
   I just quickly tested the uTasker project (the one you debugged remotely the other day) , I commented out the UFAT_LFN_READ and ran the application. The issue where the directory wasnt seen appeared again. Could there be an issue when not using the LFN? Also, when enabled the managed files doesnt seem to work as previously described.


regards
Neil

53
utFAT / Re: Files saved on SD card dont show on PC
« on: October 05, 2015, 03:53:07 PM »
Hi Mark
  Thanks for your online support.  I managed to integrate the terminal screen into my application and still I got the same issues. I know the uFAT code is the same in both utasker and my project, and I know I have plenty of memory. So looking at my config file I noticed the issue was that the #ifdef UTFAT_LFN_READ was commented out , so I changed this and now had the same as the uTasker project. Below is the settings for both my project, and uTasker Project.
  I was then able to see the files and directories with the console on my code. After rebuilding my own project I then ran into an issue, which I replicated on the uTasker project. I have 2 file handles pointing to the same file.The first handle creates the file,  the other handle opens the file for read (manage mode). I placed the following right after I create a directory on the uTasker project.

   UTFILE fdWTest,fdRTest;  //both lines are global , and ptr_utDirectory was previously initialised.
   int Ret1,Ret2;
        Ret1=utOpenFile("\\Index.dat", &fdWTest, ptr_utDirectory,UTFAT_OPEN_FOR_WRITE | UTFAT_OPEN_FOR_READ | UTFAT_CREATE);  //file created
        Ret2=utOpenFile("\\Index.dat", &fdRTest, ptr_utDirectory,UTFAT_OPEN_FOR_READ | UTFAT_MANAGED_MODE ); //same file open for read in manage mode,

Ret1 returned fine, and the file was created (I see this in a DIR command) , but Ret2 returned -6 (UTFAT_FILE_NOT_FOUND).  If I commented out UTFAT_LFN_READ in my config , works fine as far as both files are opened, and my application runs as expected. But I cant see the files (original issue).

I dont want to use the "long file Names"  so I commented out UTFAT_LFN_READ,UTFAT_LFN_WRITE,   UTFAT_LFN_WRITE_PATCH,UTFAT_LFN_DELETE but the compiler threw errors out, see attachment


////CONFIG
    #define SD_CARD_RETRY_INTERVAL       5                               // attempt SD card initialisation at 5s intervals
    #define UT_DIRECTORIES_AVAILABLE     5                               // this many directories objects are available for allocation
    #define UTMANAGED_FILE_COUNT        10                               // allow this many managed files at one time
    #define UTFAT_LFN_READ                                               // enable long file name read support
    #ifdef UTFAT_LFN_READ
        #define MAX_UTFAT_FILE_NAME     (100)                            // the maximum file name length supported
    #endif
    #define UTFAT_WRITE                                                  // enable write functions
    #ifdef UTFAT_WRITE
        #define UTFAT_FORMATTING                                         // enable formatting SD cards (requires also write)
    #endif
    #define UTFAT_FULL_FORMATTING
    #define UTFAT_LFN_WRITE   
    #define UTFAT_LFN_WRITE_PATCH
//  #define SD_CONTROLLER_AVAILABLE

Best Regards
Neil


54
utFAT / Re: Files saved on SD card dont show on PC
« on: October 01, 2015, 10:18:26 AM »
Hi Mark,
  Thanks very much for this.  Currently I am working remotely to my computer in the office, and I installed the Chrome Desktop app (I am running on Windows XP on my development machine) and made sure it was enabled in the plugins. I then tried to connect to it from another machine (installed there too, and running Windows 8.1),  but no luck. After entering the access code, connection doesn't take place. I use Teamviewer, is this any good for you? I can email you the whole project if that would help.

Thanks

Regards
Neil

55
utFAT / Re: Files saved on SD card dont show on PC
« on: September 30, 2015, 02:01:59 PM »
Hi Mark,
   I noticed I had a version of the standard uTasker M522xx (I used target M5225X_EXT_RAM) .  The last line at the start the debug file is:
31.01.2010 File open for rename uses attribute UTFAT_OPEN_FOR_RENAME rather than UTFAT_OPEN_FOR_WRITE {20}

Before I copied the uFAT from my application  (V2.01) , it had the issue where the format wouldnt finish (I have Transcend cards)  , which you sorted. But when I had other types of cards I was able to format, mkdir etc, and see the changes doing a dir command. So seemed to work fine. I then copied uFAT 2.1 from my application to the application, and got the previous result I posted.

I dont use the emulator, I always use codewarrior V7.2. I copied over files mass_storage.c and .h.  The last few lines at the start of the .c file are:

   06.10.2014 Correct brackets in fnExtractLongFileName()                {6} [uFATV2.01]
[1] changes for formatting cards that previously didnt format.

I have tried it on a few boards I have, with same results. I have a client with sandisk card, and also experiencing the same.. He is the only customer who has taken out the card.

Regards
Neil




56
utFAT / Re: Files saved on SD card dont show on PC
« on: September 30, 2015, 10:43:33 AM »
Hi Mark,
  I have copied across my uFat files and done exact commands as yourself, I got the below, which is not the same as your example. And when I carried out a Dir, there were no signs of the directory

Regards
Neil

SD-card NO (2008023040 bytes)
Bytes per sector: 512
Cluster size: 4096
Directory base: 0x00000002
FAT start: 0x0000005f
FAT size: 0x00000ef3
Number of FATs: 2
LBA: 0x00001e45
Total clusters: 0x00077737
Info sect: 0x00000040
Free clusters: 0x00077736
Next free: 0x00000003
CSD: 0x00 0x7f 0x00 0x32 0x5b 0x5a 0x83 0xbd 0x6d 0xb7 0xff 0x80 0x0a 0x80 0x00 0x8d
D:\>

D:\>sect 1e4f
Reading sector 0x00001e45
0x006e6569 0x6c000000 0x00000008 0x00000060 0xeb44eb44 0x00000060 0xeb440000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
D:\>

D:\>mkdir dir1
>sect 1e45
 Reading sector 0x00001e45
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000010 0x00000060 0xeb44eb44 0x00000060 0xeb440300 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x2e202020 0x20202020 0x20202010 0x00000060 0xeb44eb44 0x00000060 0xeb440300 0x00000000 0x2e2e2020 0x20202020
0x20202010 0x00000060 0xeb44eb44 0x00000060 0xeb440200 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
>
#dir
Directory

0 files with 0 bytes
0 directories, 2004045824 bytes free
>

57
utFAT / Re: Files saved on SD card dont show on PC
« on: September 29, 2015, 02:40:27 PM »
Hi Mark
   I have lost my password for getting into the project, can you please resend it to me?

Many Thanks
Neil

58
utFAT / Re: Files saved on SD card dont show on PC
« on: September 28, 2015, 01:18:46 PM »
Hi Mark
  Thanks for this. Where would I find the latest version of your utasker Demo?  It happens on all cards we used, and as soon as we use them.

Regards
Neil

59
utFAT / Re: Files saved on SD card dont show on PC
« on: September 27, 2015, 08:44:36 PM »
Hi Mark
  What routines use this? Is the size dictated during the format procedure?  I remember it used to work okay before the last SD latest version. I simply overwrote the .h and .c mass storage files. Was there anything else needed?


regards
Neil

60
utFAT / Re: Files saved on SD card dont show on PC
« on: September 24, 2015, 04:07:31 PM »
Hi Mark
  Thanks for the reply. I will take a look and see if its this causing the issue. You are correct with the files on the card,  FLUSH, 2015, INDEX, CALIB . There are all files names in the root directory , and 2015 is a folder where data is stored.

Regards
Neil

Pages: 1 2 3 [4] 5 6 ... 30