Skip to content

compilation fail for STM32F103C (Blue Pill) #741

Closed

Description

@AndKe
home/andre/Arduino/projects/libraries/FastLED/platforms/arm/stm32/led_sysdefs_arm_stm32.h:4:25: fatal error: application.h: No such file or directory
 #include <application.h>
                         ^
compilation terminated.

tested FastLED 3.2.1 ... 3.2.6(current release)

@kolyshkin you surely have a working version?

Activity

  1. kolyshkin commented on Feb 20, 2019

    @kolyshkin
    Contributor

    I took a look yesterday and I can't figure out where the hell application.h is coming from. Note that I'm not the one who added this #include statement. All in all, this is still a mystery to me :-\

    I took another look, and it seems that application.h is some file which is auto-generated by Arduino.

    Perhaps you can either try

    1. changing <application.h> to "application.h", or
    2. just commenting this line altogether.
  2. kolyshkin commented on Feb 20, 2019

    @kolyshkin
    Contributor

    For the reference, this #include "applcation.h" statement was added by commit f149084 (by @focalintent) and later changed to #include <application.h>" (which I believe is wrong since it's supposed to be a local include) by commit 6fd2366.

    @AndKe which arduino version are you using? Please try the workarounds I provided above, let us know if it helps.

  3. kolyshkin commented on Feb 20, 2019

    @kolyshkin
    Contributor

    Well, I have removed #include <application.h> and everything seems working just fine. Not sure why it worked for me before, and if this is a correct solution.

    Now I have to dig a blue pill out of my closet and give it a try )

  4. kolyshkin commented on Feb 20, 2019

    @kolyshkin
    Contributor

    @focalintent maybe you can shed some light? It seems this #include <application.h> is some kind of leftover that needs to be removed

  5. focalintent commented on Feb 21, 2019

    @focalintent
    Contributor

    The stm32 code was originally done for the particle photon boards and that platform needed the application.h - support for other stm32 variants has mostly come in from folks tweaking things to support other stm32 based boards, and they never took it out - if someone can figure out when it should be there vs when not - I’d prefer being able to gate when the include is used - otherwise I’m removing it I just open myself up to a bunch of issues complaining about things missing :)

  6. kolyshkin commented on Feb 21, 2019

    @kolyshkin
    Contributor

    Oh, in such case it should be very easy to fix -- since the original code used STM32F10X_MD define, this is what we should use :)

    @focalintent PTAL at #742

  7. AndKe commented on Feb 21, 2019

    @AndKe
    Author

    I tried FastLED master, on Arduino 1.8.8

    FastLED.addLeds<NEOPIXEL, RGB_FL>(leds, 0, NUM_LEDS_PER_STRIP);

    RGB_FL is PAx or PBx throws this error:

    /home/andre/Arduino/projects/libraries/FastLED/fastpin.h:207:2: error: static assertion failed: Invalid pin specified
    

    certainly an improvement, but it does not seem to "understand" PA0 pr PB6 or any other ports/pins I tried.

    • other references to PA or PB pins work as expected, it is only this library that seems to have an issue with them.

    I see the library defines blue pill pins, and fail to understand why it would not do so, with these defines:

    /home/andre/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOC -DERROR_LED_PIN=13 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10808 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DSERIAL_USB -DGENERIC_BOOTLOADER -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -DARDUINO_ARCH_STM32 -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -DARDUINO_ARCH_STM32 -I/home/andre/.arduino15/packages/stm32duino/hardware/STM32F1/2019.2.4/system/libmaple -I/home/andre/.arduino15/packages/stm32duino/hardware/STM32F1/2019.2.4/system/libmaple/include -I/home/andre/.arduino15/packages/stm32duino/hardware/STM32F1/2019.2.4/system/libmaple/stm32f1/include -I/home/andre/.arduino15/packages/stm32duino/hardware/STM32F1/2019.2.4/system/libmaple/usb/stm32f1 -I/home/andre/.arduino15/packages/stm32duino/hardware/STM32F1/2019.2.4/system/libmaple/usb/usb_lib -I/home/andre/.arduino15/packages/stm32duino/hardware/STM32F1/2019.2.4/cores/maple -I/home/andre/.arduino15/packages/stm32duino/hardware/STM32F1/2019.2.4/variants/generic_stm32f103c /tmp/arduino/sketch/Mav2HoTT-bluepill.ino.cpp -o /dev/null
    /
    
  8. focalintent commented on Feb 21, 2019

    @focalintent
    Contributor

    What is the actual value for RGB_FL - if there isn’t a definition for that pin in platforms/arm/stm32/fastpin_stm32.h, then that will cause this error (for performance reasons, FastLED does its own definitions/mappings for pins to ports)

  9. focalintent commented on Feb 21, 2019

    @focalintent
    Contributor

    Looking at the commit for blue pill support - it looks like it doesn’t have pin definitions for all the pins on the blue pill board (eg pins 25-28, possibly others?)

  10. AndKe commented on Feb 21, 2019

    @AndKe
    Author

    I tried PA0...6 and PB5..9 (mentioned it before) so RGB_FL is/was PA0 , then PA1 and so on
    to me, it seems like all the pins I tried to use are just fine here: https://github.com/FastLED/FastLED/blob/master/platforms/arm/stm32/fastpin_arm_stm32.h#L107

  11. focalintent commented on Feb 21, 2019

    @focalintent
    Contributor

    What’s the whole compiler output - there should be more context to that message to show what it thinks RGB_FL is - Also where is RGB_FL getting defined? It wasn’t referenced in the Arduino STM32 core that I found.

  12. focalintent commented on Feb 21, 2019

    @focalintent
    Contributor

    Oh - also, what happens if you use integers instead of PA*? I generally tell folks to use integer pins - because on some platforms D* or other ways of defining pins end up not being constant expressions.

  13. focalintent commented on Feb 21, 2019

    @focalintent
    Contributor

    Oh - I see what you mean, you’re defining RGB_FL to be something like PA0 - it depends on how the core/platform you’re using defines PA0 and friends. But again, I generally discourage the use of named pins vs PIN numbers (there’s a reason you never see D10 in an example, but rather just 10)

  14. AndKe commented on Feb 21, 2019

    @AndKe
    Author

    yes, using integers build it successfully... except:
    "Sketch uses 96600 bytes (147%) of program storage space. Maximum is 65536 bytes"

    this is kind of crazy, I had this program, with the same libraries, fit on a Atmega 328 just fine, but not on this 64k STM32
    Something must be eating lots of space ?

  15. AndKe commented on Feb 21, 2019

    @AndKe
    Author

    ..if I omit FastLED library and a few kb of code related to it, I am down to 52% of space.

  16. focalintent commented on Feb 22, 2019

    @focalintent
    Contributor

    That sounds odd - I wonder if the stm32 compiler is doing a poor job of pruning unreferenced code?

  17. kolyshkin commented on Feb 22, 2019

    @kolyshkin
    Contributor

    Haha, @AndKe, you're following my steps! The reason is, you need to add a flag. Please see rogerclarkmelbourne/Arduino_STM32#444
    and
    rogerclarkmelbourne/Arduino_STM32#296

  18. AndKe commented on Feb 22, 2019

    @AndKe
    Author

    @kolyshkin
    "I generally tell folks to use integer pins" I tried to use integers like 10 for PA0 , 11 for PA1 , then it compiles but the application does not seem to run on microcontroller (crashes ( hangs at FastLED.addLeds) (I see it on UART activity)
    then I tried 14,15,16,17 for PA4,5,6,7 then it runs, but the led strips does not do anything

    as for the compiler flags, I hope that becomes a permanent fix at some point, or easily selectable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions