I have just changed to lead-free solder (I'm now using Chip Quik's "SMDSWLF.031, a Sn96.5/ Ag3.0/ Cu0.5 solder with 2.2% no-clean flux) but I'm not sure what I'm seeing when inspecting my boards.
The following pictures show an example: the first one was taken after soldering and I think the yellow residue around the joint is flux but I don't know what are those black spots on the solder; the second one was taken after cleaning the board with isopropyl alcohol and the yellow residue is gone but the black spots are still there.
My solder station is usually set between 350 and 375 Celsius (usually the later since the change to lead-free solder) but it seems the temperature settings does not make any difference on the appearance of the black spots.
What I see is that the black spots appears more frequently in larger pads. I wonder if it is because I left the soldering iron more time heating the solder and that burnt the flux.
When used leaded solder never saw those black spots (and the joints looked nicer). However, I cannot go back to use leaded solder (regulatory requirement).
So, my question is what is that black residue? And as secondary question: is that a sign of a bad joint or maybe bad soldering technique?
Additional information: most components I'm using have their leads tin-finished. The PCB pads are HASL-finished (lead-free).
Update: I tested with PCBs from a different provider (suspecting something in the HASL finish of the PCB pads) and even tried bare copper prototype boards but the black spots were still there. I also tried cleaning the solder wire before soldering, because I don't use the solder wire from the original roll, but it was repackaged by hand in smaller plastic tubes (suspecting residues from the hands of the person doing the repackaging). I also tried to use a lower temperature, down to 275 Celcius (thanks to @metacollin 's for suggesting that), and changed the solder iron tip. Yet the black spots were still there.
Then I have rechecked the solder joints with a different light source. It is now evident those black spots are not residues but small depressions or pits in the solder surface. So now I'm inspecting the boards with a different lamp, because the one I used previously casts those hard shadows.
As a side note, lowering the temperature to 275-300 Celsius really improved the soldering. I'm surprised using a higher temperature actually made the melting of the lead-free solder slower. I guess flux was being burnt too fast and that made it worse with higher temperature.
I also contacted the solder manufacturer, they were the one suggesting to test with different PCBs to rule out something in the pad's finish.