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

cross mob
inja_4756821
Level 2
Level 2
Distributor
25 sign-ins First like received First solution authored

Dear experts,

I have a question regarding OPENOCD CLI.

All other functions have been implemented,

but the part related to External Memory Erase & Programming is not working well.

Can I get help on how to use External serial memory (SMIF)?

 

The below log is excerpted from cypress programmer.

----------------------------------------------------------------------------------

Warn : Adding extra erase range, 0x18019000 .. 0x1803ffff

Info : [100%] [################################] [ Erasing ]

Info : [100%] [################################] [ Programming ]

Info : wrote 604160 bytes from file C:/firmware1.hex in 8.338982s (70.752 KiB/s)

 

Info : ** Erasing bank 8 **

Info : Using EraseChip API to erase 'psoc6_smif1_cm0' bank, this may take several minutes...

------------------------------------------------------------------------------------------------------------------------------------------

0 Likes
1 Solution
inja_4756821
Level 2
Level 2
Distributor
25 sign-ins First like received First solution authored

I Solved the this issue.

Hope this helps someone.

PSoC61 (CM4 Only Version)

1. Internal Flash Erase

openocd -c "set ENABLE_CM0 0; source [find kitprog3.cfg]; source [find psoc6_internal.cfg]; transport select swd; cmsis_dap_serial 190E03B803260400; init; reset init; psoc6 sflash_restrictions 1; flash probe 0; flash probe 1; flash probe 2; flash probe 3; psoc6 allow_efuse_program off; flash banks; erase_all; shutdown"

2 . Internal Flash Program

openocd -c "set ENABLE_CM0 0; source [find kitprog3.cfg]; source [find psoc6_internal.cfg]; transport select swd; cmsis_dap_serial 190E03B803260400; init; psoc6 sflash_restrictions 1; psoc6 allow_efuse_program off; program d:/firmware.hex verify reset exit"

3. External Flash Program

openocd -c "set ENABLE_CM0 0; source [find kitprog3.cfg]; source [find psoc6_external.cfg]; transport select swd; cmsis_dap_serial 190E03B803260400; init; psoc6 sflash_restrictions 1; psoc6 allow_efuse_program off; program d:/firmware.hex verify reset exit"

BR 

IK

 

View solution in original post

0 Likes
3 Replies
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @inja_4756821 

Can you please refer to this PDF to understand how to use External serial memory (SMIF) and check if this helps? Also, please go through the PSoC 6 Peripheral Driver Library to know more about external memory erase & programming.

Thanks and Regards,
Leo

0 Likes
inja_4756821
Level 2
Level 2
Distributor
25 sign-ins First like received First solution authored

Hi Leo,

Thank you for reply.

Information on SMIF R/W is already known and applied to the project.

What I want to know is that if you look at the Cypress Programmer, you can Download or Erase to External Flash. Internal works well through OPENOCD Example as shown below.

openocd -s ../scripts -f interface/kitprog3.cfg -f target/psoc6.cfg -c "transport select swd; cmsis_dap_serial 190E03B803260400; psoc6 sflash_restrictions 1; init; reset init; program c:/firmware.hex verify reset exit" 

inter1.jpginter2.jpg

I would like to know the command for downloading to external memory.

openocd -s ../scripts -f interface/kitprog3.cfg -f target/psoc6.cfg -c "?????????????; exit" 

cypress_programmer.jpg

0 Likes
inja_4756821
Level 2
Level 2
Distributor
25 sign-ins First like received First solution authored

I Solved the this issue.

Hope this helps someone.

PSoC61 (CM4 Only Version)

1. Internal Flash Erase

openocd -c "set ENABLE_CM0 0; source [find kitprog3.cfg]; source [find psoc6_internal.cfg]; transport select swd; cmsis_dap_serial 190E03B803260400; init; reset init; psoc6 sflash_restrictions 1; flash probe 0; flash probe 1; flash probe 2; flash probe 3; psoc6 allow_efuse_program off; flash banks; erase_all; shutdown"

2 . Internal Flash Program

openocd -c "set ENABLE_CM0 0; source [find kitprog3.cfg]; source [find psoc6_internal.cfg]; transport select swd; cmsis_dap_serial 190E03B803260400; init; psoc6 sflash_restrictions 1; psoc6 allow_efuse_program off; program d:/firmware.hex verify reset exit"

3. External Flash Program

openocd -c "set ENABLE_CM0 0; source [find kitprog3.cfg]; source [find psoc6_external.cfg]; transport select swd; cmsis_dap_serial 190E03B803260400; init; psoc6 sflash_restrictions 1; psoc6 allow_efuse_program off; program d:/firmware.hex verify reset exit"

BR 

IK

 

0 Likes