Introduction
This example demonstrates how to connect to an HTTPS server and download a root/tls certificates using HTTPS client. Then sends the certificates to WINC SPI flash from host
It uses the following hardware:
- the SAM Xplained Pro.
- the WINC1500 on EXT1.
Main Files
- main.c : WINC1500 Wi-Fi module, then download a certificate file using HTTPS client and then writes into WINC SPI flash.
Usage
- Configure below code in the main.h for AP information to be connected.
- Provide HTTPS URL macro with partial URL (exclude the certificate .cer file name in the main.h file.
- Provide number of tls/root certificates .cer to be downloaded
- Provide certificate file name list in root_tls_certs_name
- Build the program and download it into the board.
- On the computer, open and configure a terminal application as following.
* Baud Rate : 115200
* Data : 8bit
* Parity bit : none
* Stop bit : 1bit
* Flow control : none
*
- Start the application.
- In the terminal window, the following text should appear:
* -- Certificate downloader via OTA (HTTPS) example --
* -- Compiled: xxx xx 2021 hh:mm:ss --
* (APP)(INFO)Chip ID xxxxxx
* (APP)(INFO)DriverVerInfo: 0xaaaaaaaa
* (APP)(INFO)Firmware ver : xx.x.x xxxxxx xxxxx
* (APP)(INFO)Firmware Build xxx xx xxxx xx:xx:xx
* (APP)(INFO)Firmware
Min driver ver : xx.x.x
* (APP)(INFO)Driver ver: xx.x.x
* (APP)(INFO)Driver built at xxx xx xxxx xx:xx:xx
*
main: connecting to WiFi AP DEMO_AP...
*
wifi_cb: IP address is 192.168.43.210
* (APP)(INFO)Socket 0 session ID = 1
* (APP)(INFO)Sock to delete <0>
* >> De-init WINC device to enter into download mode
* (APP)(INFO)Chip ID 1503a0
* >> WINC entered into download mode
* ---> Start Certificate Upload on WINC
*
* >>>Found Certificate:
* >>>
*
* >Start erasing...
* Done
*
* > Writing the Root Certificate to SPI flash...
* --- Root Certificate written to SPI flash ---
*
*
* >>>Found Certificate:
* >>> AddTrust External CA Root
*
* >Start erasing...
* Done
*
* > Writing the Root Certificate to SPI flash...
* --- Root Certificate written to SPI flash ---
* >> All the certificates written
*
main: please re-init WINC to start wifi operations.
*
Compilation Information
This software was written for the GNU GCC compiler using Atmel Studio 6.2 Other compilers may or may not work.
Contact Information
For further information, visit Microchip.