Manta-M8P icon indicating copy to clipboard operation
Manta-M8P copied to clipboard

Manta M8P Boot Loop on SPI1 with ADXL345

Open NiLMoXiE opened this issue 2 years ago • 35 comments

Connecting an ADXL345 to SPI1 on my Manta M8P causes the MCU to not boot. It seems like the bootloader is conflicting with some other device on SPI1 on boot.

Can anyone confirm if there is any other device on this board that uses SPI1 which would cause this?

Also is there any way to solve this issue - is there a different bootloader I can use?

Thanks

NiLMoXiE avatar Dec 21 '22 21:12 NiLMoXiE

Despite the update to the user manual for the ADXL345 - it still produces the same issue - MCU will not boot with ADXL345 connected via SPI1

NiLMoXiE avatar Dec 22 '22 17:12 NiLMoXiE

I tried it, for me it seems to work with Klipper and a CB1, when specifying ports without using SPI1:

[adxl345 hotend]
cs_pin: PB15 #PC4 did not work for me, even though I have v1.1 without the 31865
spi_software_sclk_pin: PA5
spi_software_miso_pin: PA6
spi_software_mosi_pin: PA7
axes_map: x,z,y

Bischi1997 avatar Jan 20 '23 12:01 Bischi1997

I am just now trying to install my adxl345 on my Manta M8P / CB1 and am unable to boot with the sensor attached to SPI1. Interestingly enough, if I hot plug the sensor into the SPI then everything works. I can successfully execute ACCELEROMETER_QUERY, AND MEASURE_AXES_NOISE. However, if I leave the sensor plugged in, I can not boot. Here is my setup in printer.cfg:

[adxl345] cs_pin: PB15 spi_speed: 5000000 #spi_bus: spi1 spi_software_sclk_pin: PA5 spi_software_mosi_pin: PA7 spi_software_miso_pin: PA6 rate: 3200 axes_map: x,z,y

I had to comment out the spi_bus due to an error. My wiring is as follows:

MP8 pin adxl pin gnd gnd +5V vcc PA5 SCl PA6 SDO PB15 CS PA7 SDA

Any help would be greatly appreciated!

Tomadoggy avatar Mar 07 '23 13:03 Tomadoggy

you solved? I have the same problem

Marck80 avatar Mar 14 '23 10:03 Marck80

No resolution yet...was working with a BTT tech on their FB groop and tried a lot of things, now that tech has gone silent. ----------------*- John

On Tue, Mar 14, 2023 at 4:53 AM Marck80 @.***> wrote:

you solved? I have the same problem

— Reply to this email directly, view it on GitHub https://github.com/bigtreetech/Manta-M8P/issues/27#issuecomment-1467865093, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO3NPQOLHFNVE5URFQVCALTW4BE4DANCNFSM6AAAAAATGBC7JI . You are receiving this because you commented.Message ID: @.***>

Tomadoggy avatar Mar 14 '23 12:03 Tomadoggy

I have the exaxt same issue M8P v1.1 - any board restart will force to re-flash firmware on MCO when the ADXL345 is connected. If I disconnect it, board boots.

Cambridge66 avatar Mar 23 '23 03:03 Cambridge66

So we have it posted here...but I am not too hopeful that BTT will pick it up and respond. I have gone to several Discord chanels and the BTT Facebook site but no resolution. Any Ideas from you?

Tomadoggy avatar Mar 23 '23 17:03 Tomadoggy

i bought "BIGTREETECH BTT ADXL345 V1.0" and with that it works.

Marck80 avatar Mar 23 '23 17:03 Marck80

Came here for help, finally got mine working after playing around a little bit Here is what I'm using: https://www.amazon.com/gp/product/B08YNR7CVP/ref=ppx_yo_dt_b_search_asin_image?ie=UTF8&psc=1

Here is my printer.cfg

[adxl345]
cs_pin: PC4
spi_software_sclk_pin: PA5
spi_software_mosi_pin: PA6
spi_software_miso_pin: PA7
spi_speed: 5000000
rate: 3200
axes_map: x,z,y

Here are my pin connections:

GND --> GND
VCC --> +5v
CS --> PC4
SD0 --> MOSI (PA7)
SDA --> MISO (PA6)
SCL --> PA5

Hopefully this helps others!

RickoT avatar Mar 27 '23 20:03 RickoT

@RickoT I have the same ADXL, Just to verify you are not using SPI1, but connecting to PC4 and also want to make sure you can boot with the ADXL connected. On SPI1 I can use the ADXL but only if I plug it in after booting the M8P...you do have the M8P here correct? Hope this works, but wanted to verify with you prior to rewiring. Thank you.

Tomadoggy avatar Mar 27 '23 20:03 Tomadoggy

image

Tomadoggy avatar Mar 27 '23 20:03 Tomadoggy

pins

RickoT avatar Mar 27 '23 20:03 RickoT

Oops, SCA === SDA

RickoT avatar Mar 27 '23 20:03 RickoT

@RickoT You are showing everything wired up to SPI1. Which is NOT CS pin PC4 but rather PB15. Not sure how you have yours working. The wiring you show is exactly how I have mine currently which will not allow boot while connected.

Now I am confused to how yours works with PC4 in your cfg. image

Tomadoggy avatar Mar 27 '23 21:03 Tomadoggy

@RickoT I see the disjoin now...you have version 1.1 of the board, I have version 1.0. Same wiring different pin assignments. Glad yours is working maybe this is an issue with V1.0 of the board. image

Tomadoggy avatar Mar 27 '23 21:03 Tomadoggy

Try swapping your PA6 and PA7 pins, thats what I did when it was not booting the MCU

Also, while im here, im trying to find out if I should keep the acetometer on all the time or just while tuning? Also, if there is a purpose for leaving the accelerometer on all the time is there a way to have both axis hooked up at the same time?

RickoT avatar Mar 27 '23 21:03 RickoT

Just a very small current draw while hooked up. NP to leave it on.

I swapped PA6 and PA7, booted, but no communication with the ADXL. Again, mine works just fine, but no board boot when connected. Thus my pins are correct, but thanks for the suggestion

Tomadoggy avatar Mar 27 '23 21:03 Tomadoggy

I'm also experiencing this issue. Wont boot when connected.

Flavourdynamics avatar Apr 13 '23 16:04 Flavourdynamics

Wow, I am having this same issue with the Manta M8P and the ADXL345. I have noticed that I can't use the GND/+5v I had to go to the 3.3v pin because I fried my first ADXL345. So here is my issue. I can connect to the ADXL345 and I can run the accelerometer_query with results: accelerometer values (x, y, z): -9548.656652, 2298.286494, 0.000000. My .conf: ########################################

ADXL

########################################

[adxl345] cs_pin: PB15 spi_software_sclk_pin: PA5 spi_software_mosi_pin: PA7 spi_software_miso_pin: PA6 spi_speed: 5000000 rate: 3200 axes_map: x,z,y

#[resonance_tester] #accel_chip: adxl345 #probe_points: 150,150,100 As soon as I uncomment [resonance_test] my printer locks up and will not boot into the firmware. I am at the end of my rope. Please help me!

TFLRichard avatar Apr 17 '23 01:04 TFLRichard

I upgraded to the V1.1 version of the board and now can boot with the ADXL connected. Try as I did to get it working with the V1.0 and even working directly with BTT, never achieved success. image

Tomadoggy avatar Apr 17 '23 19:04 Tomadoggy

I upgraded to the V1.1 version of the board and now can boot with the ADXL connected. Try as I did to get it working with the V1.0 and even working directly with BTT, never achieved success. image

I did get mine working last night on the V1.0. What I had to do is place the ADXL section under the spot in the printer.cfg where is says BL-Touch. Once I rebooted and power cycled the printer it worked just fine.

TFLRichard avatar Apr 17 '23 19:04 TFLRichard

I upgraded to the V1.1 version of the board and now can boot with the ADXL connected. Try as I did to get it working with the V1.0 and even working directly with BTT, never achieved success. image

What do you think the solution here was? Your pin def is slightly different than mine, but you've also specified the spi speed, rate, axes map, and included the resonance tester section below. I'll give this a shot tonight.

UPDATE: No luck. Boot from cold worked fine, but I tried a number of variations repositioning lines in the code, none of which would allow a firmware restart.

Flavourdynamics avatar Apr 18 '23 16:04 Flavourdynamics

It seems, the Manta M8P isn´t the only board with exact that problem: With the new BTT Octopus Max EZ exactly the same. Thanks for pointing to the miso/mosi swap. That did the trick for me (at least as a quick and dirty workaround). Unfortunately i can´t leave it like that, because the steppers (in case of 5160´s or similar) use the same cpu pins (shared spi) and in a couple of weeks i get other drivers / motors... I didn´t buy BTT for a long time (just problems with their stuff) and it seems, the decision to come back for the "top of the line" board also was nothing than a mistake :(

chaaalyy avatar Apr 23 '23 20:04 chaaalyy

I upgraded to the V1.1 version of the board and now can boot with the ADXL connected. Try as I did to get it working with the V1.0 and even working directly with BTT, never achieved success. image

I did get mine working last night on the V1.0. What I had to do is place the ADXL section under the spot in the printer.cfg where is says BL-Touch. Once I rebooted and power cycled the printer it worked just fine.

-- Can you tell us more details please, type of adxl345 you are using, pins of adxl, etc what i tried to do to get mine working and escape from booting was 1- connect adxl after booting but gives an error when trying to use [resonance_tester] 2- using a rpi pico but klipper gives >> adxl345: spi pins must be on same mcu b6709bb9-904f-4015-a4ff-4b8fd9dd7277

3- using usb-adx345 provided by triangle labs but gives the same error 4- changing pins to another pin such exp pins but it gives that adxl345 is not connected Note : i am using RATos Is buying an adxl345 provided by btt is the only way to fix that ?

egypro98 avatar May 04 '23 03:05 egypro98

Same problem on my M8P v1.0. Switched it to the other SPI channel for the screen. I don't have a screen so no loss...

Moved the pins to EXP2, (Power & GND from EXP1) and works perfectly.

[adxl345] cs_pin: PB12 spi_software_sclk_pin: PB13 spi_software_mosi_pin: PB14 spi_software_miso_pin: PB11 spi_speed: 5000000 rate: 3200

Passed ACCELEROMETER_QUERY and TEST_RESONANCES

GitRDone2022 avatar May 13 '23 16:05 GitRDone2022

Cheap chinese adxl345. Manta m8p v1.1. Did exactly as [RickoT] wrote. All works fine. No issues at all

yuriy-panov avatar May 31 '23 04:05 yuriy-panov

I upgraded to the V1.1 version of the board and now can boot with the ADXL connected. Try as I did to get it working with the V1.0 and even working directly with BTT, never achieved success. image

I did get mine working last night on the V1.0. What I had to do is place the ADXL section under the spot in the printer.cfg where is says BL-Touch. Once I rebooted and power cycled the printer it worked just fine.

-- Can you tell us more details please, type of adxl345 you are using, pins of adxl, etc what i tried to do to get mine working and escape from booting was 1- connect adxl after booting but gives an error when trying to use [resonance_tester] 2- using a rpi pico but klipper gives >> adxl345: spi pins must be on same mcu b6709bb9-904f-4015-a4ff-4b8fd9dd7277

3- using usb-adx345 provided by triangle labs but gives the same error 4- changing pins to another pin such exp pins but it gives that adxl345 is not connected Note : i am using RATos Is buying an adxl345 provided by btt is the only way to fix that ?

It all depends on your setup. My struggle with it seems to be some sort of SPI channel conflict. Because both my TFT screen and MAX driver work via SPI, something is happening there that prevents proper setup od ADXL.

I still have to try connecting it without the screen and with a regular thermistor that won't require the max driver then I can also switch off the SPI bus used by the TFT in CB1 /boot/BoardEnv.txt

The fact is this board definitely has issues and if BTT was active here, perhaps not so many people would need to contact them directly which takes weeks to get a response from, which also makes diagnostics a whole lot more difficult with so much time in betwwen.

fabio-s-franco avatar Jun 28 '23 18:06 fabio-s-franco

I am kind of stuck at the same point, trying to connect a M8P/ CB1 to the proposed ADXL345 shown in the BTT M8P manual image

No luck with anything so far. Since I am running TMC5610, I am already relying on spi_software pins for all of the driver controls.

What I have tried:

  • Connecting ADXL345 to M8P as described in manual with CS_pin = PC4 and PB15

[adxl345] cs_pin: PC4 spi_software_sclk_pin: PA5 spi_software_mosi_pin: PA7 spi_software_miso_pin: PA6

and

[adxl345] cs_pin: PB15 spi_software_sclk_pin: PA5 spi_software_mosi_pin: PA7 spi_software_miso_pin: PA6

  • Flipping MISO and MOSI pins in HW, just in case. --> No difference
  • Unplugging the screen and using EXP2 pins

[adxl345] cs_pin: PB12 spi_software_sclk_pin: PB13 spi_software_mosi_pin: PB14 spi_software_miso_pin: PB11

No matter what I do, I always get the same error message: Error on 'ACCELEROMETER_QUERY': missing CHIP

The only difference I see is, that in the first configuration version mentioned (with cs_pin as PC4), klipper doesn't boot with the adxl345 connected. I even tried a 2nd accelerometer in the form of this one: GY-291 image

It doesn't matter exact same behavior. I have absolutely no idea what the problem is. Any advice on how to proceed?

firegarch avatar Aug 04 '23 22:08 firegarch

Hi dudes i got it!!! Vcc to 3.3 V try this and also ( if still bootload) i unplugged SDO and change too SDA

#[adxl 345################################################## [adxl345] klip

cs_pin: PB15 spi_software_sclk_pin: PA5 spi_software_mosi_pin: PA7 spi_software_miso_pin: PA6 spi_speed: 5000000 rate: 3200 axes_map: x,z,y

[resonance_tester] accel_chip: adxl345 probe_points: 150, 150, 20 # an example

IVOMTB avatar Sep 26 '23 19:09 IVOMTB

I am having the same problem. M8P won't boot if adxl345 is plugged in (it also seems to die if I change adxl345 config and restart klipper). But after M8P has booted, adxl345 works just fine.

I am using cs_pin: PC4 and hardware spi.

yshui avatar Oct 04 '23 19:10 yshui