cancel
Showing results for 
Search instead for 
Did you mean: 

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

MSadk.2
Associate II

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

18 REPLIES 18
MSadk.2
Associate II

Hi, thanks for your answer. the problem is that VTOR Register is not provided on this MCU STM32F030K6T. here is the problem point in this project.

I made a new projekt and wrote SCB->VTOR = 0x08001000; then i have the problem. My question is if there is any way to make simmlier step to that becuase this register is dose not exist.

Wijeden RHIMI
ST Employee

You are using 1.11.0 as a version of stm32cubeIDE ?

MSadk.2
Associate II

1.9

MSadk.2
Associate II

im using 1.9

MSadk.2
Associate II

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

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.

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

gbm
Lead III

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".

thank you very much for your help 🙂