MXChip IoT DevKit AZ3166¶
The MXChip IoT DevKit AZ3166 provides a smart hardware solution. It is compatible with several peripherals and sensors. AZ3166 could be used for the development of IoT and smart hardware prototype, making it continent to verify the software and function of users.
AZ3166 is EMW3166, a low power consumption Wi-Fi module developed by MXCHIP, With DAP Link emulator and 128×64 OLED and other resources such as LED light. The development kit has onboard a Temperature and Humidity sensor (HTS221), an Acceleromenter and Gyroscope sensor (LSM6DSL), an absolupe Pressure sensor (LPS22HB), a Magnetometer sensor (LIS2MDL) and more.
EMW3166 integrates STM32F412RG (Cortex-M4) microcontroller of 256Kbytes SRAM and 1Mbytes on-chip flash with another 2Mbytes on-board SPI flash added. Various peripheral interfaces of analog and digital are available. The power supply voltage is 3.3V. The TCP/IP protocols and security encryption algorithm could be applied in various Wi-Fi applications. In addition, several particular firmware prepares for some typical applications easylink configuration and services for cloud interfacing.
All the reported information are extracted from the official MXChip IoT DevKit AZ3166 reference page, visit this page for more details and updates.
MXChip IoT DevKit AZ3166 Schematic are available on the official MXChip official page.
The internal flash of the IoT DevKit AZ3166 is organized into sectors of different size according to the following table:
|0x8020000||128kb||Bytecode Bank 0|
|0x8040000||128kb||Bytecode Bank 1|
|0x8060000||128kb||Bytecode Bank 2|
|0x8080000||128kb||Bytecode Bank 3|
|0x80A0000||128kb||Bytecode Bank 4|
|0x80C0000||128kb||Bytecode Bank 5|
|0x80E0000||128kb||Bytecode Bank 6|
If internal flash is used in a Zerynth program, it is suggested to begin using pages from the end of flash (bytecode bank 6) towards the virtual machine, to minimize the chance of clashes.
Since writing to a sector entails erasing it first, the write operation can be slow even for small chunks of data, depending on the size of the choosen sector.
- Microcontroller: STM32F412RG ARM®32-bit Cortex®-M4 CPU
- Operating Voltage: 3.3V
- Input Voltage: 7-12V
- Digital I/O Pins (DIO): 31
- Analog Input Pins (ADC): 2
- UARTs: 2
- SPIs: 1
- I2Cs: 1
- Flash Memory: 1 MB
- SRAM: 256 KB
- Clock Speed: 100 MHz
Power to the MXChip IoT DevKit AZ3166 is supplied via the on-board USB Micro B connector.
The device can operate on an external supply voltage of 3.3 to 5.5 volts. If using more than 5.5V, the voltage regulator may overheat and damage the device.
Connect, Register, Virtualize and Program¶
The IoT DevKit AZ3166 Programming port is connected to the ST-Link uploader creating a virtual COM port on a connected computer. To recognize the device, Windows machines requires drivers that can be downloaded from the ST-Link download page, while MAC OSX and Linux machines will recognize the device automatically.
The St-Link is also connected to the STM32 hardware UART0.
Once connected on a USB port, if drivers have been correctly installed the IoT DevKit AZ3166 device is recognized by Zerynth Studio and listed in the Device Management Toolbar. The next steps are:
- Select the IoT DevKit AZ3166 on the Device Management Toolbar (disambiguate if necessary);
- Register the device by clicking the “Z” button from the Zerynth Studio;
- Create a Virtual Machine for the device by clicking the “Z” button for the second time;
- Virtualize the device by clicking the “Z” button for the third time.
No user intervention on the device is required for registration and virtualization process.
After virtualization, the IoT DevKit AZ3166 device is ready to be programmed and the Zerynth scripts uploaded. Just Select the virtualized device from the “Device Management Toolbar” and click the dedicated “upload” button of Zerynth Studio and reset the device by pressing the Reset on-board button when asked.
If the reset is not performed within 5 seconds the upload procedure fails.
Firmware Over the Air update (FOTA)¶
The Firmware Over the Air feature allows to update the device firmware at runtime. Zerynth FOTA in the IoT DevKit AZ3166 device is available for bytecode and VM.
Flash Layout is shown in table below:
|0x08000000||128Kb||VM Slot 0|
|0x08020000||384kb||Bytecode Slot 0|
|0x08080000||128kb||VM Slot 1|
|0x080A0000||384kb||Bytecode Slot 1|
FOTA Record (small segment of memory where the current and desired state of the firmware is store) for the IoT DevKit AZ3166 device is allocated in 16kb sector inside the VM Slot 0 at 0x08004000 address.
Power Management and Secure Firmware¶
Power Management feature allows to optimize power consumption by putting the device in low consumption state.
Secure Firmware feature allows to detect and recover from malfunctions and, when supported, to protect the running firmware (e.g. disabling the external access to flash or assigning protected RAM memory to critical parts of the system).