Jump to content

BTT Octopus DFU Mode


Recommended Posts

Stupid question time - have you tried a different USB cable?

I spent about an hour trying to get my toolhead into DFU mode (I know not the octopus but bear with).  Tried everything I could find online.  Turned out that the USB A to C cable I was using was charging only.  A change of cable and everything just worked!

second question - have you tried double clicking the reset button?  On the Octopus that came with my Siboor kit a single press of the reset wasn’t enough, it needed a double click.  I suspect this was as it already had a version of Katapult flashed to it out of the shop.

Link to comment
Share on other sites

what @xyleth said! I did the exact same thing! I was getting frustrated that the Octopus didn't seem to want to talk, so I tried connecting my phone to a computer with the USB cable I was using. Same problem--it was power only. I got a verified data cable connected and it woke up.

Link to comment
Share on other sites

Posted (edited)
6 hours ago, xyleth said:

Stupid question time - have you tried a different USB cable?

I spent about an hour trying to get my toolhead into DFU mode (I know not the octopus but bear with).  Tried everything I could find online.  Turned out that the USB A to C cable I was using was charging only.  A change of cable and everything just worked!

second question - have you tried double clicking the reset button?  On the Octopus that came with my Siboor kit a single press of the reset wasn’t enough, it needed a double click.  I suspect this was as it already had a version of Katapult flashed to it out of the shop.

I have tried both of those. The main USB cable I have been using came with the LDO kit, and I’ve been using it for about 6 months without issue. I did try another one I had laying around and that didn’t work either. I can see the board with lsusb if the boot jumper isn’t in place, but not when it should be in DFU. Also tried double clicking. 
 

There is a status LED on the board. I noticed that without the boot jumper when I push reset that LED will go out for a second and then come back on. With the boot jumper on it never goes out when pushing reset. Don’t know what that means,  but it seemed odd to me. BTT still hasn’t responded to me. 

Edited by kingstar
Link to comment
Share on other sites

The STM32CubeProgrammer software did not work...because the board will not go into DFU mode. I refuse to give up. I've got an ST-Link on the way. I will get Katapult on this board. I know I don't have to have it, but I've gone this far. I must go all the way.

  • Haha 2
Link to comment
Share on other sites

On 4/5/2024 at 6:29 PM, kingstar said:

The STM32CubeProgrammer software did not work...because the board will not go into DFU mode. I refuse to give up. I've got an ST-Link on the way. I will get Katapult on this board. I know I don't have to have it, but I've gone this far. I must go all the way.

This is the end. I don't have any more options. The ST-Link won't connect either. It gives and error and a setting to change, but it won't let me change that setting. Think I'm officially giving up. Hopefully my Octopus still works and will accept normal firmware. Super bummed.

ST-Link Error.jpg

ST-Link Greyed out.jpg

Link to comment
Share on other sites

I think I might have made a breakthrough. I sent the ST-link I got back and got a different one. The previous one wouldn’t even connect by itself. This new one worked without issue and I uploaded the katapult.bin file using it. Now when I read the memory in the st-link cube programmer software I can see canboot in the ASCII of the memory. When I get a chance I’ll continue the next steps and see if it works. Fingers crossed. 

  • Like 3
Link to comment
Share on other sites

Incredibly, it still won't go into DFU mode. I've performed a full chip erase and download of Katapult again. Tried all combinations of power supply again, boot jumper, and now double press of reset since Katapult is supposed to be there. Think I'll see if their is a Discord community of either Katapult or BTT to see if anyone has ideas for going into DFU. If I don't have it solved by this weekend, then I'll move on with life. Disappointed, but with the knowledge I gave it my all.

Link to comment
Share on other sites

6 hours ago, kingstar said:

Never mind, Katapult is there. I was able to flash Klipper through it and it shows I have a functional CAN bus. Tomorrow I’ll flash my tool head. Hooray!!!

Persistence pays off and I bet you have learned a lot. Just a pity we have to learn the hard way. Story of my life!

  • Like 1
Link to comment
Share on other sites

14 hours ago, kingstar said:

Never mind, Katapult is there. I was able to flash Klipper through it and it shows I have a functional CAN bus. Tomorrow I’ll flash my tool head. Hooray!!!

thats great to hear! congratulations on the Persistence to not give up!

would you mind giving the Link to the programmer and guide you used? I would love to try this on my two boards as well!

Link to comment
Share on other sites

I did not notice this thread turned into flash-stm from can't flash octopus.

I am very glad you succeeded. What you have gone through, is similar to what I recently experienced with another STM chip based PCB.

 

The reason the latest STM32CubeProgrammer does not work, has to do with certain bugs introduced in the latest version and I hope they will fix it soon. Another reason in older versions would give problems, had to do with drivers that were installed from Microsoft Update containing crippled driver functionality.

So the general recommendation is, please do not use stm32cube programmer software to flash your chips. Use alternatives.

I have ordered the cheapest STLink I could find on AliExpress to write directly to the stm32 chip without anything else. And when it arrived, I connected it through stm32cube programmer again, and it went through all kinds of b.s. dialogs and would not work. It seems my STLink contained a non official clone, which is blocked by stm32cube programmer. 

So this means they block it and do not even notify you.

Another reason NOT to use this program for your hardware.

I found out that there is luckily an open source version which worked perfectly!

How?

Simple... I connected the board with the STM chip to my RPi. And over SSH I downloaded the stlink-tools library.

sudo apt-get update 

sudo apt-get upgrade

sudo apt-get -y install stlink-tools

After stlink tools were installed, I used the st-flash command to write the binary I downloaded to the current home directory by the command: 

st-flash write MyFlashBinary.bin ADDRESS

 

 

 

 Again, I am glad your problem was solved. I hope this helps someone else. Do not throw 'fake' stmlink devices away because it does not work on stmcube. Just uninstall stmcube. It is buggy and untrustable.

 

 

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, Dousi said:

thats great to hear! congratulations on the Persistence to not give up!

would you mind giving the Link to the programmer and guide you used? I would love to try this on my two boards as well!

I used a combination of the two methods here. In the end, I used the ST Cube Programmer software, but had it connected to the board in ST-Link mode. Beyond that difference, I followed the remaining steps to Full Chip Erase and then upload the Katapult.Bin file.

ST-Link Utility

ST Cube Programmer

This is the ST-Link I got that worked. I had to make another wire to make the needed 5 wire connection as both ST-Link's only come with 4 wires.

Working ST-Link

This is the ST-Link that would not work.

Not Working ST-Link.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Thank you for your tips! I received my ST-Link, but haven't yet had Time to try it on Flashing my Boards. Will update when I get to that point!

  • Like 1
Link to comment
Share on other sites

Just a heads up on flashing with STM32 cube programmer in DFU mode over USB.

I had to re-flash a cartographer probe and I can state the latest version of STM32Cube programmer ( V2.16.0) has a bug and does not flash the device in dfu-mode. Downloaded the 2.14.0 version and all as well. (This is confirmed on the discord discussions)

  • Like 1
Link to comment
Share on other sites

23 hours ago, mvdveer said:

Just a heads up on flashing with STM32 cube programmer in DFU mode over USB.

I had to re-flash a cartographer probe and I can state the latest version of STM32Cube programmer ( V2.16.0) has a bug and does not flash the device in dfu-mode. Downloaded the 2.14.0 version and all as well. (This is confirmed on the discord discussions)

If you have an ST-Link, it looks like you can flash it with that instead of DFU mode through USB.

 

https://docs.cartographer3d.com/cartographer-probe/firmware-update/cartographer-with-input-shaper/update-via-stlink

  • Like 2
Link to comment
Share on other sites

Now.. to make things worse, I would say: Oh, I prefer to do it over Katapult..

But there are several problems weaving a net.

STM32 chips flashing can be done in several ways. And it is all confusing. I find it confusing still. 

There are also other problems with the introduction of every new 'helping' instrument. Every link built in the chain to enforce it, at the same time is a potential for more problems.

 

These STM chips, which are very common for us-printer-people, have to be 'flashed' for it to work properly. Flashing is nothing other than writing some software that tells the chip how to handle, onto the ROM. (code does stays when you remove energy).

i- The STM chip is protected against writing. To write (flash) the software (firmware) to the chip (ROM) you need to bring the chip into DFU mode, according to the descriptions of the manufacturer. Sometimes this is done by pushing a button on the board, sometimes setting or removing a jumper and sometimes by shorting contacts with tweezers. This OPENS the chip for writing. 

ii- a piece of software exists, called katapult and / or canboot, that you write (flash) to the BOOT part of stm32 ROM. What it does, is it makes it unnecessary to have to perform steps (i), to get the STM open for writing(flashing)

iii- once the chip is open for writing, you need a program, that knows how to write the software (firmware) to the chips ROM. All kinds of guides use stm32cubeprogrammer, because it was a good program that worked from windows and was friendly. But it is just a bloated, badly written interface for performing simple read / write operations to the chip.

There are very good alternatives. DFU-Util which is used from Linux is one. But also the STM-utils that I referred to above, is a very good one. These are all also available for windows.

iv- You can bypass the write-protection of STM chips by using a piece of hardware, and write directly to the chip. The makers of stm32cubeprogrammer produced this chip for the first time: ST-Link. Luckily there are also clones. But this lead to STM32Cube to protect their software against use of this ST-Link. 

 

I have found in my printers and a few chips I had to handle I have followed this and it works every time: Out of the package I connect the PCB (with STM) chip to my backup Raspberry Pi. This I connect to a 5v usb phone charger. Then log in to the Pi over ssh.

1- Put the PCB into DFU mode.

2- flash with DFU-util Katapult/canboot on the board. (this overwrites the stms DFU bootloader, so Katapult handles booting!)

3- Then I use the correct Katapult command to flash the firmware that I am supposed to flash.

Then I print the pcb into the printer.

When I need to re-flash, I use the Katapult commands from ssh, to flash!

 

In case of an emergency, use ST-link as I described above in a similar manner as described here (remove pcb from printer, connect to backup RPi)

 

I hope this helps at least someone understand the chinese chip and its china-2-aliexpress-english-translation documented confusion better for us printer people.

 

 

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...