To meet the high demands for quality and reliability in the manufacturing of electronic products, surface micro-defect inspection of printed circuit boards (PCBs) is now required. At present, the methods available do not meet the demand for light-weight deployment and high-accuracy small-target detection in complicated industrial environments. Therefore, an efficient lightweight detector called FHIM-YOLO based on YOLOv8n has been introduced. C2f_Faster is a modification of C2f in the backbone that reduces the number of parameters and memory access; it is thus more efficient in computation. An optimised feature enhancement module (FEM) is added to enhance the local contextual representation of fine defects through multi-branch dilated convolutions and address feature degradation in deep networks. A High-level Screening-feature Fusion Pyramid Network (HS-FPN) is used in the neck to improve the efficiency of multi-scale feature screening and fusion, thereby better isolating micro-defects from background clutter. Finally, CIoU is replaced with Inner-MPDIoU to improve the accuracy of bounding-box regression in a cluttered background and speed up the training process. On the HRIPCB dataset, FHIM-YOLO has reached a top-5 mAP of 95.2% and reduced the number of parameters to 0.95M, which is 68.4% lower than that of the YOLOv8n baseline. Although the FLOPs are as high as 15.6G, the model can still run at 65.19 FPS and meet the requirements for real-time industrial applications. Additional experiments on the DeepPCB dataset have shown that, compared to the baseline, Recall, mAP@50, and mAP@50-95 have all improved and exhibit good generalisation to different data distributions. In short, FHIM-YOLO offers a good balance among model size, detection accuracy and real-time performance, and is thus very suitable for resource-limited online PCB defect inspection.