platform-ststm32 icon indicating copy to clipboard operation
platform-ststm32 copied to clipboard

STM32 - BluePill - Arduino vs Platformio - different sizes and results with same file

Open jvoj opened this issue 6 years ago • 1 comments

I was moving from Arduino IDE to PlatformIO and copy pasted code to PlatformIO. It didnt worked as expected. In platformio there are not up-to-date libraries of Wire (cant choose different I2C master device) and so on. So I was digging deeper what is the point...

I narrowed my search to elaborate the issue to one example which uses 1-Wire library + DallasTemerature library. I have downloaded DallasTemerature library from PlatformIO and examined results with Simple.pde compared to Arduino IDE.

Compiled .bin file with the same example:

PlatformIO  - 18.1 KiB
Arduino IDE - 20.4 Kib
Dependency Graph
|-- <DallasTemperature> 3.8.0
|   |-- <OneWire> 2.3.4
|-- <OneWire> 2.3.4
Checking size .pioenvs/genericSTM32F103C8/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [=         ]   9.3% (used 948 bytes from 10240 bytes)
PROGRAM: [======    ]  55.6% (used 18224 bytes from 32768 bytes)

Then I upload manually this files to bluepill by st-flash write firmware.bin 0x8000000. I got same results with build-in uploads.

Firmware from arduino works, from platformio dont. It hangs (crashes maybe?) in the middle of printing to serial line and prints just - Dallas Temperature but whole string should be Dallas Temperature IC Control Library Demo

My platformio.ini file:

[env:genericSTM32F103C8]
platform = ststm32
board = bluepill_f103c6
framework = arduino
debug_port = stlink

Thanks for any help! I think its just beginners mistake... (maybe related to https://github.com/platformio/platform-ststm32/issues/221)

jvoj avatar Mar 29 '19 10:03 jvoj

I also have encountered platformio not installing the latest version of the Wire library and can't work out why this happens.

It seems quite a few people are experiencing this:

https://community.platformio.org/t/how-to-update-my-i2c-wire-library/15128

I tried uninstalling Platform ST STM32 and reinstalling but the problem remains.

Is there any chance this may be fixed and I've done something wrong?

Is there a work around for this - can I install the library manually but tell PlatformIO to avoid using the builtin version of Wire?

chrisco484 avatar Jan 18 '23 18:01 chrisco484