Unable to reprogram CY8CPROTO-062-4343W

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
LiDo_2439176
Level 5
Level 5
First question asked 50 replies posted 50 sign-ins

Hi,

I tested aws_demos example following getting started without any configuration.
It's obviously example are not running properly. But my problem is that I cannot reprogram my board.
I used the version of Amazon FreeRTOS from Cypress’ GitHub repository as it is whitout any modifications.
I use ModusToolbox 2.1 under Windows 10 Pro x64.
Bellow is the log from Cypress Programmer when I'm trying to connect.

Info : [CyBridge] Start API initialization
Info : [CyBridge] Connected - KitProg3 CMSIS-DAP BULK-20110C1C02179400
Info : [CyBridge] Hardware initialization complete (695 ms)
Info : Selected Device: CY8CPROTO-062-4343W-20110C1C02179400
Info : ** Probe-config: kit_CY8CPROTO-062-4343W.cfg
Info : Open On-Chip Debugger 0.10.0+dev-2.2.0.249 (2019-09-10-10:57)
Info : Licensed under GNU GPL v2
Info : For bug reports, read
Info :  http://openocd.org/doc/doxygen/bugs.html
Info : debug_level: 2
Info : C:/Program Files (x86)/Cypress/Cypress Programmer
Info : ./openocd
Info : C:/Program Files (x86)/Cypress/Cypress Programmer/BT
Info : 20110C1C02179400
Info : 1:1
Info : 0
Info : swd
Info : soft
Info : off
Info : 0
Info : adapter speed: 1500 kHz
Info : serial:    20110C1C02179400
Info : transport: swd
Info : rst type:  soft
Info : efuse:     off
Info : sflash restrict: 0
Info : adapter speed: 1000 kHz
Info : ** Auto-acquire enabled, use "set ENABLE_ACQUIRE 0" to disable
Info : cortex_m reset_config sysresetreq
Info : cortex_m reset_config vectreset
Info : none separate
Info : SFlash programming disallowed, see 'sflash_restrictions' command
Info : init_target
Info : tcl server disabled
Info : Listening on port 4445 for telnet connections
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : VTarget = 3.239 V
Info : kitprog3: acquiring PSoC device...
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x6ba02477
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0xe000ed00
Info : Polling target psoc6.cpu.cm0 failed, trying to reexamine
Info : SWD DPIDR 0x6ba02477
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0xe000ed00
Info : Examination failed, GDB will be halted. Polling again in 100ms
Info : Polling target psoc6.cpu.cm0 failed, trying to reexamine
Info : SWD DPIDR 0x6ba02477
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0xe000ed00
Info : Examination failed, GDB will be halted. Polling again in 300ms
Info : Listening on port 3333 for gdb connections
Info : Open On-Chip Debugger
Info : init_target
Info : ***************************************
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0x16000000
Info : mem2array: Read @ 0x16000000, w=4, cnt=1, failed
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0x16002004
Info : mem2array: Read @ 0x16002004, w=4, cnt=1, failed
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0x402020c4
Info : mem2array: Read @ 0x402020c4, w=4, cnt=1, failed
Error: C:/Program Files (x86)/Cypress/Cypress Programmer/./openocd/scripts/target/psoc6_common.cfg:270: Error:
Error: in procedure 'init_target'
Error: in procedure 'ocd_process_reset'
Error: in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 244
Error: in procedure 'cy_get_set_device_param'
Error: in procedure 'show_chip_protection' called at file "C:/Program Files (x86)/Cypress/Cypress Programmer/./openocd/scripts/target/cy_get_set_device_param.cfg", line 178
Error: in procedure 'mrw' called at file "C:/Program Files (x86)/Cypress/Cypress Programmer/./openocd/scripts/target/cy_get_set_device_param.cfg", line 135
Error: at file "C:/Program Files (x86)/Cypress/Cypress Programmer/./openocd/scripts/target/psoc6_common.cfg", line 270
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0xe000ed00
Info : SWD DPIDR 0x6ba02477
Info : SWD DPIDR 0x6ba02477
Info : AP write error, reset will not halt
Info : SWD DPIDR 0x6ba02477
Info : SWD DPIDR 0x6ba02477
Error: in procedure 'init_target'
Info : SWD DPIDR 0x6ba02477
Info : Polling target psoc6.cpu.cm0 failed, trying to reexamine
Info : SWD DPIDR 0x6ba02477
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0xe000ed00
Info : Examination failed, GDB will be halted. Polling again in 700ms
Error: cyp status: ERROR
Error: C:/Program Files (x86)/Cypress/Cypress Programmer/./scripts/PSoC6/cpu_CY8CPROTO-062-4343W.cfg:27: Error:
Error: in procedure 'init_target'
Error: at file "C:/Program Files (x86)/Cypress/Cypress Programmer/./scripts/PSoC6/cpu_CY8CPROTO-062-4343W.cfg", line 27

Is there a way to recover the board ?
I don't understand what I did wrong.

Thank you for your support,
Liviu

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

Hi Rakshith,

attached you will find project and hex file.

1. Before this project I tested all examples for CY8CPROTO-062-4343W from ModusToolbox 2.0.
   Even debugging some examples to practice breakpoints, watchpoints, etc. No problems.
2. I upgrade the Kitprog 3 since the beginning. I tried all modes: CMSIS-DAP Bulk, CMSIS-DAP HID and DAPLink.
   No problems. After aws_demos I tried Kitprog 3, Kitprog 2 without success. If I try DAPLink mode by pressing
   mode switch button it return to CMSIS DAP bulk after a few seconds. Even with fw_loader it can't be switched
   in DAPLink mode.
3. No, I don't have Miniprog4. Instead I soldered a 10 pins SWD connector and I used J-link EDU Mini.
   Some problem. It cannot connect to target.
   With the help of Jlink utility I read the CSW register from the three AHB_AP.
   It seems that DeviceEn is 0. I believe this is the problem.
4. No because I didn't use the external power supply.
5. Yes. To CY8CKIT-062-BLE. I was able to connect even to this board until aws_demos.
   Cypress Programmer 2.1.0 build 226.
6. Yes.

cyp-4343w.png

Thank you very much for your help,

Liviu  

View solution in original post

0 Likes
18 Replies
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi LiDo_2439176​,

I was unable to reproduce the same issue. Although I do not think this issue is because of the program that was loaded into the kit can you still share the project and the hex file that was programmed into the device so that I can give it a try?

According to the log, the device is detected but the KitProg is not able to communicate with it. KitProg3 is detected, KitProg3 is in BULK mode, the target is detected, the target power is read properly. I also tried connecting the device with the same configurations that are in the log and I am able to connect to the device.

1. Were you able to program the device properly with other hex files before the project was programmed?

2. Can you upgrade the KitProg3 firmware and try connecting to the device?

3. Do you have a MiniProg4 that you can use to connect to the device?

4. At any point was the device connected to a supply greater than 3.6 V?

5. Can you connect to other devices using Cypress programmer? Can you tell me the version of Cypress Programmer that you are using?

6. Can you please share the screenshot of Cypress Programmer when the error occurs?

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes
lock attach
Attachments are accessible only for community members.

Hi Rakshith,

attached you will find project and hex file.

1. Before this project I tested all examples for CY8CPROTO-062-4343W from ModusToolbox 2.0.
   Even debugging some examples to practice breakpoints, watchpoints, etc. No problems.
2. I upgrade the Kitprog 3 since the beginning. I tried all modes: CMSIS-DAP Bulk, CMSIS-DAP HID and DAPLink.
   No problems. After aws_demos I tried Kitprog 3, Kitprog 2 without success. If I try DAPLink mode by pressing
   mode switch button it return to CMSIS DAP bulk after a few seconds. Even with fw_loader it can't be switched
   in DAPLink mode.
3. No, I don't have Miniprog4. Instead I soldered a 10 pins SWD connector and I used J-link EDU Mini.
   Some problem. It cannot connect to target.
   With the help of Jlink utility I read the CSW register from the three AHB_AP.
   It seems that DeviceEn is 0. I believe this is the problem.
4. No because I didn't use the external power supply.
5. Yes. To CY8CKIT-062-BLE. I was able to connect even to this board until aws_demos.
   Cypress Programmer 2.1.0 build 226.
6. Yes.

cyp-4343w.png

Thank you very much for your help,

Liviu  

0 Likes

Hi RakshithM_16​,

I forgot to mention that in parallel is installed ModusToolbox 2.0 in C:\ModusToolbox_2.0
ModusToolbox 2.1 is is in C:\ModusToobox_2.1 and
CY_TOOLS_PATHS=C:/ModusToolbox_2.0/tools_2.0
I omitted to change this system variable to point to ModusToolbox 2.1
I still don't know if I've missed anything else.

Thanks,
Liviu

0 Likes

Hi LiDo_2439176​,

I tried programming the hex file that you have shared and I am still able to connect to the device. Can you please try the following steps and let me know the results?

1. Can you please let us know how the KitProg is enumerated in your Device Manager? Can you please share a screenshot of the same?

    It should be enumerated as shown -

pastedImage_0.png

2. Can you program Hello World project using ModusToolbox 2.1 with the right tool path mentioned?

3. Reinstall Cyppress Programmer.

Please let me know the results.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes
lock attach
Attachments are accessible only for community members.

Hi RakshithM_16​,

1.

kitprog3.png

2. No, I attached the full log.

log.png
3. I did it. Nothing new.

As i mention above DeviceEn is 0.
I have no ideea what I did wrong but chip debug protection is activated.
OpenOCD cannot deal with this situation.
Any ideea to simply erase the chip ?

Thanks and regards,

Liviu

0 Likes

Hi LiDo_2439176​,

I received an update from our internal team and as you mentioned there is no access to both cores, and debug registers are not available. Our internal team is working on this issue.

Can you please let us know the following things to help us understand the root cause of the issue?

     1. If another CY8CPROTO-062-4343W is available, can you please repeat the steps and let us know if the issue is reproducible?

     2. Can you please let us know if you have updated/changed the Launch Configurations in ModusToolbox 2.1 in any way?

     3. Were the Run Configurations in MTB 2.1 modified?

     4. If the answer to 2 or 3 is yes, can you please walk us through the changes that were made?

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes

Hi RakshithM_16​,

I think I have found the cause.
Usually I press the reset button immediately after chip programming.

(This picture is only for example)

endprog.png

Now I am pretty sure I pressed the reset button too quickly in the range in the picture above.
It is the only explanation.
I am sorry I did not realize this from the beginning. I have not seen any error message and the aws_demos run as expected.

Thank you very much for your support,

Liviu

0 Likes

Hi LiDo_2439176​,

Glad your issue is resolved.

But I do not think I understood the issue entirely. I have enlisted the sequence of steps to follow to recreate the issue. Can you please correct me if I am wrong?

1. Program the device.

2. Press the reset button before the programming process is completed.

3. Try to connect to the device using Cypress Programmer.

I tried the following steps and I am still able to connect to the device so I am guessing that this is not what happened. Can you please provide the steps to reproduce this issue so that we can avoid this issue in the future?

Also, how were you able to connect to the device later to program the device?

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes
lock attach
Attachments are accessible only for community members.

Hi RakshithM_16​,

These are last steps before the problem occurs:

1. Program the device ( pressed aws_demos Program (KitProg3) button )
2. Press the reset button before the programming process is completed.
3. Check serial communication messages (aws_demo messages). Ok.
4. Debug program ( pressed aws_demos Debug (KitProg3) button ). Problem Occured. I attached the log.
5. Try to connect to the device using Cypress Programmer. Error: Failed to connect to the target device.

I still unable to connect to the device. I thought I found the cause. Not the solution.

Thanks and regards,

Liviu

0 Likes

Liviu,

Is it possible that the SW3 (Mode) was pressed on the KitProg3 section of the kit?

I've selected that button thinking it was like the Reset switch on KitProg boards (such as CY8CKIT-059) and unintentionally found that the KitProg3 was switched into a different mode.  When I try to access it by programming or debugging it doesn't seem to respond.

I cycle through the SW3 to get to the proper mode then it finally responds to programming requests.

Maybe this will help.

Len

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

Hi Len,

No. On this kit the SW3 button is very well located. It is hard to press unintentionally.

Thanks you,

Liviu

0 Likes

Hi LiDo_2439176, LePo_1062026​​,

Thank you for the updates.

LePo_1062026​, I did try connecting to the device with reset button pressed but the error is "failed to acquire PSoC device". I also tried with all 3 KP3 modes but I was not able to reproduce this issue.

LiDo_2439176​, I followed the same steps a multiple times and I still could not reproduce the issue. At one point the connection to the Kit failed but I was still able to connect back to the device. However, I have forwarded your response to our internal team. The only way to connect to the device is via SysAP but OpenOCD does not have that functionality. We are working on a script to connect back to the device. I will provide an update on this thread as soon as I receive the script from the internal team.

Meanwhile, can you please let me know if you are able to reproduce the same issue in another CY8CPROTO-062-4343W kit?

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes

Hi RakshithM_16​,

I don't have another CY8CPROTO-062-4343W. I shall wait for the script.

Thanks and regards,

Liviu

0 Likes

Hi LiDo_2439176​,

Can you please share the following files -

1. psoc6_2m.cfg - <mtb2.1_installation directory>\tools_2.1\openocd\scripts\target

2. psoc6_common.cfg - <mtb2.1_installation directory>\tools_2.1\openocd\scripts\target

3. psoc6_2m_secure.cfg - <mtb2.1_installation directory>\tools_2.1\openocd\scripts\target

4. kitprog3.cfg - <mtb2.1_installation directory>\tools_2.1\openocd\scripts\interface

Also can you please share the MTB launch configurations of the aws_demos project that you used? You can find them by right clicking on the project > Run As > Run Configurations.

In the Run Configurations window select GDB OpenOCD Debugging > <project_name> Program (KitProg3).

Click on the Debugger tab and copy all the commands in the Config options: text box.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes
lock attach
Attachments are accessible only for community members.

Hi RakshithM_16​,

below are the required files and configuration.

Thanks and regards,

Liviu

0 Likes
lock attach
Attachments are accessible only for community members.

Hi LiDo_2439176​,

Could you please dump contents of SFlash and eFuses (if possible)?

This can be done with the following script: dump_sflash_efuse.tcl (attached with this response).

  • Ensure that the path to script does not contain any special characters or space characters.
  • Run cmd.exe and navigate to the openocd installation directory (C:\ModusToobox_2.1\tools_2.1\openocd)
  • Execute the following command: bin\openocd.exe -s scripts -f <path_to_dump_sflash_efuse.tcl_file>
  • The script will attempt to dump SFlash and eFuse contents in the most non-invasive way via SysAP. There is no guarantee that the script will work, but in case of success it will create two files in the openocd directory: sflash.bin and efuse.bin

I tried it my system and here is the cmd log -

pastedImage_5.png

In the openocd directory efuse.bin and sflash.bin files are created and I have attached those files for your reference.

Please perform the same steps and let us know your observations. Please copy the cmd log to a text file and attach the log with your response. If the script succeeds then please attach the efuse.bin and sflash.bin files to the thread.

Let me know if you have any queries.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes
lock attach
Attachments are accessible only for community members.

Hi RakshithM_16​,

the script runs without success.

Thank you very much,

Liviu

0 Likes

Hi LiDo_2439176​,

You will be contacted by a Cypress representative regarding this issue.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes