# SPI Troubles with B-G431B-ESC1 and MA730

**URL:** <https://community.simplefoc.com/t/spi-troubles-with-b-g431b-esc1-and-ma730/2847>\
**Category:** hardware support\
**Tags:** b\_g431\_esc, stm32\
**Created:** [January 11, 2023, 3:30pm UTC](https://community.simplefoc.com/t/spi-troubles-with-b-g431b-esc1-and-ma730/2847 "2023-01-11T15:30:05Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![ben549](https://community.simplefoc.com/letter_avatar_proxy/v4/letter/b/8491ac/32.png) [@ben549](https://community.simplefoc.com/u/ben549)\
**Post date:** [January 14, 2023, 4:29am UTC](https://community.simplefoc.com/t/spi-troubles-with-b-g431b-esc1-and-ma730/2847/7 "2023-01-14T04:29:30Z")

</div>

> yeah, changing the board files is definately an advanced topic!  
> As a note, and I am not sure it will work for you, but in theory these PinMaps are defined with “WEAK”. This means you should be able to copy the whole PinMap structure into your sketch (at the top) and remove the “WEAK”. Then you can make changes in your copy in your sketch, and in theory it should prefer the non-weak version of the PinMap.  
> You can probably even create a file “mypinmap.cpp” in your sketch folder and put it there, to keep things tidy.  
> Using it is a combination of having the PinMap with the correct assignments of SPI peripherals to pins, and then initializing an SPI object that uses those pins.

That’s pretty cool, I’ll have to give that a try. I was using this code to set the pins at one point.

```auto
SPI.setSCLK();
SPI.setMISO();
SPI.setMOSI();
SPI.setSSEL();
SPI.begin();

```

> Awesome plan! There’s a couple of us here working on designs with the STSPIN32G4, including myself 🙂 let us know how it goes!

Have you shared your design anywhere? I’ve mostly been using the reference designs for the B-G431B-ESC1, STSPIN32G4, EVSPIN32G4, and MA730 along with the information here:  
[https://community.simplefoc.com/t/stspin32g4-support/2027](https://community.simplefoc.com/t/stspin32g4-support/2027)

It’s going to be tight since this if for a 35mm OD motor.

 ![CR BLDC Integrated v0.01 2](https://community.simplefoc.com/uploads/default/original/2X/0/07bb05787f37d12979de030ed8914ead87014c26.jpeg)

---

_[View the full topic](https://community.simplefoc.com/t/spi-troubles-with-b-g431b-esc1-and-ma730/2847)._
