An implementation of using bare metal code to read temperature, pressure data from a BMP280 sensor using I2C
- arm-none-eabi-gcc
- arm-none-eabi-newlib
- arm-none-eabi-binutils
- openocd
- makefile
- any serial monitor
Use these PIN configurations:
- Connect GPIOB7 pin -> SDA of BMP sensor
- Connect GPIOB8 pin -> SCL of BMP sensor
- GND -> SDO of BMP
- GND -> GND of BMP
- VCC -> VCC of BMP
Go to terminal and run
make allclean
I used openocd
to connect to STM32 board. Then used telnet
client to connect to openocd
server.
Terminal Commands:
Running OpenOcd:
make load
Connecting to OpenOcd:
telnet localhost 4444
After that just send commands to talk to the board.
telnet> halt
telnet> flash write_image erase final.elf
telnet> reset
Ignore any warning.
After making changes to code just do make allclean
and halt, flash, reset in order.
I have also connected pc with mcu using usart2. I used CuteCom
as my serial port monitor. Baud rate used = 115200