1.将STM32F10x_StdPeriph_Examples/i2c/eeprom中的文件main.cstm32f10x_conf.h stm32f10x_it.cstm32f10x_it.h system_stm32f10x.c文件拷贝到STM32F10x_StdPeriph_Template文件夹下,覆盖掉原来的文件。然后编译工程,得到如下错误:
.\STM32100E-EVAL\STM32100E-EVAL.axf: Error: L6218E: Undefined symbol sEE_DeInit (referred from main.o).
.\STM32100E-EVAL\STM32100E-EVAL.axf: Error: L6218E: Undefined symbol sEE_Init (referred from main.o).
.\STM32100E-EVAL\STM32100E-EVAL.axf: Error: L6218E: Undefined symbol sEE_ReadBuffer (referred from main.o).
.\STM32100E-EVAL\STM32100E-EVAL.axf: Error: L6218E: Undefined symbol sEE_WriteBuffer (referred from main.o).
解决方法:在stm32_eval_i2c_ee.c文件上右键选择options for file "stm32_eval_i2c_ee.c" 勾上include in target build,再次编译成功
2.将stm32100e_eval.h中的改成
#define sEE_I2C

本文档详细记录了解决STM32使用I2C通信时遇到的错误,包括如何将示例代码整合到项目中,配置I2C引脚,设置EEPROM地址和速度,关闭DMA以及修改相关函数以实现正确通信。最终,通过串口监控成功实现了STM32对EEPROM的一字节读写操作。
最低0.47元/天 解锁文章
1716

被折叠的 条评论
为什么被折叠?



