Question
stm32F0 CDC out of work after vector-table relocation
Hi,
I have an application running on the stm32F072C8U6.
It has a 'bootloader' application at 0x08000000, which successfully jumps to the 'real' application, at 0x08004000.
after vector remap, GPIO USB Keypad works fine, but when PC send a message by USB CDC.
it caused the MCU out of work.
Thanks.
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
Remap_Table();
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
}
void Remap_Table(void)
{
// Copy interrupt vector table to the RAM.
volatile uint32_t *VectorTable = (volatile uint32_t *)0x20000000;
uint32_t ui32_VectorIndex = 0;
for(ui32_VectorIndex = 0; ui32_VectorIndex < 48; ui32_VectorIndex++)
{
VectorTable[ui32_VectorIndex] = *(__IO uint32_t*)((uint32_t)0x08004000 + (ui32_VectorIndex << 2));
}
__HAL_RCC_AHB_FORCE_RESET();
// Enable SYSCFG peripheral clock
__HAL_RCC_SYSCFG_CLK_ENABLE();
__HAL_RCC_AHB_RELEASE_RESET();
// Remap RAM into 0x0000 0000
__HAL_SYSCFG_REMAPMEMORY_SRAM();
}
