Arduino IDE fail to compile stm32f4

Development environment specific, Arduino, Eclipse, VS2013,Em::Blocks etc
Post Reply
deptou
Posts: 6
Joined: Sun Aug 21, 2016 9:09 am

Arduino IDE fail to compile stm32f4

Post by deptou » Sun Aug 21, 2016 9:33 am

Hello everybody,

I am new to this forum, so there may already be a similar topic, but I have found nothing.
Here's my problem:
I try to build a program for a card with a stm32f4xx and the code executes only the setup and the loop of the arduino ide. All sub routines are ignored and I do not understand why, when I compile the same code for a stm32f103, it works well.

i turn on and off the LED card at several points to check the passage of the program and only the commands in the loop setup and operate.
When I add or remove lines of code, file length is changed, so the compiler seems to work.

Well, I hope I am clear enough.

Thank you for your answers.

Pierre

User avatar
Pito
Posts: 1386
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Arduino IDE fail to compile stm32f4

Post by Pito » Sun Aug 21, 2016 9:50 am

If you use something F103' specific inside your subroutines and you compile it for F407 you might see no action.
Double check you compile it for the F407 target.
Another cause could be the specific F407 functionality inside your subroutines has not been implemented yet.
Pukao Hats Cleaning Services Ltd.

deptou
Posts: 6
Joined: Sun Aug 21, 2016 9:09 am

Re: Arduino IDE fail to compile stm32f4

Post by deptou » Mon Aug 22, 2016 4:31 pm

Hi Pito,

thank you for your reply,
I have modified the sketch to use the features of m4 cortex, but it seems that the compiler ignores all statements other function Setup and loop.

I do not understand.

greetings

Look at part of the code-> the functions Lcd_init et setXY aren't executed... and the the code run, the in board led blink.

#define WR PB0

#define DA0 PA0
#define DA1 PA1
#define DA2 PA2
#define DA3 PA3
#define DA4 PB12
#define DA5 PB13
#define DA6 PB14
#define DA7 PB15

#define NOP __asm__ __volatile__ ("nop\n\t")

void setup()
{
pinMode (PA0, OUTPUT);
pinMode (PA1, OUTPUT);
pinMode (PA2, OUTPUT);
pinMode (PA3, OUTPUT);
pinMode (PB0, OUTPUT);
pinMode (PB1, OUTPUT);
pinMode (PB12, OUTPUT);
pinMode (PB13, OUTPUT);
pinMode (PB14, OUTPUT);
pinMode (PB15, OUTPUT);
pinMode (PC0, OUTPUT); //rst pour test
pinMode (PA5, OUTPUT);

GPIOA->regs->OSPEEDR = GPIO_OSPEED_2MHZ;
GPIOB->regs->OSPEEDR = GPIO_OSPEED_2MHZ;

GPIOA->regs->ODR = 0x00;
GPIOB->regs->ODR = 0x00;

digitalWrite(PC0, LOW);
delay(100);
digitalWrite(PC0, HIGH);
delay(50);


pinMode(BOARD_LED_PIN, OUTPUT);
digitalWrite (BOARD_LED_PIN, HIGH);
delay(1000);

Lcd_init();
}

void loop()
{
//digitalWrite (BOARD_LED_PIN, LOW);
GPIOA->regs->BSRRH = 0b0000000000100000;
delay(100);
//digitalWrite (BOARD_LED_PIN, HIGH);
GPIOA->regs->BSRRL = 0b0000000000100000;
delay(100);
}

void Lcd_init() {
LCD_Write_COM(0x01);
delay(50);
LCD_Write_COM(0x28);

LCD_Write_COM(0x36);
LCD_Write_DATA(0x88);

LCD_Write_COM(0x3A);
LCD_Write_DATA(0x55);

LCD_Write_COM(0x11);
delay(150);

setXY(0,0,379,419);

LCD_Write_COM(0x29); //display on

delay(150);
}

void setXY(int x1, int y1, int x2, int y2)
{
LCD_Write_COM(0x2a);
LCD_Write_DATA(x1>>8);
LCD_Write_DATA(x1);
LCD_Write_DATA(x2>>8);
LCD_Write_DATA(x2);
LCD_Write_COM(0x2b);
LCD_Write_DATA(y1>>8);
LCD_Write_DATA(y1);
LCD_Write_DATA(y2>>8);
LCD_Write_DATA(y2);
LCD_Write_COM(0x2c);
}

and etc...

User avatar
Pito
Posts: 1386
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Arduino IDE fail to compile stm32f4

Post by Pito » Mon Aug 22, 2016 5:02 pm

You MUST call your functions within setup() or loop(). Otherwise the functions will not be executed.
Like:

Code: Select all

void setup() {
..
myfun1();
myfun2();
}
void loop() {
myfun3();
myfun4();
}

myfun1() {
..
}
myfun2() {
..
}
myfun3() {
..
}
myfun4() {
..
}
Pukao Hats Cleaning Services Ltd.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest