platformio / platform-ststm32

ST STM32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm32
Apache License 2.0
390 stars 305 forks source link

Support for Arduino STM32L4 #28

Closed blackketter closed 5 years ago

blackketter commented 7 years ago

Please add support for arduino-STM32L4.

See: https://github.com/GrumpyOldPizza/arduino-STM32L4, which supports the Butterfly and Ladybug by @kriswiner & @GrumpyOldPizza

Thanks!

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40904021-support-for-arduino-stm32l4?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github).
ivankravets commented 7 years ago

@ubis Does STM32Duino support L4?

GrumpyOldPizza commented 7 years ago

There is some half hearted support for the NUCLEO-L476 ... But I guess that was not the original question.

On Tue, Feb 28, 2017 at 3:25 PM, Ivan Kravets notifications@github.com wrote:

@ubis https://github.com/ubis Does STM32Duino support L4?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/platformio/platform-ststm32/issues/28#issuecomment-283180933, or mute the thread https://github.com/notifications/unsubscribe-auth/AG4QfGcesrHgcgJ6qIa_wTkKxdULn4K3ks5rhJ6-gaJpZM4LiUHq .

ivankravets commented 7 years ago

I think we can merge STM32Duino with @GrumpyOldPizza arduino-STM32L4 into the one build script https://github.com/platformio/platform-ststm32/blob/develop/builder/frameworks/arduino.py

@ubis WDYT? How is your free time, university? 😊

GrumpyOldPizza commented 7 years ago

I would not want to have this merged with STM32Duino ... There is a STM32L0 core coming down the pipe, and one for nRF52 ;-) Given that they'd share all the same flavour, perhaps it's wise to separate this.

PS: I am not using PlatformIO, so I cannot speak to the implications.

On Tue, Feb 28, 2017 at 3:45 PM, Ivan Kravets notifications@github.com wrote:

I think we can merge STM32Duino with @GrumpyOldPizza https://github.com/GrumpyOldPizza arduino-STM32L4 into the one build script https://github.com/platformio/platform-ststm32/blob/develop/ builder/frameworks/arduino.py

@ubis https://github.com/ubis WDYT? How is your free time, university? 😊

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/platformio/platform-ststm32/issues/28#issuecomment-283185981, or mute the thread https://github.com/notifications/unsubscribe-auth/AG4QfESQe7EdfmH2hsq7jAqFAQYLN88Iks5rhKOigaJpZM4LiUHq .

ivankravets commented 7 years ago

@GrumpyOldPizza under "merge", I mean only "build script" based on PlatformIO Build System API. The source code of the cores will not be merged.

GrumpyOldPizza commented 7 years ago

Oki. If it helps any, the build is closer to ArdunioCore-samd. Only tricky part is that it produces 2 output files. One for direct flashing, and one for OTA.

On Tue, Feb 28, 2017 at 3:50 PM, Ivan Kravets notifications@github.com wrote:

@GrumpyOldPizza https://github.com/GrumpyOldPizza under "merge", I mean only "build script" based on PlatformIO Build System API. The source code of the cores will not be merged.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/platformio/platform-ststm32/issues/28#issuecomment-283187001, or mute the thread https://github.com/notifications/unsubscribe-auth/AG4QfJOnJ15kWdlRXO2PvKdDYm9-FvTXks5rhKSegaJpZM4LiUHq .

ubis commented 7 years ago

@ivankravets @GrumpyOldPizza I could take a look at it this weekend or better, next week.

ubis commented 7 years ago

Okay, quick update. I've added all boards from @GrumpyOldPizza repo:

===================================================================== [SUMMARY] =====================================================================

[SUCCESS]Environment dragonfly-l476re    
[SUCCESS]Environment butterfly-l433cc    
[SUCCESS]Environment ladybug-l432kc      
[SUCCESS]Environment nucleo_l432kc       
[SUCCESS]Environment nucleo_l476rg       

============================================================ [SUCCESS] Took 8.10 seconds ============================================================

Though builds built with PlatformIO are slightly bigger, same as with STM32F103's:

arm-none-eabi-size -B -d .pioenvs\dragonfly-l476re\firmware.elf
text       data     bss     dec     hex filename
49640      2132    7120   58892    e60c .pioenvs\dragonfly-l476re\firmware.elf

Sketch uses 32776 bytes (6%) of program storage space. Maximum is 507904 bytes. Now only a few issues are left to deal with... After that, I will push changes into my repo, so @GrumpyOldPizza , @blackketter and others could test it before merging it here.

@ivankravets where STM32L4 core sources will be? At the moment, i've moved them to arduinoststm32 framework folder, together with STM32F1/F2/F3. Also, there are options like USB Type and DOSFS Type. Didn't touched them yet. They could be set in platformio.ini file via build flags I guess...

GrumpyOldPizza commented 7 years ago

Ok, I am caught out at a bad point here. I was about to do some mayor restructuring. Naming of the board as well as directory structure. The current layout is not conforming to what Arduino wants to have the cores to follow.

On Fri, Mar 3, 2017 at 11:03 AM, ubis notifications@github.com wrote:

Okay, quick update. I've added all boards from @GrumpyOldPizza https://github.com/GrumpyOldPizza repo:

===================================================================== [SUMMARY] =====================================================================

[SUCCESS]Environment dragonfly-l476re [SUCCESS]Environment butterfly-l433cc [SUCCESS]Environment ladybug-l432kc [SUCCESS]Environment nucleo_l432kc [SUCCESS]Environment nucleo_l476rg

============================================================ [SUCCESS] Took 8.10 seconds ============================================================

Though builds built with PlatformIO are slightly bigger, same as with STM32F103's:

arm-none-eabi-size -B -d .pioenvs\dragonfly-l476re\firmware.elf text data bss dec hex filename 49640 2132 7120 58892 e60c .pioenvs\dragonfly-l476re\firmware.elf

Sketch uses 32776 bytes (6%) of program storage space. Maximum is 507904 bytes. Now only a few issues are left to deal with... After that, I will push changes into my repo, so @GrumpyOldPizza https://github.com/GrumpyOldPizza , @blackketter https://github.com/blackketter and others could test it before merging it here.

@ivankravets https://github.com/ivankravets where STM32L4 core sources will be? At the moment, i've moved them to arduinoststm32 framework folder, together with STM32F1/F2/F3. Also, there are options like USB Type and DOSFS Type. Didn't touched them yet. They could be set in platformio.ini file via build flags I guess...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/platformio/platform-ststm32/issues/28#issuecomment-284026184, or mute the thread https://github.com/notifications/unsubscribe-auth/AG4QfNGxRqusLwi1kEa3Fbp_8_T2E-kVks5riFYFgaJpZM4LiUHq .

ivankravets commented 7 years ago

@ubis Thanks a lot! 👍

After that, I will push changes into my repo

Would be good, I'll review the code. Please ping me.

where STM32L4 core sources will be? At the moment, i've moved them to arduinoststm32 framework folder

That is a right package.

Also, there are options like USB Type and DOSFS Type. Didn't touched them yet. They could be set in platformio.ini file via build flags I guess...

Can we move them to Board's JSON manifest?

GrumpyOldPizza commented 7 years ago

Ok, stupid big dummies question. Is there a way for me to integrate those options and such into a JSON file that goes along with the github archive on my side ?

On Fri, Mar 3, 2017 at 11:20 AM, Ivan Kravets notifications@github.com wrote:

@ubis https://github.com/ubis Thanks a lot! 👍

After that, I will push changes into my repo

Would be good, I'll review the code. Please ping me.

where STM32L4 core sources will be? At the moment, i've moved them to arduinoststm32 framework folder

That is a right package.

Also, there are options like USB Type and DOSFS Type. Didn't touched them yet. They could be set in platformio.ini file via build flags I guess...

Can we move them to Board's JSON manifest?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/platformio/platform-ststm32/issues/28#issuecomment-284030235, or mute the thread https://github.com/notifications/unsubscribe-auth/AG4QfFhAtqW8rBzFPKQYwdaspJDKY5ucks5riFn2gaJpZM4LiUHq .

ivankravets commented 7 years ago

@GrumpyOldPizza Good idea.

@ubis How about to move your contribution to @GrumpyOldPizza repository? Then just "include" main build file. I've done the same for ESP32 For Arduino, now they support integration with PlatformIO by self. See

Or, you can keep current work as you do, then I'll move "build logic" to @GrumpyOldPizza repository.

WDYT?

ubis commented 7 years ago

@ivankravets I think I will push to my repo, since I got some issues and been struggling for a while now... When it will be fixed, you could move it then.

EDIT: Seems like I fixed these issues, changes are pushed into my repo. Only what's left to add is flashing dfu/stlink.

Davey3D commented 7 years ago

I installed the repo linked above but still get: Error: This board doesn't support Arduino framework!

[env:nucleo_l432kc] platform = ststm32 board = nucleo_l432kc framework = Arduino

boristomas commented 6 years ago

@Davey3D i have exactly the same issue, any luck with that?

kriswiner commented 6 years ago

The L4 Arduino core does support two Nucleo boards: NUCLEO-L432KC and NUCLEO-L476RG. It is intended to support development boards like this https://www.tindie.com/products/TleraCorp/ladybug-stm32l432-development-board/ one sold on Tindie.

I am not sure what you are trying to do, but if you have the appropriate hardware, the instructions for using it can be found here https://github.com/GrumpyOldPizza/arduino-STM32L4.

If you have questions, please ask.

On Fri, Aug 31, 2018 at 11:00 AM Boris Tomas notifications@github.com wrote:

@Davey3D https://github.com/Davey3D i have exactly the same issue, any luck with that?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/platformio/platform-ststm32/issues/28#issuecomment-417744651, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qiQfhM9nOVRZYRoQikP_-f7WIrgxks5uWXm-gaJpZM4LiUHq .

boristomas commented 6 years ago

pretty much the same mas @Davey3D I have NUCLEO-L432KC and grumpyoldPizza has support for arduino and i am pretty sure their code is merged in platformio so i am stuck with the same error when running: [env:nucleo_l432kc] platform = ststm32 board = nucleo_l432kc framework = Arduino

kriswiner commented 6 years ago

Don't know anything about platform.io so no help from me. You could try just using the Arduino IDE, this should work fine.

ivankravets commented 5 years ago

We added support for official STM32 Core for Arduino. See supported boards https://github.com/stm32duino/Arduino_Core_STM32/blob/master/boards.txt

Please re-test with upstream version https://docs.platformio.org/en/latest/platforms/ststm32.html#upstream

darshanmirajkar commented 5 years ago

Hello, @ivankravets why still you guys didn't add https://github.com/GrumpyOldPizza/arduino-STM32L4 to platformio??