Electronic – How to program MCUs and test PCBs in mass production

microcontrollerpcbproduction-testingprogrammingtest

I am working on a PCB which includes an microcontroller (STM32), some sensors and a BLE module. Right now it is still a prototype, only 3 units have been produced.

  • To program the microcontroller, I am using the programming probe provided by STMicroelectronics (ST-LINK/V2).
  • To check that the hardware is fine, I send a BLE command to the PCB : the microcontroller verifies that all the sensors are responding and if the test is passed, a green LED is turned on (otherwise a red LED). It is not an exhaustive test procedure but it is convenient for my needs (for example I do not test the red LED nor the values of all the resistors nor the measurements of the sensors).

That works for small quantities, but if the prototyping phase is conclusive it might be produced in large quantites (some thousands), so I will have to change the way the MCU is programmed and the PCB tested. I have never done this before, so I have trouble finding what is expected of me and of the EMS.

Programming

How can the MCUs be mass-programmed ? Let's consider I will not ask STMicroelectronics to deliver the MCUs with my custom firmware (because that solution is "easier"). I suppose I will need to make the programming pins of the MCUs accessible. But can I just send the .bin file to the EMS who will take care of the whole programming procedure ? Do I need to specify the programming procedure ? Or do I need to design another electronical card whose goal will only be to program the MCUs ?

Testing

I do not have any idea how to industrialize a testing procedure. Once again : can the EMS take care of the whole procedure based on my schematics/layout ? Or do I need to design another electronical card ?

Best Answer

  1. First, I'd suggest to use one of these pads (i.e. TC2030) for JTAG/SWD programming as they do not cost a component and they lend themselves very easily to programming jigs. Tag Connect. Use the lower-most footprint at the left. No, not the 0805.
  2. Normally, you can just send the bin or hex file to the EMS. The EMS should be able to identify a gang programmer apt for the MCU, as necessary.
  3. You need a dedicated testing jig ("bed of nails") for the actual testing. General ease of test jig development depends on the presence of test pads and how the PCBA mechanically lends itself to testing (i.e. are the test pads reachable by pogo pins and are not hampered by tall components, etc). Note that the programming jig and the testing jig can be the same jig, but again, that depends on the complexity of the PCBA, and the number/complexity of tests.
  4. You do need to present them a programming procedure (power up sequences, pin inputs, etc). Its the EMS's job to replicate this on a mass-pro level. Same with the basic test procedure you mentioned.
  5. Component-wise, you can opt for the EMS to do ICT test prior to programming/ testing. At least for the first batch, just to be sure that the right component values are mounted on the right places or that BGA components are connected well. You'd have better confidence of proceeding with the programming/ testing (or at least less debug points to look into) knowing that the PCBAs are assembled correctly.
  6. At a very basic level, those test jigs are computer-controlled (i.e. PC with LabView hooked to different instruments, the programmer, etc) where an operator/ technician manually loads the PCBA(s), presses down the jig, press a start button on the interface, wait for the programming, and the test results PASS/FAIL message to come out.