This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

programming stm32f030k6 using keil

Hi, I am a newbie in stm32 and c++ programming.I m currently working with an STM32f030k6 custom board with the 16MHZ oscillator.I want to read raw data from mpu6050 from i2c communication.I m using keilv5 software IDE version 5.23.
1>I have observed that there are no standard peripheral libraries for .cpp files as in for c the stm32cubemx helps in providing initializing c code for the stm32f030k6 device using HAL Libraries as there is no such thing for c++ ?? there is Peripheral Template Library but for STM32VLDISCOVERY, it uses GCC compiler.I would like to know if GCC compiler is necessary to compile .cpp files or the arm compiler is enough in keil??
2>I would like to know if I can import the .cpp and .h files of Arduino code libraries in keil software directly ??
Please help me to proceed further

Parents
  • "I am a newbie in stm32 and c++ programming"

    Are you familiar with any other programming languages, and/or any other platforms?

    It's generally best not to try to do too many new & unfamiliar things all at once.

    It's probably easier to learn C++ (or 'C') on a PC first then, when you have the basics of the language, move on to the embedded platform.

    As already noted, the vast majority of examples & support for this kind of thing are currently in 'C' - not C++. So you should think carefully about whether you really want to be a trailblazer - and, therefore, substantially on your own - or swimming in the main stream.

    As for the compilers themselves - Keil and GCC - they are both quite capable of 'C' and C++.

    "I would like to know if I can import the .cpp and .h files of Arduino code libraries in keil software directly ?"

    That would depend on what you mean by, "directly".

    Certainly, Arduino .ino files are just C++ source. But you would have to do quite a lot of work to correctly set up a Keil project to build an Arduino "sketch"

    Note that the vast majority of Arduino code is for the Microchip (formerly Atmel) 8-bit AVR - so will not be directly usable in Keil (which has no AVR support).

    Atmel Studio can import an Arduino "sketch" and make it into a "standard" C++ project...

Reply
  • "I am a newbie in stm32 and c++ programming"

    Are you familiar with any other programming languages, and/or any other platforms?

    It's generally best not to try to do too many new & unfamiliar things all at once.

    It's probably easier to learn C++ (or 'C') on a PC first then, when you have the basics of the language, move on to the embedded platform.

    As already noted, the vast majority of examples & support for this kind of thing are currently in 'C' - not C++. So you should think carefully about whether you really want to be a trailblazer - and, therefore, substantially on your own - or swimming in the main stream.

    As for the compilers themselves - Keil and GCC - they are both quite capable of 'C' and C++.

    "I would like to know if I can import the .cpp and .h files of Arduino code libraries in keil software directly ?"

    That would depend on what you mean by, "directly".

    Certainly, Arduino .ino files are just C++ source. But you would have to do quite a lot of work to correctly set up a Keil project to build an Arduino "sketch"

    Note that the vast majority of Arduino code is for the Microchip (formerly Atmel) 8-bit AVR - so will not be directly usable in Keil (which has no AVR support).

    Atmel Studio can import an Arduino "sketch" and make it into a "standard" C++ project...

Children
No data