Can't get F( function to work....

NailBuster
Posts: 2
Joined: Mon Dec 26, 2016 9:52 pm

Can't get F( function to work....

Postby NailBuster » Mon Dec 26, 2016 10:04 pm

Hi, trying to 'play' with my maple mini.

Don't know if this is a general stm32duino issue or hardware specific so here goes. I'm trying to port a working app (works on esp8266 and UNO) and not having success. I've been debugging and found my first issue is this:

sample code:

Code: Select all

void setup() {
  // put your setup code here, to run once:
  Serial.begin(38400);

}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println(F("v2.1 boot"));
  delay(1000);

}


the F( function causes what I assume a board 'crash'....board is no longer responsive and I have to re-load a blink sketch to use the board again. If I remove the F( then code works fine.....

Any suggestions to get it to work?, as going through the entire project and removing all the F( isn't an ideal option.....

thanks....

stevestrong
Posts: 892
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Can't get F( function to work....

Postby stevestrong » Mon Dec 26, 2016 10:11 pm

It should have been fixed in the latest github repo. Which version do you use?

NailBuster
Posts: 2
Joined: Mon Dec 26, 2016 9:52 pm

Re: Can't get F( function to work....

Postby NailBuster » Mon Dec 26, 2016 10:32 pm

thanks for the help....you are correct it did solve the 'crash' using current sources.

I compiled and it no longer crashes.... good start.... however, now my next problem comes up with what should be a (64 char)long serial message string that uses F(, is only printing the first 3 chars.... I will have to investigate if it has to do the the F( function or it may be a different issue with sizeof...

thanks, at least now I can continue to try and port..... I'm excited to get the it fully working with the sm32!

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Can't get F( function to work....

Postby RogerClark » Tue Dec 27, 2016 10:08 am

If possible, its best to remove the F macro's from all your code, as that macro is only relevant on the AVR architecture.

The F macro on STM32 and on boards like the Arduino Due and Arduino Zero etc, are just a dummy wrapper.

Try removing them.


Return to “Maple mini”

Who is online

Users browsing this forum: No registered users and 1 guest