2023-01-19 12:04 AM
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
2023-01-20 05:52 AM
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.
2023-01-20 05:55 AM
You are using 1.11.0 as a version of stm32cubeIDE ?
2023-01-20 05:59 AM
1.9
2023-01-20 06:19 AM
im using 1.9
2023-01-20 06:21 AM
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
2023-01-20 06:49 AM
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.
2023-01-20 06:54 AM
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.
2023-01-24 02:30 AM
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".
2023-01-24 03:49 AM
thank you very much for your help :)