cancel
Showing results for 
Search instead for 
Did you mean: 

Hello am working on STM32L476RG development Board i am trying to develop a smart watch as part of my masters academic project when trying to import the code from mbed complier the code is compiled but it is not being dumped may I know the reason for it

Rajyalakshmi Pydimarri
Associate II
Posted on January 06, 2018 at 18:29

Hello am working on STM32L476RG development Board i am trying to develop a smart watch as part of my masters academic project when trying to import the code from mbed complier the code is compiled but it is not being dumped may I know the reason for it

Note: this post was migrated and contained many threaded conversations, some content may be missing.
17 REPLIES 17
Posted on January 07, 2018 at 22:17

Maybe it's easier to implement the same logic of the application on the application skeleton generated by STM32CubeMX?

I guess you want to do further development ouside of the mbed environment using regular IDEs like Keil or so?

Posted on January 08, 2018 at 04:32

If he is using third party C++ Arduino libraries, those may need C language conversion. It may become even harder if dependencies are multiple...

Also, if he is using a graphic LCD/OLED library, he may do better if he will search for such a library written in C for AVR or PIC microcontrollers if there is no one written for HAL/LL STM32 as such a library is easier to adapt. 

Rajyalakshmi Pydimarri
Associate II
Posted on January 08, 2018 at 07:03

#include 'mbed.h'

#include 'Adafruit_SSD1306.h'

#include 'mlx90614.h'

DigitalOut myled(LED1); //displays I2C wait

I2C i2c(PA_10,PA_9);// Serial1_RX=PA_10;Serial1_TX=PA_9

I2C i2cx(PB_9,PB_8);//I2C1_SDA=PB9;I2C1_SCL=PB_8

Serial pc(USBTX,USBRX);  //serial usb config

Adafruit_SSD1306_I2c myOled(i2c,NC,0x78,64,128);

MLX90614 IR_thermometer(&i2cx);

float temp; //temperature in degrees C

int main()

{   

    uint16_t x=0;

    

    myOled.begin();

    myOled.printf('%ux%u \n Hellow World \r\n', myOled.width(), myOled.height());

    myOled.display();

    while(1)

    {

        

        myOled.printf('%u\r',x);

        myOled.display();

        x = x + 1;

        myled=1; // if led1 on - waiting on I2C

        if (IR_thermometer.getTemp(&temp)) {

            //gets temperature from sensor via I2C bus

            myled=0;

            //print temperature on PC

            myOled.printf('Temperature is %5.1F degrees C\r\n',temp);

        }

        //wait for device to produce next temperature reading                         

        wait(0.5);

    }

}

This is the piece of code being used to read the temperature and display it on to the oled Display
Posted on January 08, 2018 at 06:57

Yes, right. We need more information to judge what is easier to do.

Posted on January 08, 2018 at 07:13

If the code is ok and verified on an Arduino hardware, mbed should provide a functional firmware after compilation. Try to divide the application, checking the functionality of each device. Try to make something simple that sends a text on serial, then add the temperature sensor that sends the values on the serial. Then check the OLCD separately, then combine them. 

Posted on January 08, 2018 at 07:15

Okie sir

Posted on January 08, 2018 at 07:16

Under Linux, I never was able to use the Nucleo as a disk, so I had to download the firmware and burn it with the st-flash application...

Posted on January 08, 2018 at 07:17

But this piece of code is not been accepted for arduino IDE and may In know how can a piece of code written for Arduino board be converted to STM32 board as i had setup the Arduino IDE as STM32Duino

Posted on January 08, 2018 at 07:19

sir can you please provide me with that st-flash application link

I am working on ubuntu platform my board is being detected but the program is not stored