Help: Error while attempting to flash Smoothieware

902 views
Skip to first unread message

Brady Bowerbank

unread,
Jun 2, 2023, 2:30:23 PM6/2/23
to OpenPnP
Hi everyone, I'm trying to upgrade the CHM-T36VA to OpenPnP and am currently stuck trying to flash Smoothieware. I have an STLINK-V3SET, STM32CubeProgrammer, etc. For reference, I am not experienced in doing this kind of thing.

We were able to connect to the programmer and do a full chip erase, however while writing the new firmware CubeProgrammer crashed (we believe a faulty USB connection is to blame), and since then we've been unable to connect to the chip. When trying to connect it gives one of the following errors:

Error: ST-LINK error (DEV_TARGET_CMD_ERR)

Error: ST-LINK error (DEV_CONNECT_ERR)

This is a screenshot of the CubeProgrammer window with our settings:

Cube.png

For the SWD connections, we've been using this this image from this guide, is this setup incorrect?

Did we brick our board?

M. Mencinger

unread,
Jun 2, 2023, 2:35:44 PM6/2/23
to ope...@googlegroups.com
Before you do anything with that programmer which you do not need - you better read instructions! 

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/83e77ba7-c04e-497b-af1e-b0588ad24a34n%40googlegroups.com.
--
Mike

"--
 **************************************************************************************************************
This e-mail may be confidential and it may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return e-mail. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions. 
 SAVE THE NATURE - SAVE PAPER - THINK BEFORE YOU PRINT!  "

Brady Bowerbank

unread,
Jun 2, 2023, 2:48:31 PM6/2/23
to OpenPnP
Hey Mike, we're not using the Smoothieboard but rather the board that came with the machine, so we do need to flash it and we do need to use the programmer. I could've sworn I posted this to a different group, but I guess I may have had both up when I decided to post and accidentally posted here.

Jarosław Karwik

unread,
Jun 2, 2023, 4:11:28 PM6/2/23
to OpenPnP
What file have you actually programmed ? It has to me the one ported specifically for CHM36VA board - not standard Smoothie

You should also configure programmers reset type to 'hardware' - software reset may not work properlly if you loaded wrong and incomplete firmware before.

Jan

unread,
Jun 2, 2023, 4:48:44 PM6/2/23
to ope...@googlegroups.com
Hi Brady!
I've seen a lot of STM32 chips and never bricked any. However, this
chips are sometimes difficult to connect to once they are in some dead
state. Power-cycling and chip erasing usually helped for me.
The other thing thats sometimes tricky is the communication speed and
the signal quality. I'd recommend to use rather short cables and make
sure their connection is good.
If that does not help, I'd suggest to retry using a battery powered
laptop. Ground loops can sometimes also cause this issues.
Btw: if you hear horrible sounds from the vacuum pump and the blower,
the chip erase was successful.

Jan

On 01.06.2023 21:20, Brady Bowerbank wrote:
> Hi everyone, I'm trying to upgrade the CHM-T36VA to OpenPnP and am
> currently stuck trying to flash Smoothieware. I have an STLINK-V3SET,
> STM32CubeProgrammer, etc. For reference, I am not experienced in doing
> this kind of thing.
>
> We were able to connect to the programmer and do a full chip erase,
> however while writing the new firmware CubeProgrammer crashed (we
> believe a faulty USB connection is to blame), and since then we've been
> unable to connect to the chip. When trying to connect it gives one of
> the following errors:
>
> Error: ST-LINK error (DEV_TARGET_CMD_ERR)
>
> Error: ST-LINK error (DEV_CONNECT_ERR)
>
> This is a screenshot of the CubeProgrammer window with our settings:
>
> Cube.png
>
> For the SWD connections, we've been using this this image
> <https://raw.githubusercontent.com/c-riegel/misc/master/IMAG1221-20190916-141902825.jpg> from this guide <https://github.com/openpnp/openpnp/wiki/Charmhigh-modifications-for-OpenPnP>, is this setup incorrect?
>
> Did we brick our board?
>
> --
> You received this message because you are subscribed to the Google
> Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openpnp+u...@googlegroups.com
> <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/openpnp/83e77ba7-c04e-497b-af1e-b0588ad24a34n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/83e77ba7-c04e-497b-af1e-b0588ad24a34n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Brady Bowerbank

unread,
Jun 5, 2023, 11:47:16 AM6/5/23
to OpenPnP
We do indeed hear horrible sounds, haha. I've tried everything you suggested, Jan, but it's still spitting out errors and failing to connect, except now there's a new one popping up: 

> Error: No STM32 target found! If your product embeds Debug Authentication, please perform a discovery using Debug Authentication.

I wonder if trying to connect under reset would work, except there's no NRST pin on this board that I've found.

vespaman

unread,
Jun 5, 2023, 12:42:50 PM6/5/23
to OpenPnP
I have only connected Segger JLink's to my chmt, but at one point in time, I ended up in something similar to what you see. I think I did remove the leftmost connector which silences the pumps and maybe also other connectors (don't remember exactly), and then it was OK to flash the unit again. I assumed that the issue might have been the fact that all hardware was "on" and it all contributed to an unhealthy environment for the debugger. Have never experienced that issue since.
I.e. power off the machine and remove all "unnecessary" connector and try again. If not for anything else, for your mental peace.

 - Micael

Jan

unread,
Jun 6, 2023, 3:36:49 AM6/6/23
to ope...@googlegroups.com
Hi Brady!
Hardware reset is indeed no option because NRST is not exposed to the
debug connector. Unfortunately software reset is more error prone...
I've no experience with STMs programming jig so I can only put some
more general hints in:
- disconnecting the blower pump and the drag pin solenoid is recommended
as this will burn out if operated for a longer period at full power
(~10min ??).
- please verify that you have all four wires of the debug connector
connected. Especially the VCC wire is required because it provides power
to the level shifters. According to your screenshot I'm assuming you
already did.
- the communication speed on the SWD interface is limited by the cpu
clock speed. So especially for the connection phase, you shall make sure
that the speed is slow enough. I'd suggest to try with 1MHz. That's
likely the default and a good compromise between signal quality and
programming speed.
- I've had good success (on other hardware, but STM32 mcu) by power
cycling and immediate connection (before software reconfigures the clock
source).

Jan
> <https://raw.githubusercontent.com/c-riegel/misc/master/IMAG1221-20190916-141902825.jpg <https://raw.githubusercontent.com/c-riegel/misc/master/IMAG1221-20190916-141902825.jpg>> from this guide <https://github.com/openpnp/openpnp/wiki/Charmhigh-modifications-for-OpenPnP <https://github.com/openpnp/openpnp/wiki/Charmhigh-modifications-for-OpenPnP>>, is this setup incorrect?
> >
> > Did we brick our board?
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "OpenPnP" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to openpnp+u...@googlegroups.com
> > <mailto:openpnp+u...@googlegroups.com>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/openpnp/83e77ba7-c04e-497b-af1e-b0588ad24a34n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/83e77ba7-c04e-497b-af1e-b0588ad24a34n%40googlegroups.com> <https://groups.google.com/d/msgid/openpnp/83e77ba7-c04e-497b-af1e-b0588ad24a34n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/openpnp/83e77ba7-c04e-497b-af1e-b0588ad24a34n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "OpenPnP" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openpnp+u...@googlegroups.com
> <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/openpnp/7ee32dc0-4037-4d8c-ac1e-1336707280f3n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/7ee32dc0-4037-4d8c-ac1e-1336707280f3n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Jarosław Karwik

unread,
Jun 6, 2023, 5:01:30 AM6/6/23
to ope...@googlegroups.com
I have usually one or two boards per year with STM so locked up, that only hardware reset programming helps. If you have firmware messed in such way that e.g. PLL programming goes wrong way then the core will not be accessible. This usually happens after failed erase or programming. 

I will check tomorrow my old CHM36VA board - usually reset line is not left unconnected, so there should be easy way to get to it , even if it is not on connector .(may be e.g. on 0603 capacitor). If nothing else works - connecting directly to processor pin is also possible ( microscope recommended)

To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/e5182fbd-ec6a-548f-7870-bdbffb23530f%40googlemail.com.

Brady Bowerbank

unread,
Jun 6, 2023, 2:22:02 PM6/6/23
to OpenPnP
Update: unplugging the vacuum pump did it. I imagine either the vibrations or EM noise created by the pumps were causing our problems.

Thanks for the help everyone!

Reply all
Reply to author
Forward
0 new messages