学习了,按照各位楼主的提示,已成功调试。
- int main(void)
- {
- /* USER CODE BEGIN 1 */
- [color=Red]IAP_Set();[/color]
- /* USER CODE END 1 */
- /* MCU Configuration----------------------------------------------------------*/
- /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
- HAL_Init();
- /* Configure the system clock */
- SystemClock_Config();
- /* Initialize all configured peripherals */
- MX_GPIO_Init();
- /* USER CODE BEGIN 2 */
- xTaskCreate( vLEDTask, ( const portCHAR * ) "LED", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+3, NULL );
- /* USER CODE END 2 */
- /* Call init function for freertos objects (in freertos.c) */
- MX_FREERTOS_Init();
- /* Start scheduler */
- osKernelStart();
-
- /* We should never get here as control is now taken by the scheduler */
- /* Infinite loop */
- /* USER CODE BEGIN WHILE */
- while (1)
- {
- /* USER CODE END WHILE */
- /* USER CODE BEGIN 3 */
- }
- /* USER CODE END 3 */
- }
- ……
- static void IAP_Set(void)
- {
- uint32_t i = 0;
- /* Relocate by software the vector table to the internal SRAM at 0x20000000 ***/
- /* Copy the vector table from the Flash (mapped at the base of the application
- load address 0x08003000) to the base address of the SRAM at 0x20000000. */
- for(i = 0; i < 48; i++)
- {
- *((uint32_t*)(0x20000000 + (i << 2)))=*(__IO uint32_t*)(0x08003000 + (i<<2));
- }
- /* Enable the SYSCFG peripheral clock*/
- __HAL_RCC_SYSCFG_CLK_ENABLE();
-
- /* Remap SRAM at 0x00000000 */
- __HAL_SYSCFG_REMAPMEMORY_SRAM();
- }
附图是地址偏移设置。
|