Skip to main content
MSadk.2
Associate
January 19, 2023
Question

MCU: STM32F030K6T. remape vector table scince the register VTOR is not availbe on this MCU.

  • January 19, 2023
  • 16 replies
  • 3501 views

MCU: STM32F030K6T. I have the problem remape vector table scince the register VTOR is not availbe on this MCU. I would like to ask how i can remape the vector table on this MCU to one of my application address 0x08001000 or 0x08004800. I have been doing this procces on STM32G030F6P and it was working fine. This is the code for G Type MCU int main(void){

if (IMAGE_1 == *((__IO uint32_t*) SRAM_SELECT_ADDRESS)) {

uint32_t addressImage1 = imageAddress(CONFIG_ADDRESS, IMAGE_1);

SCB->VTOR = addressImage1 + 4;

}

if (IMAGE_2 == *((__IO uint32_t*) SRAM_SELECT_ADDRESS)) {

uint32_t addressImage2 = imageAddress(CONFIG_ADDRESS, IMAGE_2);

SCB->VTOR = addressImage2 + 4;

}

 /* MCU Configuration--------------------------------------------------------*/

platform_start();

HAL_UART_Receive_IT(&huart2, uartRxbuffer, sizeof(uartRxbuffer));

while(1){

// waiting for an interrupt.

}

}

Thanks in advance for your help

This topic has been closed for replies.

16 replies

Wijeden RHIMI
ST Employee
January 20, 2023

You are using 1.11.0 as a version of stm32cubeIDE ?

MSadk.2
MSadk.2Author
Associate
January 20, 2023

1.9

MSadk.2
MSadk.2Author
Associate
January 20, 2023

im using 1.9

MSadk.2
MSadk.2Author
Associate
January 20, 2023

in data sheet of STM32F030K6T is written that this Register dose not  exist. so i dont think that it is a version problem of stm32cubeIDE

gbm
Lead III
January 20, 2023

I already wrote what needs to be done - just do it. Start by editing the linker script for your app - change RAM base to 0x200000c0, reduce its size to what it is minus 192 bytes. In the bootloader, just before jumping to the app, copy 192 bytes from app Flash start address to 0x20000000, map RAM at 0, then start the app as you did on any other MCU. Turn off all the interrupts (deacivate them, including SysTick, not by NVIC_DisableIRQ) in the bootloader before RAM remapping.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
MSadk.2
MSadk.2Author
Associate
January 20, 2023

thank you for your help :smiling_face_with_smiling_eyes: , but i need to do it in a way without modifing my linker script or using my RAM.

gbm
Lead III
January 24, 2023

That's simply not possible. RAM at 0 must be reserved for vector table, so you must play with a linker script in one or another way. There are many (not very nice but working) examples of this at github, just search the github for "STM32F0 bootloader".

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
MSadk.2
MSadk.2Author
Associate
January 24, 2023

thank you very much for your help :)