-
FatFS TF卡创建读写文件正常,插电脑上空白
用的是HC32F4A0,目前做了: [list=1] [*]在电脑上对SD卡格式化为Fat32格式 [*]为了确定写入了SD卡,而不是读取缓存。写入文件后,将文件关闭,再以READ模式打开,进行读取,也是可以读的。 [/list][img]data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaEAAABmCAIAAADtULktAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAEXRFWHRTb2Z0d2FyZQBTbmlwYXN0ZV0Xzt0AABGuSURBVHic7Z1/cBtlesefd+Pelfao1bn27kqcX7Ykbhxfb3BIASlzKQR1YofQ+K6Ya4/BOSBWJz2QSmNm6vExdze50KszvRUMbuVAL6bXg4gJ8k0iy60JSWAk8IWYXkbxtJYsLk3ggLlyCj4CWCtt/1hptZJ25dWPyPb6+xn9sfvs8z777sr79ftD+7xMFEUCAACDwi12BQAA4CoCjQMAGBloHADAyDScmoqVW+ZP283y9nDgXE3rAwAAtaSBMVZNea664gAAcFVpqFKkOA69XQDA0qXadlyVxQEA4KrSwDhu1aPuBf1S3+NV7RwHjQMALC2uH+qXt/W247Tc0FcFACxl9I7Habnl21/+1217Xtpx6McPf0U2vXv06383RPc889z21VVVtDzeGvnuvbO7Tnzvy3U8JwDg6nHPtuuVuz8+8T86CzYwxuSXuW72+4nota4ueUP202rHsby+KiMiCrx4bt/WrLhc+K/TbxDdwDjG6tTguzD+Lce/0Q0WsjJM+gJgIP795AwRfeNWKxUqjyY3+/0NjONkjZPUrVjgiIhp9Enz+6qMUfu2ndHRFy7e8BfriIgmn568bWDb+THGSY6nn9p6/wki2vn0s/u2Ep1+auuTtJNOHJuyPnii6xfbfnBMPqRwpvZ7f+LrWE05/zet2+g5ujf2wE1EkwN/+Yz5h0/u/kKmDhs6h2KddPqprRMMHWkADITygdb5cL/W1cUVtHUkaSsQOCLiGJM/WnaOESNq+qu/WXvy1HuMcYyde2XmFtsGRsSk3YP3s8HZIy+/1PPmk+NvS/5TF9cfPPLst+mJbWe/Mnvk2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ZMd6PPuHF3pmanV/tJ4LLTviVBZHk1rOq4pilM+035WTmJKldyzXupeOFrb1s/NTip5o3jyaql2rPyuKohiN8r2Zo7besWh2gqbAu2CuTj6usOfFyb8BknsZ03Vak3vlTfpFxzI1yl2Y5v0sK06p+1lmfSq5rgL/XG0K/mQWnmBVO6/ye9Q391yj+1P8XJS2I05lcVRViyUSiaLvTJO5ubmmpialJRAIbNmyheqVthgAALRQXcwA7zkAAIwMNA4AYGSgcQAAI5PTOLfbXXCs2AIAAMuLvHacUtQgcAAAA1DYV5WkDQIHADAGOY3jeV7akAVOtgAAwDIlrx2nFLXKBG55549bIL9YcV65sllq+bYQB3GMFEed4p8F7969e4Xmjyv1k3yVvHJls9TybSEO4hgpjv78cRV3UQ2QP07z0rTyypXzvupSy7eFOIhjpDhaIH9cLn9c3gFFH1Yrr1y1LLV8W4iDOEaKkwX543L547Tyi2nmlSOqLH8cAKBuIH9cLn9cvj2XX0wrr1z5LLV8W4iDOEaKow7yx+Xyx5WbX0wqr388bqnl20IcxDFSHE2QP04jT1zhXK9G6rLy8scttXxbiIM4RoqD/HEAACOD/HEAgBUHNA4AYGSgcQAAIwONAwAYGWgcAMDIQOMAAEYGGgcAMDI11rjlnT8uW8ZuL0yPUps8Vksv3xbiII6R4qhTy/cclnv+OFGM8r29/Fi06BWHSq6rmKWWbwtxEMdIcfTnj6uYZZ8/LuYZnN7ldXWY81+6L5nHCvnjEAdxlkQcLZA/TpE/LjodoRm5cxvUEuJK81jpjbPc83YhDuIshThZ/h9r7U9FwlK7hgAAAABJRU5ErkJggg==[/img] 但是把SD卡插到读卡器上,看到的就是空白。有没有大佬知道这是为什么 代码附上 #include "FileEdit.h" #include "ff.h" #include "stdio.h" #include "BSP_Timer_INT_Count.h" FATFS fsobject; FIL fp; BYTE work[FF_MAX_SS]; const char write_buf[] = "abcdefg"; char read_buf[FF_MAX_SS] = ""; UINT bw; UINT br; void FatFS_Test(void) { FRESULT res; /* 挂载文件系统 */ res = f_mount(&fsobject, "0:", 1); //挂载fsobject到文件系统、0: 存储器路径,也就是SD卡、1立即挂载 if(res != FR_OK) { res = f_mkfs("0:", 0, work, sizeof(work)); res = f_mount(NULL, "0:", 1); res = f_mount(&fsobject, "0:", 1); } /* 打开、创建文件 */ f_mkdir("0:/dir0"); res = f_open(&fp, "0:/dir0/qwerpoiu.txt", FA_CREATE_ALWAYS | FA_WRITE | FA_READ); if(res == LL_OK) { res = f_write(&fp, write_buf, sizeof(write_buf), &bw); f_close(&fp); res = f_open(&fp, "0:/dir0/qwerpoiu.txt", FA_READ); if(res==LL_OK) { f_lseek(&fp, 0); res = f_read(&fp, read_buf, f_size(&fp), &br); __nop(); } else f_close(&fp); } f_unmount("0:"); }[img]data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA1wAAAEDCAIAAACuwJKYAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAEXRFWHRTb2Z0d2FyZQBTbmlwYXN0ZV0Xzt0AABqmSURBVHic7d1/TNT34cfxl7XJxG1dMsXjEPpNGrWR1nMFU2naGnGKTT2sCWxO/eO8qiyaeDrqEpDGtESEZCm2H5OSOM15f2hHh0sjZ2evTo2NoRrBcWaYGdfE8uM4b6yJTvGfyfePz91xPzhAUFF5Pv5ojs997nOfw19P3u/359NJ/f39AgAAwMT2zHifAAAAAMYfUQgAAACiEAAAANKzV69eHe9zAAAASDRnzpxh9yFjHqBnR/IdBwAASHD16tWHVxEjrz1K5kFh+hgAAABEIQAAAIhCAAAAiCgEAACAiEIAAACIKAQAAICIQgAAACghCnt7excsWNDb25uwU29vb2Zm5qRJk372s5/5/X5zY11dXWZmZvLO4yLVmQMAAAwudPZofcTRs1dC430+4+2Z48ePT4qYPn16S0vL9OnTo1uOHz9u7ldQUNDb21tQUOD1es2n3nvvvUAgYO68ZMmSvr6+B3VOvb29c+fOjdanJL/fv2rVqkHfoq6uLvnMh6jVuro6p9PZ19e3ZMmS6MeMPX+n01lXV/egPgsAABPch/HG+3Qirhytb9SizRGL0t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AAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAEFEIAAAAEYUAAAAQUQgAAAARhQAAABBRCAAAABGFAAAAkPT/xQR8E7ejNGUAAAAASUVORK5CYII=[/img]
2595浏览量 2回复量 关注量 -
MM32F103定时器PWM输入捕获失败
配置代码如下,有个PWM信号需要输入捕获计算频率,经查询数据手册PB11可以复用为TIM2_CH4,但怎么配置都不能正常进捕获中断,IC和PWM方式都试了不行,想问各位大佬该配置有啥问题,有没有什么解决办法 /*功能名称IM4_PWMINPUT_INIT(u16 arr,u16 psc) 描述 PWM输入初始化*/ void TIM2_PWMINPUT_INIT(u16 arr, u16 psc) { TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; NVIC_InitTypeDef NVIC_InitStructure; TIM_ICInitTypeDef TIM2_ICInitStructure; GPIO_InitTypeDef GPIO_InitStructure; RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); //Open TIM4 clock RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); //open gpioB clock GPIO_PinRemapConfig(GPIO_PartialRemap2_TIM2,ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructure); /*配置中断优先级*/ NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); TIM_TimeBaseStructure.TIM_Period = arr; //设置在下一个更新事件装入活动的自动重装载寄存器周期的值 TIM_TimeBaseStructure.TIM_Prescaler = psc; //设置用来作为TIMx时钟频率除数的预分频值 TIM_TimeBaseStructure.TIM_ClockDivision = 0; //设置时钟分割:TDTS = Tck_tim TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; //TIM向上计数模式 TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure); //根据TIM_TimeBaseInitStruct中指定的参数初始化TIMx的时间基数单位 TIM2_ICInitStructure.TIM_Channel = TIM_Channel_4; TIM2_ICInitStructure.TIM_ICPolarity = TIM_ICPolarity_Rising; TIM2_ICInitStructure.TIM_ICSelection = TIM_ICSelection_DirectTI; TIM2_ICInitStructure.TIM_ICPrescaler = TIM_ICPSC_DIV1; TIM2_ICInitStructure.TIM_ICFilter = 0x00; TIM_ICInit(TIM2, &TIM2_ICInitStructure); // TIM_PWMIConfig(TIM2, &TIM2_ICInitStructure); //PWM输入配置 // TIM_SelectInputTrigger(TIM2, TIM_TS_TI1FP1); //选择有效输入端 // TIM_SelectSlaveMode(TIM2, TIM_SlaveMode_Reset); //配置为主从复位模式 // TIM_SelectMasterSlaveMode(TIM2, TIM_MasterSlaveMode_Enable); TIM_ITConfig(TIM2,TIM_IT_CC3 | TIM_IT_CC4, ENABLE); //中断配置 TIM_ClearITPendingBit(TIM2,TIM_IT_CC3 | TIM_IT_CC4); //清除中断标志位 TIM_Cmd(TIM2, ENABLE); } void TIM2_IRQHandler(void) { if (TIM_GetITStatus(TIM2, TIM_IT_CC3) != RESET) { //捕获1发生捕获事件 } if (TIM_GetITStatus(TIM2, TIM_IT_CC4) != RESET) { //捕获1发生捕获事件 } TIM_ClearITPendingBit(TIM2, TIM_IT_CC3 | TIM_IT_CC4 |TIM_IT_Update); //清除中断标志位 }
1033浏览量 5回复量 关注量 -
MM32SPIN06的IWDG中断不生效
MM32SPIN06的IWDG中断不生效,已经配置IWDG 溢出后产生中断 ,NVIC中使能IWDG中断,可是 IWDG 溢出后没有产生中断,而是复位了MCU
29258浏览量 10回复量 关注量 -
GD32 MCU与其他设备间的SPI通信问题
当GD32作为主机和从机进行SPI通信时,输出的NSS片选信号(比如下降沿),和输出的SCK时钟信号(相邻的上升/下降沿),之间有没有时间间隔要求?求各位大佬帮帮忙,谢谢! GD32的datasheet中,MCU作为主机的情况下,输出的NSS信号没有作详细的解释。 也就是说,怎么去设置这个NSS跳变的时间,才能让MCU作为主机在MOSI线上输出的指令能被从机正确识别?
1380浏览量 2回复量 关注量 -
PIC32MX534芯片调试时全局变量无法赋值,初始值为0XFFFF
PIC32MX534芯片调试时全局变量无法赋值,初始值为0XFFFF,使用赋值指令没有作用,值不改变,在其他位置没有使用,也没有赋值。哪位知道怎么解决。
845浏览量 4回复量 关注量 -
HK32F030M4P6小系统板误将11脚设置为普通输出囗 sos
HK32F030M4P6小系统板,因初学误将11脚(PB5)设置为普通输出囗导到再次无法下载程序,请问如何解决?
1386浏览量 0回复量 关注量 -
求助,jlink调试报错:could not stop Cortex-M... sos
我把jlink的驱动卸载重装以后,点击单步调试,报错"could not stop Cortex-M device! Please check the JTAG cable", 有大神可以指导一下我吗 [url=D:\qj\PIC\1.png][img]D:\qj\PIC\1.png[/img][/url]
883浏览量 0回复量 关注量 -
【GD32F330裸机-KEIL5环境】使用外部中断,debug卡死问题
在注释掉PA1作为外部中断的配置语句后,debug可以正常运行。求助下论坛的高手们,我这个中断配置有问题吗?debug出现异常的原因可能在哪? void AD_GpioInit(void) { /* 配置时钟 */ rcu_periph_clock_enable(AD_GPIO_CLOCK); rcu_periph_clock_enable(RCU_CFGCMP); /* 配置PA1 */ gpio_mode_set(AD_GPIO_PORT, GPIO_MODE_INPUT, GPIO_PUPD_NONE, AD_GPIO_PIN); /* 将PA1映射到EXTI1 */ syscfg_exti_line_config(EXTI_SOURCE_GPIOA, EXTI_SOURCE_PIN1); /* 配置EXTI1 */ exti_init(EXTI_1, EXTI_INTERRUPT, EXTI_TRIG_BOTH); exti_interrupt_flag_clear(EXTI_1); nvic_irq_enable(EXTI0_1_IRQn, 2, 2); }
1253浏览量 3回复量 关注量 -
请教一个GD32C103的CAN的采样点值与测试结果不一致的问题
我在使用CAN通讯时,设置的CAN节点波特率为1MHz,采样点为75%,具体配置见图片,但是在使用测试设备测试单个节点的时候,测出的采样点只有35%。请问是我配置有问题吗,除了截图中的配置还有没有要配置的地方,麻烦大佬们答疑解惑,万分感谢!APB1上的时钟频率为60MHz。
1683浏览量 6回复量 关注量 -
ATtiny3217的DAC供电3.3V选4.3V挡位会有隐患吗 sos
大家好,我需要用ATtiny3217的DAC功能输出一个0-3.3V的模拟量,但是该款MCU没有3.3V的挡位,然后选择了4.3V的挡位给单片机供电3.3V,效果最高确实是只能最高输出3.3V电压了。不知道这样操作会不会存在什么隐患,**各位大佬能帮忙解下惑。
1308浏览量 0回复量 关注量 -
关于串口DMA等待传输完成卡死的问题 赏100家园币
型号AT32F407,在USART2 DMA发送数据时,接包已经接到了要发送的数据,但是程序还是处于等待传输完成的标识判断中,卡死了。请教一下是什么造成的?
28226浏览量 45回复量 关注量 -
禁用了jtag-dp + sw-dp,导致程序无法下载 sos
在程序中禁用了jtag-dp + sw-dp,导致程序无法下载,不能只禁用jtag吗,为什么都禁用了,如何打开,恢复下载加入了以下代码: crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE); gpio_pin_remap_config(SWJTAG_GMUX_100,TRUE);
1379浏览量 0回复量 关注量 -
关于JTAG,SWD禁用后,如何读取flash中的程序 sos
有没有方法在不破坏MCU的情况下,**flash中的程序。想要实现一种简单的防盗模式翻译 [align=left]搜索[/align][align=left]复制[/align]
1466浏览量 0回复量 关注量 -
GD32F30x 关于 fmc 的位编程功能
几乎没有在互联网上找到任何资料,分析固件库发现相比整字编程,位编程指只是开启了 BPEN[size=3] [/size][size=3]FMC[/size][size=3]位编程功能使能寄存器。[/size][size=3]有没有友友有使用过这个功能的?刚刚试验了一下并不能正常重编程到指定地址。 [/size][size=3] [/size]
2956浏览量 16回复量 关注量