Showing results for 
Search instead for 
Did you mean: 

Porting code from STM32 Nucleo (F103RB) to STM32F103VG

Associate II
Posted on June 25, 2018 at 18:13

Hi, I am having an issue when I try to load code to my STM32F103VG device over the KEIL interface.

I have written code for the STM32 Nucleo-64 board which contains #STM32F103RBT6 device and it works without any issue. This is working in conjunction with the #PowerSTEP01 board.

I then port the code to the #STM32F103VG device and it is here that the issues begin

The code compiles and seems to load ok also, based on the KEIL interface status. But I have a thread running to flash a LED, and this LED does not flash.

When I change the microcontroller target device to STM32F103RB in the options screen, and reduce the thread stack sizes the code loads and runs. I then introduce the threads and the code runs as expected. I change the microcontroller target device to STM32F103VG and the code is operating as expected also.

While the issue is ongoing, if I launch debug mode the code is executing automatically before I get the chance to press F5.

Has anybody had any experience with this issue before?

Thank you

Posted on June 25, 2018 at 18:43

Use WinMerge on the startup_stm32f1xx.s files between the two, and pay attention to the different IRQ Handlers and naming where those support more/less functionality.

Can't say I've looked at the data sheets for the specific F1 involved here, there are typically a different selection of peripherals, and available memory. One technique is to create a donor project for the new architecture (chip or board), and then merge across the differences. This also highlights where changes will cause issues.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 26, 2018 at 17:42



Thanks Clive. ,I noted the differences between both files and there were some new ♯ IRQHandlers for some peripherals but there were also some that had an extended name. ,For example, TIM8_BRK_IRQHandler from the RB startup file is now called TIM8_BRK_TIM12_IRQHandler in the VG startup file.

This change did not carry over to the ♯ stm32f10x_it.c file though. ,Am I correct in saying that this should not be an issue as I am not using these interrupts?