2018-01-06 09:29 AM
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.2018-01-07 01:17 PM
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?
2018-01-07 08:32 PM
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.
2018-01-07 10:03 PM
#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 Cint 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 Display2018-01-07 10:57 PM
Yes, right. We need more information to judge what is easier to do.
2018-01-07 11:13 PM
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.
2018-01-07 11:15 PM
Okie sir
2018-01-07 11:16 PM
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...
2018-01-07 11:17 PM
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
2018-01-07 11:19 PM
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