cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

New Contributor II

Hi there,

we have implemented a USB Bootloader starting from the excellent AN https://www.cypress.com/documentation/application-notes/an73503-psoc-usb-hid-bootloader

when we create the release mode version of the attached AN (we made some changes).

we found out that it works only on the machine that has PSoC creator installed (and it doesn't work for our customer).

please see the error message: (can't find the Bootloader_Utils.dll.) The confusing part is that when we browsed inside the installed directory,the dll is there! so I'm very confused...

do you have any suggestions?

Thanks!

Francesco

ofya8mpr.bmp

0 Likes
Reply
62 Replies
Honored Contributor

Francesco,

Interesting!

Let me take a guess.

When you created your own Bootloader for the host PC, the compiler/linker uses your .dll as a resource/dependency which you installed in your Bootloader project directory.  Did you move the .dll in question into a directory or subdirectory of your project or reference it to somewhere else in your computer?

It's possible that your build on your computer points to the .dll just fine but uses an absolute reference to it to run.

The shared archive of the build for your customer includes the .dll but doesn't re-reference it as a relative linked file to run.  It might be using the absolute reference as used on your host computer.

There are host tools to display which file calls are being used for a Task/Process.  This might be able to detect where on your customer computer it thinks the .dll is located.

Are you using the installer/archiver that comes with the host computer when you built the Bootloader host program?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
New Contributor II

Thank you Len,

I have added in the Visual Studio all the dll as references in the release version.

When I create the installer I can see that all the dll are correctly included in the installation package.

But I suspect, that for some reason on my PC I call a different dll.

You mention some tool I can use to check which dll I'm calling?which tool ? can you give me a link?

Thank you!

Francesco

0 Likes
Reply
Honored Contributor

Francesco,

The tool I use is from Microsoft called ProcessMonitor.

Process Monitor - Windows Sysinternals | Microsoft Docs

It's powerful but you will need to do filtering to prevent too much information.  There is a simple way to add the filename of your Bootloader host program to filter as "Include".  Then only process calls from your application will show up in the display.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
New Contributor II

Hi Len,

on my PC, the dll loaded is correct (where the App has been installed).

so it is still a mystery why on some PC this is not happening.

I don't want to ask my customer to use a tool like Pprocess Monitor to try to understand which dll is called.

pastedImage_0.png

0 Likes
Reply
Honored Contributor

Francesco,

Do you have another computer to perform the install of your bootloader program?

Since this other computer would not be your development computer, if you run into the same problem, you could run Process Monitor on this computer in your office to possibly determine the issue.

I have a 'target' computer I use that is NOT my development computer.  When I want to share an executable, I test it on this computer since it may not have the same dependencies that my development computer has.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
Honored Contributor

Francesco,

I downloaded the "USB Bootloader Host.zip" and compiled it on my computer.

I had NO problem opening the Bootloader host executable.  No .dll missing issue.

How are you distributing the host program to your customer?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
Moderator
Moderator

Hello Francesco.

Any update to LePo_1062026​ questions?

Even I wasn't able to reproduce this error. Please follow the steps carefully as mentioned in the application note. Since you haven't attached the project I cannot say much, but one thing you could try is checking if you have the msvcr100.dll installed. If you don't have it, please download it from here and add it to the "C:\Windows\System32" folder.

Let me know if it works.

Regards,
Dheeraj

0 Likes
Reply
New Contributor II

Hi everybody,

sorry for the late reply,

I asked my customer to compile the project with a different version of Visual Studio, and their Software engineer is busy ATM.

I was waiting for his feedback to come back here.

I have asked my customer to share with you the Bootloader code, and they don't see any issue with that, but before I do that I want that their software engineer look at this first.

I have a looked at Process Monitor on My PC (which works) and I have proved that on my PC the software manage to open the USB bootloader dll correctly.

however on my customer PC this doesn't seem to happen, and this is the reason why I need their software engineer to look at this first.

As soon I get a feedback from him I'll let you both to know.

Thank you for your help so far I really appreciate, and as soon I have a feedback I'll let you know.

Kind regards,

Francesco

0 Likes
Reply
Moderator
Moderator

Hello Francesco,

Any update on this?


Regards,
Dheeraj

0 Likes
Reply
New Contributor II

Hi Dheeraj,

not yet, the coronavirus is creating more delays then expected...

if you want you can close this case and I will reopen when I have more information.

Kind regards,

Francesco.

New Contributor II

Hi Lepo,

to reply your answer, yes I have distributed to my customer and only in his PC the bootloader is not working. it does work on my PC.

I have also proved that on my PC I call the correct dll (from the installed directory)

Kind regards,

Francesco

0 Likes
Reply
New Contributor II

Hi Lepo,

sorry for the late reply,

while my customer was experiencing the issue, I was unable to replicate to my machines.

after some time I manage to get a machine where I can duplicate the issue, and while I'm still having the same issues as explained above, in the logfile from Process Monitor I can't find anything that may explains the issue.

I have a logfile for the issue... any chance I can send to you so you can see?

Do you have any suggestions?

Thank you,

Francesco

0 Likes
Reply
Honored Contributor

Francesco,

I'd be willing to look at the log file.  Maybe I can find something.  If you place it on this post maybe someone from Cypress who is more familiar with the process may spot the issue.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
New Contributor II

Thank you Leo,

I have attached a filtered portion from Process Monitor.

Francesco

0 Likes
Reply
Honored Contributor

Francesco,

Here is the further filtered data from your Process Monitor output that refers to the Bootloader_Utils.dll file.

       

Time of DayProcess NamePIDOperationPathResultDetail
24:48.4USBBootloaderHost.exe8212FASTIO_NETWORK_QUERY_OPENC:\Users\Jessi\AppData\Local\Apps\2.0\O0GNZM6J.N5O\OLM9ZD01.G4E\usbb..tion_105279151e79de17_0001.0000_83fb4bd7411a6291\Bootloader_Utils.dllFAST IO DISALLOWED
24:48.4USBBootloaderHost.exe8212FASTIO_ACQUIRE_FOR_SECTION_SYNCHRONIZATIONC:\\UsersJessi\AppData\Local\Apps\2.0\O0GNZM6J.N5O\OLM9ZD01.G4E\usbb..tion_105279151e79de17_0001.0000_83fb4bd7411a6291\Bootloader_Utils.dllFILE LOCKED WITH ONLY READERSSyncType: SyncTypeCreateSection, PageProtection: PAGE_EXECUTE_READ
24:48.4USBBootloaderHost.exe8212FASTIO_NETWORK_QUERY_OPENC:\Users\Jessi\AppData\Local\Apps\2.0\O0GNZM6J.N5O\OLM9ZD01.G4E\usbb..tion_105279151e79de17_0001.0000_83fb4bd7411a6291\Bootloader_Utils.dllFAST IO DISALLOWED
24:48.4USBBootloaderHost.exe8212FASTIO_ACQUIRE_FOR_SECTION_SYNCHRONIZATIONC:\Users\Jessi\AppData\Local\Apps\2.0\O0GNZM6J.N5O\OLM9ZD01.G4E\usbb..tion_105279151e79de17_0001.0000_83fb4bd7411a6291\Bootloader_Utils.dllFILE LOCKED WITH ONLY READERSSyncType: SyncTypeCreateSection, PageProtection: PAGE_EXECUTE_READ

I'm assuming the output you submitted was on a "non-working" system.

Can you send me the filtered output of a "working" system?  This might help to compare the two.   In the meanwhile, I'm looking into the "Results" for these calls.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
New Contributor II

Thank you Leo,

please find attached the full transaction on a working PC.

Please notice that the previous transaction I have only selected the transaction with a result different from SUCCESS.

Kind regards,

Francesco

0 Likes
Reply
Honored Contributor

Francesco,

I don't what's going on.  In the 'working' transaction, the path to "Bootloader_Utils.dll" never shows up.  But it does in the 'non-working' transaction.

I was hoping with the working and non-working transactions that I can see where the "train runs off the track" with an apples to slightly different apples comparison.   Instead between the two logs, I get apples and oranges.

Are you sure the working transaction is complete for the Process: USBBootloaderHost.exe?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
New Contributor II

Hi Len,

let me repeat the test.

Kind regards,

Francesco

0 Likes
Reply
Honored Contributor

Francesco,

I'm still working on the output and the results.

I'm noticing the "Path" to get to Bootloader_Utils.dll is VERY long.  There used to be a 255 character limit to the path under older Windows OSs.  I don't know if this limit still applies.

Is the non-working system a Windows server?   Some of the parts of the Path seem a bit abstract (ie. \O0GNZM6J.N5O\OLM9ZD01.G4E\ ).

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
New Contributor II

it's Windows 10 Home edition.

0 Likes
Reply
Honored Contributor

Francesco,

Let's go at this investigation a different way.

When the customer installed your SW, did it complain about anything during the install?  In the past, when I have created C# programs using Visual Studio and the Publish feature, I had NO PROBLEMS on my own development system to run or install the program.   However, on other systems, the install complained that there was no security certificate for some of the executables.

When it tried to run the SW for the first time, was there any warnings or notifications of a potential virus?  Sometimes virus checking programs might quarantine virus-suspected files.

Suggestion:  On the non-working computer, run your SW "USBBootloaderHost.exe" in "Run as Administrator" mode.  If Bootloader_Utils.dll is suspected of being virus-infected, the virus checking program might be silently preventing access.

Suggestion#2:  Uninstall the SW then reinstall as "Run as Administrator"

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
New Contributor II

I have forwarded your message to my customer.

I will try to disable the antivirus on my machine.

Kind regards,

Francesco

0 Likes
Reply
New Contributor II

Hi Len,

on machine with PSoC creator instralled, the USBBootloaderHost program works, while on machine without the PSoC Creator it won't work.

Is it possible that the issue is related to the fact that PSoC creator is not installed?

Thanks,

Francesco

0 Likes
Reply
Honored Contributor

Francesco,

It's HIGHLY possible.  However, it might be more of a problem PSoC Programmer.

When Creator is installed, PSoC Programmer is ALSO installed.

Suggestion:

On the non-working system, install PSoC Programmer.   If it works, then Programmer installs something (like an environment variable where Bootloader_Utils.dll path is loaded into the Registry).  Then you're done.

If it is the registry case, then search for "Bootloader_Utils.dll" the Registry on the system that works and note its location.

Search for the same thing on the non-working system.  If not found, add the Registry key you found on the working system to the non-working system to point the path to the install location of the dll.   You may have to reboot after this change but maybe that's all it takes.  

If this works, you may be able to modify the Publish feature of Visual Studio to include the path key to the Registry.  This will avoid future installs of PSoC Programmer.

Last resort if all else fails, install Creator.

The previous steps are to understand what went wrong without requiring the user to install a major program where they will only need 0.1% of it.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
New Contributor II

Hi Len,

I have installed PSoC Programmer on the Laptop that had the issue, and its still not working.

So its not that.

Any other idea?

Francesco

0 Likes
Reply
Honored Contributor

Francesco,

Did you compare the registry keys between the working and non-working systems?   You should be searching on "Bootloader_Utils.dll".

The last resort is to install Creator.

If either of the two ideas don't solve it, we're back to square one.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
New Contributor II

Hi Len,

I can see the path for the Bootloader_Utils.dll  in the regedit on both units

and I have installed PSoC creator in the not working, and still not working.

Francesco

0 Likes
Reply
Honored Contributor

Francesco,

It was an interesting (and frustrating) investigation.

We're back to square one.

Do you know who supplies Bootloader_Utils.dll?   If Cypress, they need to help us as to the minimum requirements for use.

Here's an out-of-the-blue suggestion:

On the non-working system, can you make a copy of the Bootloader_Utils.dll and paste it into the same directory as USBBootloaderHost.exe?

When you execute an app, it inherits the directory where the app is installed as the root working directory.   When the executable requires other programs, dlls or other files, it first looks in the wroking directory before resorting to other paths base on the linked PATH environment vars locally or globally.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
Honored Contributor
0 Likes
Reply
New Contributor II

Hi Len,

I'm going to check at this... in particular the Bootloader_Utils 64 bits!

Thanks

0 Likes
Reply
New Contributor II

I have tried the following:

1. build the unit for x86 and make sure we have NET 4.0

2. installed Visual Studio 2015 and build as above.

Still not working on not working machine...

Maybe I need to build from a 32 bit machine?

Can  anybody of you at Cypress build the project for me from a 32 bit machine?

The issue may be that...

Francesco

0 Likes
Reply
Moderator
Moderator

Hello Franceso,

Can you provide us details on replicating this issue? What is different on the machine that you were able to replicate in than the other machines where it worked.

Regards,

Dheeraj

0 Likes
Reply
New Contributor II

Hi DheerajK,

I'm not sure how to replicate the issue, on some machine works, while on other it doesn't.

I'm going to do some check that Len suggested me last time...

0 Likes
Reply
New Contributor II

Hi guys,

can someone have a look at the project please?

the project is heavily based on the original USBBootloader VC2015.

I have tried everything I can think of:

including rebuild on VC 2015 edition, try to generate code for 32 bit machine, etc.

I have built the distribuition on  64 bit machine (and it works)... it doesn't work on other 64 bit machines...

Kind regards,

Francesco

0 Likes
Reply
Honored Contributor

Francesco,

I downloaded your USBBootloaderHost.   It compiled with no error.

When I run the app and supply a valid Bootloadable program (.cyacd file) it indicates Li11264 state: Disconnected.

"Program" doesn't work.

pastedImage_0.png

What do I need to do to try to reproduce your results?  Is your Bootloader Host looking for a specific VID and PID?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
New Contributor II

Hi Len,

it's because you need the unit.

I can ask my customer to send one prototype to you, would this be OK with you?

Kind regards,

Francesco

0 Likes
Reply
Honored Contributor

Francesco,

Sure.  However, sometimes all that needs to be done to emulate the system is to alter the part of the program that requires the "special sauce".  Or bypass the requirement for the "special sauce".   The goal here is to see if my system complains about the USBBootloader_Utils.dll could not be found.  To do that it just needs to proceed to the next step to allow me to start Bootloading the selected .cyacd file.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply
New Contributor II

Hi Len,

the Software works as follow:

1. check if the VID=0xCDAB  PID= 0x7 are the one expected.

2. load the new cyad program

3. write the command "GO TO BOOTOLADER"

4. reprogram the unit if the new VID= 0xCDAB PID = 0x08

I'm more than happy to create a project  for the CY8CKIT-059 (if you have some around you).

Kind regards,

Francesco

0 Likes
Reply
Honored Contributor

Francesco,

The CY8CKIT-059 is my preferred kit.  (You can't beat the cost and value).

Let me try your suggestions first.   If stuck, I'll ask for a demo project.

Changing the

VID=0xCDAB  PID= 0x7

in the Bootloader project s trivial.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Reply