I'm currently developing with Keil µvision5 and STM32CubeMX on a Nucléo Board L053R8 (LQP64). Now I would like to transfer my program to my prototype board which has a STM32F051K6T8 (LQP32).

Do I have to re-code it ? Or can I just import my file?

I have tried to create a new project and import file one by one but it still link with my old project.

Do I have to change the Include and Source file?

  • \$\begingroup\$ You're asking how to create a 2nd copy of some/all the files in the IDE, so you can modify the relevant sections? \$\endgroup\$ – Sean Houlihane Jun 6 '18 at 11:08
  • 1
    \$\begingroup\$ You should be able to answer this better than any of us. Which portions of your code is specific to the hardware (LEDs connected to specific GPIOs, access to MCU peripherals, hardcoded memory addresses that may have to be relocated, ...), and which portions of your code is haedware-independant (purely algorithmic stuff)? \$\endgroup\$ – dim lost faith in SE Jun 7 '18 at 10:35

You have asked somewhat absurd question.

Do I have to re-code it ?

Of course! Start off by reading datasheet and listing what peripherals you used in your project. Although L0 is probably low power variant of F0, but you cannot guarantee everything is the same. For example, L0 operates at 32 MHz (maximum) but F0 can be clocked to 48 MHz and it doesn't seem to have "factory tested" USB hardware like L0.

Next thing to do is adapt your code. They both are Cortex M0 so the instruction set is the same and as I said before, change the code to suit the peripheral changes.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.