TasEs wrote: Thu Feb 06, 2025 4:06 pm
Thanks for the interested answer!
I'm sorry, but I have understand a lot of these terminology with ChatGPT help. I apologize for that.
1) What core - from your question I understand that it could be STM32, because the IDE has an STM32 board add-on installed, but when I marked the board Maple Mini, ST-Link is not available. I recognize simpler solutions - I would gladly follow the Maple core recommendation, unfortunately, ChatGPT did not tell me anything about the Maple core.
2) vers. 1.8.19. is the highest, which is suitable for my PC with win.7, but 1.8.13 was recommended to me as the most stable.
3) I have tried soldering the I2C connection to all possible pins, the essence does not change.
4) if I use Wire.setSCL(PB11); and Wire.setSDA(PB10); there is an error message 'class TwoWire' has no member named 'setSCL'
5) encountering problems with the TFT touchscreen (SPI interface), I resorted to a simpler task, where I2C communication ... SPI is left for later ... Actually, I need the STM32 because of the TFT and energy saving.
ok for a starter, I'd recommend starting with 'official' core
https://github.com/stm32duino/Arduino_Core_STM32
the wiki is here
https://github.com/stm32duino/Arduino_Core_STM32/wiki
follow instructions there would let you install the core appripriately.
ok, but a few hints up, it is a biased opinion, the 'official' core is 'fat', but
*wait*, rather than to call it 'fat', I'd say the core adds a lot of things in the basic configuration that would otherwise not be there, so it conforms more to the official Arduino API.
Next, 'official' core is based around STM32 Cube HAL, this is important as practically a huge portfolio of the stm32 microcontrollers are supported,
just take a look at the board list
https://github.com/stm32duino/Arduino_Core_STM32
the unfortunate fact it it carries quite a bit of 'baggage', but that you can practically switch boards on the board list just selecting it, and there are a *lot* of boards and mcu to choose.
now back to libmaple
https://github.com/rogerclarkmelbourne/Arduino_STM32
^ that could be deemed the 'pioneers', that started with the leaflabs maple (it is called roger's core, for a reason, but the stem is libmaple)
https://www.leaflabs.com/maple
http://static.leaflabs.com/pub/leaflabs ... index.html
that is further developed by the community and is a 'lean and mean' core, it works lean and fast on stm32f103c{8,b}, but it is specific to f103c{8,b} and some f4xx variants, but it may take significant effort to port your codes, or the core, if you decide to switch to newer mcus/boards.
But if you look at some of the newer boards on offer e.g. :
https://weactstudio.aliexpress.com/stor ... items.html
and from Adafruit
https://www.adafruit.com/product/4382
micropython
https://store.micropython.org/product/PYBv1.1
from ST itself
https://www.st.com/en/evaluation-tools/ ... oards.html
Olimex
https://www.olimex.com/Products/ARM/ST/
etc and the huge board list
https://github.com/stm32duino/Arduino_Core_STM32
i'd guess it makes 'more sense' with the 'official' core.
to use the 'official' core, i'd recommend a beefier chip, e.g. stm32f4x1 with more sram and flash
https://github.com/WeActStudio/WeActStu ... iSTM32F4x1
because the 'official' core has a 'bigger footprint' for bundling more things in the basic configs.
it is still lean though as I've build Adafruit ili9341 lcd library on the 'official' core
https://github.com/ag88/Adafruit_ILI9341_SPI_stm32duino
and the binary size comes to about 40k bytes with the Adafruit graphics test + USB Serial compiled.
it is 'effortless' with the newer boards that has more flash and sram, but if using a stm32f103c8 one may find it a little 'squeezy'.
----
now back to the topic about I2C
Assuming that you are using 'libmaple' (e.g. roger's) core.
There is an 'i2c scanner' to scan for peripherals on the i2c bus.
https://github.com/rogerclarkmelbourne/ ... r_wire.ino
a similar I2C scanner is available for the 'official' core
https://github.com/stm32duino/Arduino_C ... canner.ino
I find this a very useful sketch to run for i2c as it'd probe and tell you what address is your i2c peripheral at, that matters as I've seen for myself some SSD1306 LCDs are configured for a different address vs an assumed default. It is also a good test that your I2C setup is after all working.