2019-01-23 05:23 AM
I use __HAL_SYSCFG_REMAPMEMORY_SRAM(); this function ,but MX_USB_DEVICE_Init(); can't work.
After I went to debug tool ,it appear cannot access memory this problem.
I don't know how to solve it.
Maybe it should register address problem,or init address error.
Solved! Go to Solution.
2019-01-23 05:56 AM
If you don't see ROM mapped, check SYSCFG clock is enabled prior to remapping.
2019-01-23 05:56 AM
If you don't see ROM mapped, check SYSCFG clock is enabled prior to remapping.
2019-01-23 06:26 AM
this is my main code .
I can current SYSCFG clock is enabled status .
If I want to see ROM mapped, I should watch memory address 0x08004000 ,isn't.
#define MAIN_CODE_ADDRESS 0x08004000
__IO uint32_t VectorTable[48] __attribute__((section(".RAMVectorTable")));
int main(void)
{
/* USER CODE BEGIN 1 */
uint32_t i = 0;
/* USER CODE END 1 */
/* MCU Configuration----------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_DeInit();
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
for(i = 0; i < 48; i++)
{
VectorTable[i] = *(__IO uint32_t*)(MAIN_CODE_ADDRESS + (i<<2));
}
__HAL_SYSCFG_REMAPMEMORY_SRAM();
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_DMA_Init();
MX_I2C1_Init();
MX_CAN_Init();
MX_USB_DEVICE_Init(); //cannot access memory
MX_USART3_UART_Init();
MX_DAC_Init();
MX_ADC_Init();
MX_TIM1_Init();