3 Replies Latest reply on Dec 18, 2019 2:16 AM by RaktimR_11

    ST-Link with Sterling EWB

    JoBu_4538421

      Hello,

       

      I'm trying to use an ST-Link V2 with my Sterling EWB development board.

       

      board part number: 455-00030

      SDK Version: WICED-SDK Version: Wiced_006.004.000.0061

       

      I followed the instructions here:

       

      https://community.cypress.com/community/wiced-wifi/wiced-wifi-forums/blog/2018/10/10/adding-st-link-support-in-wiced

       

      But I haven't been able to successfully download to the board with the ST-Link.

       

      Is it possible to use the ST-Link with the sterling ewb? What should I use as a custom JTAG macro? Do I need to write my own .cfg file? Could one be provided?

       

      Please let me know if you need any more information.

       

      Thanks!

        • 1. Re: ST-Link with Sterling EWB
          RaktimR_11

          I don't have perfect idea about the sterling ewb, so my suggestions might not be perfectly aligned with your issue.

           

          I am assuming that you are trying to use external ST-Link dongle to directly download to the JTAG of ST host (or maybe the FTDI chip is replaced by st-link). For that in the blog post, I have mentioned to use a custom .cfg file which you have to define based on the ST host. It would be a good idea to  source target/stm32f4x.cfg [located in 43xxx_Wi-Fi/tools/OpenOCD/scripts/] inside your custom.cfg file.

           

          When you say you have not been able to successfully download to the board, where exactly you see the error, in CDT console or the program fails to run? Check the 43xxx_Wi-Fi/build/openocd_log.txt to find out what OpenOCD is complaining about exactly and that should help you with further debug.

          • 2. Re: ST-Link with Sterling EWB
            JoBu_4538421

            Hi,

             

            Thank you for your response.

             

            Your assumption is correct. The development board has a JTAG port that I'm directly connecting my ST-Link into.

             

            One of the issues I'm running into is the OpenOCD complaining about files not being able to be found. For example, after moving the "WICED_changes" files into the WICED-Studio-6.4\43xxx_Wi-Fi\tools directory and then trying to download to the board, the OpenOCD log shows this:

             

            Open On-Chip Debugger 0.10.0+dev-00227-g0d15c62 (2018-03-27-15:19)

            Licensed under GNU GPL v2

            For bug reports, read

                http://openocd.org/doc/doxygen/bugs.html

            trst_and_srst separate srst_nogate trst_push_pull srst_open_drain connect_assert_srst

            ./tools/OpenOCD/stm32f4x.cfg:1: Error: Can't find swj-dp.tcl

            in procedure 'script'

            at file "embedded:startup.tcl", line 60

            at file "./tools/OpenOCD/stm32f4x.cfg", line 1

            Open On-Chip Debugger 0.10.0+dev-00227-g0d15c62 (2018-03-27-15:19)

            Licensed under GNU GPL v2

            For bug reports, read

                http://openocd.org/doc/doxygen/bugs.html

            trst_and_srst separate srst_nogate trst_push_pull srst_open_drain connect_assert_srst

            ./tools/OpenOCD/stm32f4x.cfg:1: Error: Can't find swj-dp.tcl

            in procedure 'script'

            at file "embedded:startup.tcl", line 60

            at file "./tools/OpenOCD/stm32f4x.cfg", line 1

            Open On-Chip Debugger 0.10.0+dev-00227-g0d15c62 (2018-03-27-15:19)

            Licensed under GNU GPL v2

            For bug reports, read

                http://openocd.org/doc/doxygen/bugs.html

            trst_and_srst separate srst_nogate trst_push_pull srst_open_drain connect_assert_srst

            ./tools/OpenOCD/stm32f4x.cfg:1: Error: Can't find swj-dp.tcl

            in procedure 'script'

            at file "embedded:startup.tcl", line 60

            at file "./tools/OpenOCD/stm32f4x.cfg", line 1

            Open On-Chip Debugger 0.10.0+dev-00227-g0d15c62 (2018-03-27-15:19)

            Licensed under GNU GPL v2

            For bug reports, read

                http://openocd.org/doc/doxygen/bugs.html

            trst_and_srst separate srst_nogate trst_push_pull srst_open_drain connect_assert_srst

            ./tools/OpenOCD/stm32f4x.cfg:1: Error: Can't find swj-dp.tcl

            in procedure 'script'

            at file "embedded:startup.tcl", line 60

            at file "./tools/OpenOCD/stm32f4x.cfg", line 1

            Open On-Chip Debugger 0.10.0+dev-00227-g0d15c62 (2018-03-27-15:19)

            Licensed under GNU GPL v2

            For bug reports, read

                http://openocd.org/doc/doxygen/bugs.html

            trst_and_srst separate srst_nogate trst_push_pull srst_open_drain connect_assert_srst

            ./tools/OpenOCD/stm32f4x.cfg:1: Error: Can't find swj-dp.tcl

            in procedure 'script'

            at file "embedded:startup.tcl", line 60

            at file "./tools/OpenOCD/stm32f4x.cfg", line 1

             

            Am I going to have to largely modify stm32f4x.cfg to get this to work?

             

            Thanks,

            John

            • 3. Re: ST-Link with Sterling EWB
              RaktimR_11

              No you should not have to largely modify the stm32f4x.cfg. Since the underlying connection is JTAG, you should be able to largely use the existing WICED openocd infrastructure.

              1. Please add a custom .cfg file in 43xxx_Wi-Fi/tools/OpenOCD; maybe named as st-link.cfg. If it is st-link v2.1 you can populate the st-link.cfg with
              interface hla
              hla_layout stl
              hla_device_desc "ST-LIinkNK/V2-1"
              hla_vid_pid 0x0483 0x374b
              source [find target/stm32f4x.cfg]
              

               

              2. In your sterling platform makefile, please add JTAG = st-link (chosen based on the naming convention shown in step 1) which should source the default stm32f4x.cfg shipped with openocd release and can be located inside at WICED at 43xxx_Wi-Fi/tools/OpenOCD/scripts/target/stm32f4x.cfg. To debug whether WICED is picking up this specific .cfg file instead of the default one, you can add some dummy echo statements in the 43xxx_Wi-Fi/tools/OpenOCD/scripts/target/stm32f4x.cfg file.

              echo "rroy debug"
              

               

              3. If you are following all the above mentioned steps along with the attached standard_platform_targets.mk file from the blog-post where you need to replace stm32f469discovery with st-link, you should not see the last error which is simply complaining about not being able to find the tcl script which is necessary to create the TAP.

               

              #pro tip: Always check the openocd_log.txt generated in the Build folder and see what it is complaining about. May be you can see some macros undefined in the default stm32f4x.cfg which you might need to modify with the WICED specific macros as found in 43xxx_Wi-Fi/tools/OpenOCD/stm32f4x.cfg

              1 of 1 people found this helpful