Board Design - Milli Pins to Expose
Debug and Configuration Pin Header
Exposure of the "configuration UART" pins through a header is strongly recommended. This header is required for each of the following:
- Fast hardwired configuration (aka personalization) during board, unit and end device manufacturing.
- Fast hardwired firmware update during manufacturing, in the warehouse, or even in the field.
- Firmware image management for conducting various hardware tests or for running a Milli self test during manufacturing, certification testing, field testing, troubleshooting, or as part of the RMA process.
A 4-pin header is an integral part of any product PCBA that utilizes the Milli. The header should include the following pins (refer to the Milli Datasheet for additional information):
Pin 1: 3.3 V – any 3.3V power source although not necessary or used if a “bus powered” (e.g. USB connector) cable like the TTL-232R-RPi is used
Pin 2: RXD – Milli Pin 14 (referenced as GPIO26)
Pin 3: TXD – Milli Pin 18 (referenced as GPIO27)
Pin 4: GND
- Itron stronglhy advises a 4-pin 0.1” spacing, single-row, through hole header.
- For header and pin design refer to the drawing Samtec # TSW-104-07-G-S.
- Only pins 2-4 (i.e. no 3.3 V connection) if powered via the serial console.
- Connection can use the FTDI cable TTL-232R-RPi “USB to TTL RS232 Cable for Raspberry Pi Platform” (see datasheet) which can be purchased here.
- The Milli Dev Kit (aka Milli Shield) exposes this type of header as shown on the Dev Kit Schematics.
- There are strict power sequencing steps to be utilized, in order to prevent damaging the Milli module:
- The Milli SoC has a strict requirement that any digital I/O pins must not exceed the SoC Vcc by more than 0.3V (nominal Vcc on mNIC is 3.3V). The SoC can be permanently damaged if this sequence isn’t properly followed.
- Thus, the normal (or externally supplied from lab supplies or batteries) Vcc MUST be applied, and stabilized, at the Milli, BEFORE attaching the serial console port:
- Apply power to Milli.
- Then attach the serial console port to whatever external device is being utilized
Milli Reset Pin
The integrated device should provide a means of setting Milli reset pin which is pin 53 (RSET_N). Resetting the Milli is needed for operations such as firmware updates and configuration changes. The reset pin is activated when low, or shorting to ground. Activating this pin will restart the Milli module. This can be done through an integrated circuit, pushbutton, switch or any means to initiate a low pulse to the pin.
Additional Milli Pin Information
Pin 37 – Host Wake up pin for the MCU
Milli pin 37 is tied to the MCU on the Device IC, typically a GPIO port. When the Milli wants to wake the Device IC, the Milli will pulse this line (bringing the line high then low with an approximate 1ms delay). The CoAP Server in the Device IC must provide an Interrupt Service Routine that fires on this pulse. This ISR typically wakes the MCU and sets up a read for the first part of the HDLC protocol.
Pin 39 – Milli Reset pin for the MCU
The Milli will pulse pin 39 when it resets to inform the Device IC of the reset. This line can be ignored by the Device IC provided its CoAP Server implements the full CoAP API (see the integration guide for details).
Pin 44 – Wake up pin for Milli
The CoAP Server should pulse Milli pin 44 when it wants to communicate with the Milli. If the Milli is in sleep mode, this pulse will also wake up the Milli. The Milli will respond by sending the first part of the HDLC protocol sequence. A 1ms pulse works well.
Pin 53 - Milli Reset Pin
The integrated device should provide a means of setting Milli reset pin which is Milli pin 53 (RSET_N). Resetting the Milli is needed for operations such as firmware updates and configuration changes. The reset pin is activated when low, or shorting to ground. Activating this pin will restart the Milli module. This can be done through an integrated circuit, pushbutton, switch or any means to initiate a low pulse to the pin.
The following are the steps required to begin firmware upgrade:
- Attach 3-pin serial cable as follows (see datasheet for pin layout):
- GPIO_26_ADC4 - pin14 (RX)
- GPIO_27_ADC5 - pin18 (TX)
- Any ground pin
- Connect the serial port to the laptop
- Expose the reset pin (Milli pin 53, RSET_N) so that the Milli unit can be restarted. The unit can also be restarted by powering it off and then back on (e.g. pull the battery).
- Connect a UART to pins 14, 18, and ground.
Confirm Board is Operational
- Apply power to the Milli module.
- Open Tera Term. Select the Serial radio button from the startup page.
- Select the COM port to the module.
- Use the Device Manager on your computer to determine the serial port on which the Milli is connected.
- Next, click Settings/Serial Port. Change the rate to 115200 and click OK.
- Open a Windows Command session.
- Re-power the Milli, or reset it with pin 53. If you are working with the Milli on a Dev Kit, click the Blue reset button on the Milli shield.
- The hardware test image should be the currently running image. The boot should look like this screenshot with mNIC Hardware Tester, 81.4.0001.123022. The leading 8 in the firmware is for the hardware test image and the rest is the firmware version (E.G. 1.4.0001) and build (E.G. 123022).
Loading a Firmware Image
- Download the firmware image you wish to load from the Developer Portal. NOTE: for Singapore and European countries you must use firmware version 1.2.1000 build 117958 or later.
- There were changes made to the default CoAP URI strings for the Milli and for the CoAP server on the connected sensor micro controller. When accessing Milli CoAP resources the URI was changed from "/system" in older versions to "/sys" in newer versions. Similarly the URI proxied from CoAP clients to the sensor controller CoAP server resources were changed as well. In older versions the default URI prefix of "/sensor" was used to indicate resource should be proxied to the sensor CoAP server. In newer firmware versions the default prefix was changed to "/snsr". This prefix is stripped from the Uri-path and the remainder of the URI is used to access the sensor CoAP server resources.
- Version 1.2.1000 build 112738 and earlier uses the following default CoAP URIs
- Milli CoAP URI defaults
- Device (aka sensor) URI default prefix
- e.g. /sensor/.well-known/core to query the sensor CoAP server for available resources
- Milli CoAP URI defaults
- Version 1.2.1000 build 117958 and later changes "sensor"->"snsr" and "system"->"sys"
- Milli CoAP URI defaults:
- Device (aka sensor) URI defaults
- e.g. /snsr/.well-known/core to query the sensor CoAP server for available resources
- Milli CoAP URI defaults:
- Copy the image file and sio_load.exe to a well-known location on a Windows machine.
- Open a Windows Command session.
- Go to the folder where you stored the image. At the prompt type in the following sio_load command
sio_load.exe -i <COM port to which the Milli Shield is connected> -f -3 <milli_image_filename.bin>
- You will be prompted to reset the Milli. This allows the bootloader to receive the upload request. This is done by triggering the reset pin 53 (see the datasheet for details), or re-powering the Milli. If you are loading fimware on the Milli on a Dev Kit, click the Blue reset button on the Milli shield.
- For the purposes of this example, we are assuming that the image file is called
- The image will be written to the NIC as shown below.
Note: The path you chose to place the image and sio_load will probably differ, and the COM port will likely be different. You will have to modify those values accordingly.
To verify that the operation succeeded, open up Tera Term, select the COM port representing the input to the NIC, and select Setup/Serial Port and fill in the values as shown below including baud rate 115200.
- Click OK to save.
- Reset the board by triggering the reset pin 53 (see the datasheet for details), or re-powering the Milli. If you are loading the Milli on a Dev Kit, click the Blue reset button on the Milli shield board.
- The startup text should display a response similar to what is shown below. In this screenshot the leading "8" indicates HWTEST image, "1.4.0001" is the firmware version and "123022" is the firmware build number. HWTEST is the image that should be running to configure the Milli module with a personalization profile. The available firmware images are explained further in the “Optional Steps” section below.
There are three images installed on the Milli (HWTEST, PROD, and SELFTEST). If Milli configuration personalization is required, you may wish to leave the device in hardware test (HWTEST) mode. You may wish to leave it in self test (SELFTEST) mode for additional testing. You may wish to place the unit in production (PROD) or standard operational mode because you’re finished with personalization.
- To view the images on the device, open Tera Term and set it up as described above. Then open a Windows Command prompt, type: fw images and press Return. Note that in the example below, 1.2.1000 is the standard operating production image, and 111433 is the build number.
Note: There will be three images on the board. The image numbers are as follows:
- Hardware test image (HWTEST) - Typically used when configuring or changing the personalization profile. This image name will start with an 8 followed by version and build number (e.g. 81.2.0000.111433 where version is 1.2.0000 and build number is 111433.
- Standard operating image (PROD) - Sometimes referred to as the production image, or PROD, is the image that should be running in normal operational mode connected to a network. This image name be of the form version followed by build number (e.g. 1.2.0000.11433 where version is 1.2.0000 and build number is 111433.
- Self-test image (SELFTEST) - Typically used to run a self-test of the Milli module. This image name will start with a letter “c” followed by version and build number (e.g. c1.24.0000.11433 where version is 1.2.0000 and build number is 111433.
- To change to the running firmware image run the following command
sio_load.exe –i <COM port> -b -<image number>
where <image number> is 1, 2 or 3 as described above.
- An example of setting the Milli to run the HWTEST test image is shown below.