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

cross mob
JMZorko
Level 1
Level 1
First reply posted First question asked Welcome!

Hello, all ... I hope i'm posting this in the correct place.

I'm trying to use the Cypress version of openocd (the one included with Cypress Programmer) to flash and run firmware to a PSoC6 board via a MiniProg4. While the flash works well enough (i.e. "program c:\\myhexfile.hex exit"), whenever I try to run the fw ("init; reset run") the fw does not run until I manually press the reset button on the board. Once I do this, "init; reset run" works.

If I use PSoC Programmer to flash the board, everything is fine and the fw runs after the flashing is complete. I'd really like to use openocd, though, as it's a bit easier to script than PSoC Programmer. The intent behind all of this is to automate the flash / run as part of a continuous integration / source code commit check (which is why the need to manually press the reset button is an issue).

Any help would be quite appreciated!

Regards,

John

 

0 Likes
1 Solution
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @JMZorko 

The problem was with the ("init;reset run") command , can you please change it to  "verify reset exit"

The following is an example of  the command:-

Openocd -s ..\scripts -f interface\kitprog3.cfg -f target\psoc6.cfg -c "program <userHexFile> verify reset exit"

Please refer to page 24 of the Cypress OpenOCD CLI User Guide document for more details on this.

Warm Regards
Gautami J

View solution in original post

0 Likes
4 Replies
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @JMZorko 

The problem was with the ("init;reset run") command , can you please change it to  "verify reset exit"

The following is an example of  the command:-

Openocd -s ..\scripts -f interface\kitprog3.cfg -f target\psoc6.cfg -c "program <userHexFile> verify reset exit"

Please refer to page 24 of the Cypress OpenOCD CLI User Guide document for more details on this.

Warm Regards
Gautami J

0 Likes
JMZorko
Level 1
Level 1
First reply posted First question asked Welcome!

Guatami,

That was one of the first things I tried when reading the openocd manual. Basically, "program <hexfile> verify reset exit" does not reset the board, which led to me reading more about the reset command and trying "reset run", which also does not work. In both of these cases and versions of the "reset" command, the board did not reset and the fw did not start running until I manually pressed the reset button.

However, I found that if I did the flashing first with openocd (program <hexfile>") and then script ppcli to OpenPort <miniprog4 port> / SetAcquireMode "Reset" / DAP_Acquire, the board did reset and the fw starts running as expected. So, i'm left wondering why the openocd "reset" command fails and the old ppcli works. Thoughts? Does this point to something amiss with my hardware or some other configuration error?

Regards,

John

 

 

0 Likes
JMZorko
Level 1
Level 1
First reply posted First question asked Welcome!

Actually, it seems like it might be an issue related to our firmware. If I use "program <hexfile> verify reset" to flash a debug .hex file via openocd, the board is automatically reset after the operation. If I use a release version, it's not.

0 Likes
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @JMZorko 

We took a simple  program called Blinky led  , we tried both  build configurations - release and debug, in openocd . In both the cases the onboard led blinked without pressing reset button after programming the same from cmd.

It might be a problem with your firmware as you told , can you pls send a sample code of your firmware where you are facing this problem so we can debug the same on our end.


Warm regard's,
Gautami J

 

0 Likes