SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions about processor boards have here!
User avatar
By cdwilson
#227464
Quick update on support for the STM32 MicroMod board. The PR mentioned above was merged in https://github.com/micropython/micropyt ... ffbd37a6d3 so you should now be able to build & deploy the firmware for this board by checking out the micropython repo and running:
Code: Select all
make -C ports/stm32/ BOARD=SPARKFUN_MICROMOD_STM32 deploy
.

I also pushed up a work-in-progress PR for CircuitPython support at https://github.com/adafruit/circuitpython/pull/5060. You should be able to test it out by checking out that PR and running:
Code: Select all
make -C ports/stm/ BOARD=sparkfun_stm32f405_micromod flash
User avatar
By Sterny72
#231706
Hi CDWilson,

Thanks for developing this port.

I was able to build it and install it on a board. However, I'm having issues getting I2C working with various carrier boards.

Can you tell me if you're able to do a basic scan against any generic QWIIC I2C sensors?

I checked the pinout diagrams, and mpconfigboard.h and pins.csv looks like they match the schematic.

Thanks for reading!
User avatar
By cdwilson
#231718
I think I accidentally swapped the I2C1 vs. I2C2 peripheral assignments... Let me know if this patch fixes the issue and I'll work on getting a PR submitted.
Code: Select all
diff --git a/ports/stm32/boards/SPARKFUN_MICROMOD_STM32/mpconfigboard.h b/ports/stm32/boards/SPARKFUN_MICROMOD_STM32/mpconfigboard.h
index 0c451a4db..dc7b7b32e 100644
--- a/ports/stm32/boards/SPARKFUN_MICROMOD_STM32/mpconfigboard.h
+++ b/ports/stm32/boards/SPARKFUN_MICROMOD_STM32/mpconfigboard.h
@@ -73,15 +73,15 @@ extern struct _spi_bdev_t spi_bdev;
 #define MICROPY_HW_CAN1_TX (pin_B9)
 #define MICROPY_HW_CAN1_RX (pin_B8)
 
-// I2C1 config (MicroMod I2C)
-#define MICROPY_HW_I2C1_NAME "I2C"
-#define MICROPY_HW_I2C1_SCL (pin_B10)
-#define MICROPY_HW_I2C1_SDA (pin_B11)
-
-// I2C2 config (MicroMod I2C1)
-#define MICROPY_HW_I2C2_NAME "I2C1"
-#define MICROPY_HW_I2C2_SCL (pin_B6)
-#define MICROPY_HW_I2C2_SDA (pin_B7)
+// I2C2 config (MicroMod I2C)
+#define MICROPY_HW_I2C2_NAME "I2C"
+#define MICROPY_HW_I2C2_SCL (pin_B10)
+#define MICROPY_HW_I2C2_SDA (pin_B11)
+
+// I2C1 config (MicroMod I2C1)
+#define MICROPY_HW_I2C1_NAME "I2C1"
+#define MICROPY_HW_I2C1_SCL (pin_B6)
+#define MICROPY_HW_I2C1_SDA (pin_B7)
 
 // SPI1 config (MicroMod SPI)
 #define MICROPY_HW_SPI1_NAME "SPI"
User avatar
By Sterny72
#231724
cdwilson wrote: Tue Mar 01, 2022 3:17 am I think I accidentally swapped the I2C1 vs. I2C2 peripheral assignments... Let me know if this patch fixes the issue and I'll work on getting a PR submitted.
Hi Chris,

Thanks again for this - I can confirm the fix allowed me two scan using my SFE ATP carrier board on both buses connected to a Qwiic board.

>>> from machine import I2C
>>> i2c = I2C(1)
>>> i2c.scan()
[35]
>>> i2c2 = I2C(2)
>>> i2c2.scan()
[73]
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum