-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ISP_DFU_20 driver transfer file in case of USB 2.0 (NUVOTON M487KM) driver development #36
Comments
I'm not quite clear on your point of concern. You don't need to trace the driver unless you want to write a separate driver yourself. Using this sample, please refer to the documentation under the WindowsTool directory. |
ok ........ |
DFU_ClassRequest() is called when DFU class command received from USB Host (Windows PC). Could you explain the purpose of wanting to trace the code? Thank you. |
ok..... |
The USB device is passive, and all data transmission is initiated by the USB Host. Therefore, you must perform read operations from the Windows PC side for the USB device to receive commands and carry out corresponding data transfers. We do not provide the source code for the Windows side; this sample is intended for firmware updates. What is the purpose of sending data to the PC side? There may be other suitable sample codes, but since you haven't clearly explained your purpose, I'm unable to provide specific helpful suggestions. |
I am not getting properly concept. do you have any proper datasheet on DFU ? actually i am working on project so my task is to transmit or receive the data . using DFU_transfer file . |
You can find DFU spec. by Google search... Looks like your project is not on Nuvoton M480 platform, right? |
controller is NUVOTON M487KM . actually totally working in background only HSUSBD_StandardRequest(); this function run for configuration part. URB 165 URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE Down 15:22:29.574 18 bytes IN PENDING DISPATCH_LEVEL only this is showing in usb analyser |
i searched this but how to use in my project? |
|
The link to USB org including DFU spec. HSUSBD_StandardRequest() is for standard request, that is, for any USB device. DFU data transfer use class commands, not standard commands. Do you run the ISP tool or any program supports DFU on the host PC? |
I have Numicro ICP programing tool utility . |
i am using this DFU file and discriptor file . only changed in VID and PID for HMI detection . remaining code is same . so what i do first step? |
Not ICP tool, please use ISP tool which is for ISP_XXX samples. |
Do you have link of ISP tool? please send |
I downloaded ISP tool , suppose i start this what happened in next step ? directly calling DFU_class_request function ? |
Sorry, ISP is for USBD HID, not DFU. |
hello sir , actually in my case my pc is host . first pc sending 1 byte . so how to response to this ? how to know 1 byte receive in device? |
Do you run dfu-util.exe on the host PC? |
Dear sir, |
What's the USB device class supported by your PC utility? |
Dear sir, |
If you modify PID and VID of any M487 sample code, your PC utility can find it, too. So, I am asking what's the USB device class your PC utility is running. If you cannot tell what's the USB device class of you PC utility, we cannot go further. |
Dear sir, |
OK, obviously ISP_DFU20 is not CDC. |
Dear sir, For NXP devices different USB drivers are available like HID, CDC and VCOM, when they are connected to PC then they represented as base driver used for testing, we our previous version we shortlisted CDC driver example and modified its endpoints and descriptor as per our HMI driver required and implemented same communication with PC with USB port of NXP controller. Same communication we need to implement in Nuvoton M487KMCAN controller also, as we have our own HMI drivers and PC utility are already developed, hence we just need to modify Nuvoton M487KMCAN drivers to match our existing HMI protocol. |
Since it requires installing an additional driver, it seems there must be some custom handshake protocol involved. |
this is the flow of data transmission host (pc utility) ***************************device In this case first pc utility sending 1 byte of data to device first.
after receiving the data device sending 1 byte data to pc. 6(ACK byte) -------------------------> ACK received data is recieved pc sending ACK bit to device.
|
Bu the USB analyzer, can you see the first 9 bytes send from the PC utility? |
there will be no difference in operating system . but why its not working i dont know sir. i also confused. |
Perhaps you could seek assistance from the IT department in your office, or alternatively, you could try testing on another computer within the office environment. |
Unknown USB Device (configDiscriptor not proper) The origin setting of M480 USBD example must be fine. |
/*!<USB Configure Descriptor /
}; |
I was wrong from the beginning, so I didn't continue reading further. 35, 0x00, / wTotalLength 0x43 /0x01, / bNumInterfaces 2 /When you are modifying the descriptor, you must know what you are doing. I suggest you read the USB spec. Chapter 9 carefully. |
actually i compairing with my old project thats whay. |
|
|
why its not showing usb virtual com ? its showing (COM4) |
Why isn't this a virtual COM? |
good morning sir , now how to recieve 1 byte from host? and how to checking this receive or not? |
Neither of DFU and VCOM is suitable for this utility. Before proceeding, I would like to ask:
If you don't have either of the above, please obtain at least one of them. |
hcc_u8 usb_device_descriptor[] = //========================================================================================================================= hcc_u8 usb_config_descriptor[] =
}; hello sir , this is working USB HMI device of our old device of MCF controller . refference to this we are modifying on NUVOTON M487 . |
uint8_t gu8DeviceDescriptor[] = #define u8_usbConfigDescriptorDFU_LENGTH (18 + (9 * 1)) /*!<USB Configure Descriptor /
// 0x03,
// (TRANSFER_SIZE & 0x00FF),(TRANSFER_SIZE & 0xFF00) >> 8, /* TransferSize = 1024 Byte*/
}; this is modified DFU driver in this case USB HMI DEVICE detected fine. |
ISP_DFU_20 only uses control transfer for communication and does not utilize bulk transfer. However, the HMI USB uses bulk transfer (as indicated by the descriptor). Therefore, without modifying the DFU, it cannot function properly. Modifying only the PID/VID and class code merely deceives the HMI USB driver on the PC side. If the same modifications are made to the VCOM sample code descriptor, the HMI USB driver will make the same determination. Forget about ISP_DFU_20; you cannot use it to implement an HMI USB device unless you have the ability to write the bulk transfer part yourself. I still recommend using the VCOM example code, as it utilizes bulk transfer, which is more favorable for modification into an HMI USB device. First, modify the VCOM descriptor to be exactly the same as the HMI USB device, note that it must be identical. Then see what happens next. |
i modify in vcom interface discriptor as it same as old code . but i got error. sir, i have to change in VCOM transfer file also? |
No, please read my comments. I think it's clear enough. |
uint8_t gu8OtherConfigDescriptorFS[] = This 4 configuDiscriptors in this code . so in this case i have to modify all of these? ya only one (uint8_t gu8OtherConfigDescriptorFS[] =) ? actualy first discriptor i modify as same as HMI USB Device but its showing me USB VIRTUAL COM with yellow (error mark) |
Please make all the descriptors identical, this should not be difficult. |
thanks sir, Its showing me HMI USB Device in device manager . but pc utility not understanding this is HMI USB Device. pc utility showing me HMI USB Device not connected. |
Just as you cloned the descriptor of the HMI USB device, next, you need to clone the behavior of the HMI USB device. First, use a USB analyzer to log the normal transfer content of the HMI USB device, then log the transfer content of the M487, and compare where the differences occur in which transfer. Begin modifications from there. |
hello sir , in device manager it will showing HMI USB Device . But in USB analyser it will showing USB VIRTUAL COM . so pc utility showing HMI USB Device not connected. |
Not changing a set of descriptors would make it another device. Descriptors only describe the device, but the actual behavior of the device remains unchanged. This should be quite obvious and not difficult to understand. You must realize that you still have a lot to modify. |
Please compare the step by step log of your M487 device with the golden sample (standard USB HMI device), and find out the first differnet transfer. I guess it can be a vendor specific control transfer. |
standerd request in both devices are same. but how to check its vendor specific controll transfer? |
Please compare the USB analyzer logs of both and identify the first differing transfer. |
hello sir i got one issue. i worked on 8051series ML51SD1AE controller Here is my task is to blink LED first line high so LED on and then other 3 lines going to open drain mode. |
8051 series ML51SD1AE controller? Please submit your question in the correct place: |
some issues happen in data transmission .
1 . i have to transmit or receiving the data . so how to do this?
2. i have to change in DFU_Transfer file ?
3. void HSUSBD_ProcessSetupPacket(void)
{
/* Setup packet process */
gUsbCmd.bmRequestType = (uint8_t)(HSUSBD->SETUP1_0 & 0xfful);
gUsbCmd.bRequest = (uint8_t)((HSUSBD->SETUP1_0 >> 8) & 0xfful);
gUsbCmd.wValue = (uint16_t)HSUSBD->SETUP3_2;
gUsbCmd.wIndex = (uint16_t)HSUSBD->SETUP5_4;
gUsbCmd.wLength = (uint16_t)HSUSBD->SETUP7_6;
4.In hsusbd_user.c file only HSUSBD_StandardRequest() function is working for configuration part . when DFU_ClassRequest() ; function is called?
5. suppose i have to pass data so I have to calling seperately?
6. please give me the proper logic.
for example : - I have to transmit arr[10] = {1,2,3,4,5,6,7,8,9,0}; how to transmit ?
control in or control out.
case:
pc utility <--------------------------------> device
TX
command 9 ----------------------> 1st byte received.
RX
2 received <------------------------ 2 (device sending 2)
ACK
6 -------------------------> ACK byte received
64 bytes received < -------------------------- 64 bytes data packet send to pc
note :- 9 and 6 are random value of 1 bytes.
this is the flow of code so please find a perfect logic for this .
The text was updated successfully, but these errors were encountered: