LPC4337 and programming flash in work(IAP)

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

LPC4337 and programming flash in work(IAP)

452 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by snovik on Wed Apr 02 23:45:43 MST 2014
Hello.

I do realization card reader through usb.
In the process work, I need to change the data in the firmware (usb descriptors). I understand this is done through the IAP (In-Application Programming).

How do I do this?

Example of what needs to change:
USB_Descriptor_Device_t MassStorageDeviceDescriptor = {
.Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},

.USBSpecification       = VERSION_BCD(02.00),
.Class                  = USB_CSCP_NoDeviceClass,
.SubClass               = USB_CSCP_NoDeviceSubclass,
.Protocol               = USB_CSCP_NoDeviceProtocol,

.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,

.VendorID               = 0x1111,/* TEST!!! */
.ProductID              = 0x2222,
.ReleaseNumber          = VERSION_BCD(01.00),

.ManufacturerStrIndex   = 0x01,
.ProductStrIndex        = 0x02,
.SerialNumStrIndex      = USE_INTERNAL_SERIAL,

.NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS
};


/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
 *  the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
 *  via the language ID table available at USB.org what languages the device supports for its string descriptors.
 */
uint8_t MassStorageLanguageString[] = {
USB_STRING_LEN(1),
DTYPE_String,
WBVAL(LANGUAGE_ID_ENG),
};
USB_Descriptor_String_t *MassStorageLanguageStringPtr = (USB_Descriptor_String_t *) MassStorageLanguageString;

/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
 *  form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
 *  Descriptor.
 */
uint8_t MassStorageManufacturerString[] = {
USB_STRING_LEN(3),
DTYPE_String,
WBVAL('T'),
WBVAL('T'),
WBVAL('T'),
};
USB_Descriptor_String_t *MassStorageManufacturerStringPtr = (USB_Descriptor_String_t *) MassStorageManufacturerString;

/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
 *  and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
 *  Descriptor.
 */
uint8_t MassStorageProductString[] = {
USB_STRING_LEN(21),
DTYPE_String,
WBVAL('T'),
WBVAL('T'),
WBVAL('T'),
WBVAL(' '),
WBVAL('M'),
WBVAL('a'),
WBVAL('s'),
WBVAL('s'),
WBVAL(' '),
WBVAL('S'),
WBVAL('t'),
WBVAL('o'),
WBVAL('r'),
WBVAL('a'),
WBVAL('g'),
WBVAL('e'),
WBVAL(' '),
WBVAL('D'),
WBVAL('e'),
WBVAL('m'),
WBVAL('o'),
};
USB_Descriptor_String_t *MassStorageProductStringPtr = (USB_Descriptor_String_t *) MassStorageProductString;


Thanks.
Labels (1)
0 Kudos
1 Reply

300 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Thu Apr 03 02:37:30 MST 2014
If you search for "IAP" on this site you get several threads which explain one or the other problem with IAP in more detail. IAP is similar over most of our MCU families.

Application notes for specific MCUs can be found here:

http://www.lpcware.com/content/nxpfile/an11511-lpc11u6x-application-programming
http://www.lpcware.com/content/nxpfile/an11388-using-lpc800-application-programming
http://www.lpcware.com/content/nxpfile/an11387-application-programming-lpc11axx

You need to place the stuff you want/need to change in its own flash sector, because you can only erase/program on sectors.

Regards,
NXP Support Team
0 Kudos