- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I can program a hex file with a MiniProg3 and its GUI application as attached picture shows.
Then I followed the sample code in "C:\Program Files (x86)\Cypress\Programmer\Examples\Programming\PSoC3_5\SWD\C_Sharp", if I run this sample code directly without any changes, the prompt tells me:
"Failed! PSoC device is not acquired! Check connection of the chip to the programmer"
So I change the code with the settings on the GUI application, Below is the code of setting part in ProgramAll() function:
Mainly I have many issues on:
1. The prompt tells me "Failed! Device is not in ISSP mode"
2. CheckHexAndDeviceCompatibility() function could not pass.
3. EraseAll() function is unable to run.
4. Sometime I change the "Power" mode to "Power Cycle", sometimes I change the function from xxx() to PsoC3_xxx() if I found there is one, but it still could not work. Anyone know what's wrong there? Thanks!
Code:
if (pp == null) return -1;
string filePath = "E:/Projects/X2/CRTS-XRAY-XPS-Bootloader-v3.2.hex";
int hr;
//Port Initialization
//Setup Power - "5.0V" and internal
hr = pp.SetPowerVoltage("0.5", out m_sLastError);
if (!SUCCEEDED(hr)) return hr;
hr = pp.PowerOn(out m_sLastError);
if (!SUCCEEDED(hr)) return hr;
//Set protocol, connector and frequency
hr = pp.SetProtocol(enumInterfaces.SWD, out m_sLastError); //SWD-protocol
if (!SUCCEEDED(hr)) return hr;
hr = pp.SetProtocolConnector(0, out m_sLastError); //5-pin connector
if (!SUCCEEDED(hr)) return hr;
hr = pp.PSoC3_SetProtocolClock(enumFrequencies.FREQ_01_6, out m_sLastError); //3.0 MHz clock on SWD bus
// Set Hex File
int hexImageSize;
hr = pp.HEX_ReadFile(filePath, out hexImageSize, out m_sLastError);
if (!SUCCEEDED(hr)) return hr;
//Set Acquire Mode
pp.SetAcquireMode("Power", out m_sLastError);
//The "Programming Flow" proper
//Acquire Device
//hr = pp.DAP_Acquire(out m_sLastError);
hr = pp.DAP_Acquire(out m_sLastError);
if (!SUCCEEDED(hr)) return hr;
//Check Hex File and Device compatibility
//bool fCompatibility;
//hr = CheckHexAndDeviceCompatibility(out fCompatibility);
//if (!SUCCEEDED(hr)) return hr;
//if (!fCompatibility)
//{
// m_sLastError = "The Hex file does not match the acquired device, please connect the appropriate device";
// return -1;
//}
//Erase All
hr = pp.EraseAll(out m_sLastError);
if (!SUCCEEDED(hr)) return hr;
Solved! Go to Solution.
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since, you are trying to program CY8C4125AZI-483, which is PSoC4 device, you are supposed to use C# example provided in folder ..\Cypress\Programmer\Examples\Programming\PSoC4\SWD\C_Sharp\C_Sharp. Are you using the correct C# example ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Are you powering the board externally or by miniprog3.?
Thanks,
Hima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am working with MiniProg 3 and with CY8CKIT_059 PSoC 5L Kit Prog. Al devices are good working with "PSOC Pogramrmer". I would like to study C# examples from C:\Program Files (x86)\Cypress\Programmer\Examples\Programming\PSoC3_5\SWD\C_Sharp but I have got some of error messages. I placed into "HEX-file" folder "Design12.hex" file - the same file I used for successfully programming using "PSOC Pogramrmer". First message is "The hex file does not match to acquired device.....". If I tried to avoid this point using debugger, the next message is "This PSoC device doesen't support PSOC3_EraseAll() API". I have got the same results in both devices - MiniProg 3 and with CY8CKIT_059 PSoC 5L Kit Prog. I am novice at C# and COM and I would be glad of any advices for solving of my problems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, can you read the device ID so that we can confirm why it mismatched with hex file ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since, you are trying to program CY8C4125AZI-483, which is PSoC4 device, you are supposed to use C# example provided in folder ..\Cypress\Programmer\Examples\Programming\PSoC4\SWD\C_Sharp\C_Sharp. Are you using the correct C# example ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not PSoC3_5\SWD
Go to
PSoC4\SWD\
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is working! Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
do you have C# example to communicate with usb? can you give me one? thank you very much
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please have a look at the application Note http://www.cypress.com/documentation/application-notes/an82072-psoc-3-and-psoc-5lp-usb-general-data-...
Thanks,
Hima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you would like use SWD interface you can find some of c# examples into documents "PSoC Programmer COM User Guide" The place of this document is as usually is: "C:\Program Files (x86)\Cypress\Programmer\Documents" if the "PSoC Programer" software is installed on your PC