I2c between beaglebone black and STM32F4-discovery
Yes, you can, as long as they both support the same voltage (usually 5 or 3.3 V). I2C pins are configured as open-drain. They would simply float unstably (tri-stated) were it not for the pull-ups which ensure that the pins stay HIGH when no device on the bus is pulling them LOW. When the pins are eventually driven LOW, the pull-ups (4.7k is good) will also limit any current flowing into the pins to safe levels, well below 6mA. 

5 V / 4.7k = 1.06 mA
3.3 V / 4.7k = 0.7 mA


Dont forget to connect their GNDs together for a common reference point.