|
Updating with more information.
In the previous post, I wrote this:
"Then, if I disconnect the USB cables for the MiniProg3 and the board I'm working on (USB is power source), and close all Cypress programs and my Visual Studio project, and then reconnect the cables and open up my project (but not Cypress' programs), then it does not work again."
This is half true. Disconnecting the board power will start the failures once again. However, disconnecting the MiniProg3 from the PC has no effect. I can connect both the board and Miniprog3, issue an "Erase All" command from PSoC Programmer, then program the device with my application successfully, then disconnect the MiniProg3, attach a different MiniProg3, and program again. But disconnecting the power from the board will cause it to start failing again even with the same MiniProg3.
I suspect that maybe I am not initializing all settings in the programming chain correctly, but at the same time, the program works without modification, just AFTER running PSoC Programmer.
I will list the programming process below, if I am missing anything or doing something wrong, please let me know.
Start up COM
OpenPort();
pp.SetPowerVoltage("3.3");
pp.PowerOn();
pp.SetProtocol(enumInterfaces.SWD);
pp.SetProtocolConnector(1); // 10 pin connector
pp.SetProtocolClock(enumFrequencies.FREQ_03_0); // 3.0MHz
pp.HEX_ReadFile(filePath);
pp.SetAcquireMode("Reset");
pp.DAP_AcquireChip();
pp.PSoC3_EraseAll();
//Write flash arrays
pp.PSoC3_GetSonosArrays(enumSonosArrays.ARRAY_FLASH)
loop for each flash array
{
pp.PSoC3_GetFlashArrayInfo(arrayID);
loop for each row
{
array1 = pp.HEX_ReadData(flashProgrammed, rowSize, out raw, out m_sLastError);
array2 = pp.HEX_ReadConfig(configProgrammed, 32, out raw, out m_sLastError);
if(array1 and array2 are all zero)
skip programming
else
pp.PSoC3_ProgramRowFromHex(arrayID, rowID);
}
}
and then programming-unrelated checksum stuff, release chip, power off, close port
I error check after each call to the PP_COM.
|