AN4764 reference code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AN4764 reference code

3,036 Views
HeMyFAE
NXP Employee
NXP Employee

Dear An4764 Author,

Can you please post the reference code mentioned in the AN4764 Appnote?

or show me the link to where the code is.

Thx,

hy

0 Kudos
7 Replies

1,105 Views
perlam_i_au
Senior Contributor I

Please see the documentation attached, it also has the PC software.


Cheers,

Perla

-------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-------------------------------------------------------------------------------

0 Kudos

1,105 Views
fredroeber
Contributor II

Hi, Just a quick note. I got the code for the HID loader in the Zip file mentioned. Looking at the code there is a bug at line 84 of file USB_icp.c (in directory projects/USB_hid_icp). The line says "ret[i]=0;" but the variable i is uninitialized so this could be trashing any random location of RAM. Maybe it was meant to be "ret[1]=0;"?

0 Kudos

1,105 Views
mjbcswitzerland
Specialist V

Fred

I don't think that this project is being supported in any way since the KBOOT solution has been moved to: Kinetis Bootloader|Freescale

Regards

Mark

1,105 Views
vmfree
Contributor I

Dear Perla,

Is there source code for the PC software bootloader.exe ?  This could be very helpful for developing our pc application.

Thanks

VM

0 Kudos

1,105 Views
perlam_i_au
Senior Contributor I

No, here is only the HIDBootloader.exe not the source code of it :smileysad:

Update!!!!!

You can get the source code of the PC application of the AN4764 under NDA, contact your local distributor or enter a SR for more information

0 Kudos

1,105 Views
mjbcswitzerland
Specialist V

Hello Perla

I took a look at the HID boot loader today and saw that there are a number of copies of the source code in the project (depending on the board type used). Some of the boards are reporting their device descriptor correctly and some are sending an invalid USB version, depending on which files they use for the Device_Descriptor[]:

const uint_8 Device_Descriptor[18]=

{

    0x12,            //blength

    0x01,            //bDescriptor

    0x01,0x01,          //bcdUSB ver R=1.10

    0x00,            //bDeviceClass

    0x00,            //bDeviceSubClass           

    0x00,            //bDeviceProtocol           

    0x40,            //bMaxPacketSize0

    0xA2,0x15,        //idVendor - 0x15A2(freescale Vendor ID)

    0x03,0xFF,        //idProduct

    0x00,0x01,        //bcdDevice - Version 1.00

    0x01,            //iManufacturer - Index to string Manufacturer descriptor

    0x02,            //iProduct  - Index to string product descriptor

    0x03,            //iSerialNumber - Index to string serial number

    0x01                //bNumConfigurations - # of config. at current speed,

};

This is incorrect and they report themselves as a USB 1.0.1 device rather than a USB 1.1 device, This doesn't stop them working (at least not on the PC OS that I checked with) but it looks rather strange.

Some of the sources have the value as

0x10,0x01,  //bcdUSB ver R=2.00

which is correct for USB1.1 (the comment for USB 2 is however incorrect since it would be 0x00, 0x02).

A second minor point is that the HID boot loader says that it is self powered (which can be true but not always) and then requests 100mA maximum power. I believe that the specification requires the max power to be set to 0 when self powered so it is sending possibly incorrect details. I think that it would be best to not report that it is self powered so that the 100mA report is indeed valid and this should cover the non-self-powered case correctly.

Maybe someone would like to clean it up a bit.

Regards

Mark

0 Kudos

1,105 Views
mjbcswitzerland
Specialist V

Hi Perla

I have another couple of notes concerning the HID loader, specifically to the "HIDBootloader.exe" program.

1. Do you know whether this program will be advanced?
- Presently it crashes under various circumstances (if an erase is commanded when no device is connected or when the VID/PID are changed to match a different pair (that otherwise would work))

2. If improvements are to be made, it is recommended to read in the SREC each time a programming cycle is to be performed.
What I have found is that if an SREC is programmed and then the SREC is updated "HIDBootloader.exe" will still program the older version of the SREC (like it has it in its cache) when next used. This means that the SREC has to be re-selected at each programming cycle to ensure that the correct file content is programmed.

Regards

Mark

0 Kudos