FILE *f; int main() { SystemInit(); finit(); f=fopen("M:\\Temp_Files\\1.jpg","w"); while(f==NULL); fclose(f); } //This program can run and creat a new file "1.jpg",but... int main() { SystemInit();
init_io(); init_TcpNet();
finit(); f=fopen("M:\\Temp_Files\\1.jpg","w"); while(f==NULL); fclose(f); } //But this program can't creat a new file,I don't know the reason.Is there some collisions between RL-FlashFS and RL-TcpNet? static void init_io () {
/* Set the clocks. */ SystemInit(); RCC->APB2ENR |= 0x00000279;
/* Configure the GPIO for Push Buttons */ GPIOB->CRH &= 0xFFFFFF0F; GPIOB->CRH |= 0x00000040; GPIOC->CRH &= 0xFFF0FFFF; GPIOC->CRH |= 0x00040000;
/* Configure the GPIO for LEDs. */ STM_EVAL_LEDInit(LED1); STM_EVAL_LEDInit(LED2); STM_EVAL_LEDInit(LED3); STM_EVAL_LEDInit(LED4);
/* Configure UART2 for 115200 baud. */ AFIO->MAPR |= 0x00000008; GPIOD->CRL &= 0xF00FFFFF; GPIOD->CRL |= 0x04B00000;
RCC->APB1ENR |= 0x00020000; USART2->BRR = 0x0135; USART2->CR3 = 0x0000; USART2->CR2 = 0x0000; USART2->CR1 = 0x200C;
/* Configure ADC.14 input. */ GPIOC->CRL &= 0xFFF0FFFF; ADC1->SQR1 = 0x00000000; ADC1->SMPR1 = (5<<12); ADC1->SQR3 = (14<<0); ADC1->CR1 = 0x00000100; ADC1->CR2 = 0x000E0003;
/* Reset calibration */ ADC1->CR2 |= 0x00000008; while (ADC1->CR2 & 0x00000008);
/* Start calibration */ ADC1->CR2 |= 0x00000004; while (ADC1->CR2 & 0x00000004); ADC1->CR2 |= 0x00500000; } Thank you for reading my question!