ESP-WROOM-32を使ってみる（２）

# ESP-WROOM-32にOpen62541をのせてみる
前回どうしてもビルドでエラーになったので、ESP-IDFのインストールから確認しながらもう一度挑戦
## 参考URL
* OPCUA-ESP32
    * https://github.com/cmbahadir/opcua-esp32
* ESP-IDF
    * https://github.com/espressif/esp-idf
* Toolchain
    * https://dl.espressif.com/dl/esp32_win32_msys2_environment_and_gcc8_toolchain-20191231.zip

## 環境設定
### Toolchainのインストール
esp32_win32_msys2_environment_and_gcc8_toolchain-20191231.zipをダウンロードして、中のmsys32フォルダをC:\直下にコピーする。

コピーしたらc:\msys2\mingw32.exeを起動してパッケージのアップデートを行う。

```
$ pacman -Sy pacman
$ pacman -Syu
```

### ESP-IDFの取得
そのあとESP-IDF用のフォルダを作り、ESP-IDFをgit cloneする。

```
$ mkdir -p ~/esp
$ cd esp
$ git clone --recursive https://github.com/espressif/esp-idf.git
```

前回と同じようにC:\msys32\etc\profile.dフォルダにexport_idf_path.shというファイルを作り以下のように記述する。

```bash:export_idf_path.sh
export IDF_PATH="C:/msys32/home/<ユーザー名>/esp/esp-idf"
```

記述後に設定したPATHを反映させるためにmingw32.exeを再起動。

### OPC UA サーバの取得

いよいよESP23用のOPC UA Serverを取得する。

```
$ mkdir esp/examples
$ cd esp/examples
$ git clone https://github.com/cmbahadir/opcua-esp32.git
```

取得に成功したらmakeしてみます。

```
$ cd opcua-esp32
$ make
Python requirements from C:/msys32/home/toshi/esp/esp-idf/requirements.txt are satisfied.
GENCONFIG
C:/msys32/home/toshi/esp/examples/opcua-esp32/sdkconfig:150 CONFIG_ESP32_APPTRACE_DEST_NONE was replaced with CONFIG_APPTRACE_DEST_NONE
C:/msys32/home/toshi/esp/examples/opcua-esp32/sdkconfig:151 CONFIG_ESP32_APPTRACE_LOCK_ENABLE was replaced with CONFIG_APPTRACE_LOCK_ENABLE
C:/msys32/home/toshi/esp/examples/opcua-esp32/sdkconfig:250 CONFIG_ESP32_DEBUG_STUBS_ENABLE was replaced with CONFIG_ESP_DEBUG_STUBS_ENABLE
App "opcua_esp32" version: 771b79f-dirty
CC build/bootloader/bootloader_support/src/bootloader_random.o
CC build/bootloader/bootloader_support/src/flash_encrypt.o
CC build/bootloader/bootloader_support/src/esp_image_format.o
CC build/bootloader/bootloader_support/src/flash_partitions.o
CC build/bootloader/bootloader_support/src/bootloader_flash_config_esp32.o
CC build/bootloader/bootloader_support/src/bootloader_clock.o
CC build/bootloader/bootloader_support/src/bootloader_common.o
CC build/bootloader/bootloader_support/src/bootloader_utility.o
CC build/bootloader/bootloader_support/src/bootloader_init.o
CC build/bootloader/bootloader_support/src/flash_qio_mode.o
CC build/bootloader/bootloader_support/src/bootloader_flash.o
CC build/bootloader/bootloader_support/src/bootloader_efuse_esp32.o
CC build/bootloader/bootloader_support/src/esp32/flash_encrypt.o
CC build/bootloader/bootloader_support/src/esp32/bootloader_esp32.o
CC build/bootloader/bootloader_support/src/esp32/bootloader_sha.o
CC build/bootloader/bootloader_support/src/esp32/secure_boot.o
CC build/bootloader/bootloader_support/src/esp32/secure_boot_signatures.o
AR build/bootloader/bootloader_support/libbootloader_support.a
CC build/bootloader/log/log_buffers.o
CC build/bootloader/log/log_noos.o
CC build/bootloader/log/log.o
AR build/bootloader/log/liblog.a
CC build/bootloader/spi_flash/esp32/spi_flash_rom_patch.o
AR build/bootloader/spi_flash/libspi_flash.a
CC build/bootloader/micro-ecc/micro-ecc/uECC.o
AR build/bootloader/micro-ecc/libmicro-ecc.a
CC build/bootloader/soc/esp32/emac_hal.o
CC build/bootloader/soc/esp32/rtc_clk.o
CC build/bootloader/soc/esp32/rtc_time.o
CC build/bootloader/soc/esp32/rtc_sleep.o
CC build/bootloader/soc/esp32/gpio_periph.o
CC build/bootloader/soc/esp32/i2s_periph.o
CC build/bootloader/soc/esp32/rtc_clk_init.o
CC build/bootloader/soc/esp32/ledc_periph.o
CC build/bootloader/soc/esp32/spi_periph.o
CC build/bootloader/soc/esp32/rtc_init.o
CC build/bootloader/soc/esp32/sdio_slave_periph.o
CC build/bootloader/soc/esp32/rtc_periph.o
CC build/bootloader/soc/esp32/uart_periph.o
CC build/bootloader/soc/esp32/rtc_wdt.o
CC build/bootloader/soc/esp32/sdmmc_periph.o
CC build/bootloader/soc/esp32/adc_periph.o
CC build/bootloader/soc/esp32/i2c_periph.o
CC build/bootloader/soc/esp32/interrupts.o
CC build/bootloader/soc/esp32/cpu_util.o
CC build/bootloader/soc/esp32/touch_sensor_periph.o
CC build/bootloader/soc/esp32/rtc_io_periph.o
CC build/bootloader/soc/esp32/touch_sensor_hal.o
CC build/bootloader/soc/esp32/rtc_pm.o
CC build/bootloader/soc/esp32/soc_memory_layout.o
CC build/bootloader/soc/esp32/dac_periph.o
CC build/bootloader/soc/src/soc_include_legacy_warn.o
CC build/bootloader/soc/src/compare_set.o
CC build/bootloader/soc/src/memory_layout_utils.o
CC build/bootloader/soc/src/lldesc.o
CC build/bootloader/soc/src/hal/pcnt_hal.o
CC build/bootloader/soc/src/hal/gpio_hal.o
CC build/bootloader/soc/src/hal/spi_flash_hal_gpspi.o
CC build/bootloader/soc/src/hal/ledc_hal.o
CC build/bootloader/soc/src/hal/rmt_hal.o
CC build/bootloader/soc/src/hal/ledc_hal_iram.o
CC build/bootloader/soc/src/hal/i2s_hal.o
CC build/bootloader/soc/src/hal/sdio_slave_hal.o
CC build/bootloader/soc/src/hal/timer_hal.o
CC build/bootloader/soc/src/hal/spi_hal_iram.o
CC build/bootloader/soc/src/hal/touch_sensor_hal.o
CC build/bootloader/soc/src/hal/uart_hal.o
CC build/bootloader/soc/src/hal/sigmadelta_hal.o
CC build/bootloader/soc/src/hal/spi_flash_hal.o
CC build/bootloader/soc/src/hal/uart_hal_iram.o
CC build/bootloader/soc/src/hal/spi_flash_hal_iram.o
CC build/bootloader/soc/src/hal/adc_hal.o
CC build/bootloader/soc/src/hal/i2c_hal.o
CC build/bootloader/soc/src/hal/i2c_hal_iram.o
CC build/bootloader/soc/src/hal/rtc_io_hal.o
CC build/bootloader/soc/src/hal/spi_slave_hal.o
CC build/bootloader/soc/src/hal/can_hal.o
CC build/bootloader/soc/src/hal/mcpwm_hal.o
CC build/bootloader/soc/src/hal/dac_hal.o
CC build/bootloader/soc/src/hal/spi_slave_hal_iram.o
CC build/bootloader/soc/src/hal/spi_hal.o
AR build/bootloader/soc/libsoc.a
CC build/bootloader/main/bootloader_start.o
AR build/bootloader/main/libmain.a
CC build/bootloader/efuse/esp32/esp_efuse_table.o
CC build/bootloader/efuse/src/esp_efuse_api.o
CC build/bootloader/efuse/src/esp_efuse_fields.o
CC build/bootloader/efuse/src/esp_efuse_utility.o
CC build/bootloader/efuse/src/esp32/esp_efuse_fields.o
CC build/bootloader/efuse/src/esp32/esp_efuse_utility.o
CC build/bootloader/efuse/src/esp32/esp_efuse_api.o
AR build/bootloader/efuse/libefuse.a
LD build/bootloader/bootloader.elf
esptool.py v3.0-dev
Python requirements from C:/msys32/home/toshi/esp/esp-idf/requirements.txt are satisfied.
Building partitions from /home/toshi/esp/esp-idf/components/partition_table/partitions_singleapp.csv...

CC build/app_trace/heap_trace_tohost.o
CC build/app_trace/app_trace.o
CC build/app_trace/host_file_io.o
CC build/app_trace/app_trace_util.o
CC build/app_trace/gcov/gcov_rtio.o
AR build/app_trace/libapp_trace.a
App "opcua_esp32" version: 771b79f-dirty
CC build/app_update/esp_app_desc.o
CC build/app_update/esp_ota_ops.o
AR build/app_update/libapp_update.a
CC build/bootloader_support/src/bootloader_random.o
CC build/bootloader_support/src/flash_encrypt.o
CC build/bootloader_support/src/esp_image_format.o
CC build/bootloader_support/src/flash_partitions.o
CC build/bootloader_support/src/bootloader_flash_config_esp32.o
CC build/bootloader_support/src/bootloader_clock.o
CC build/bootloader_support/src/bootloader_common.o
CC build/bootloader_support/src/bootloader_utility.o
CC build/bootloader_support/src/flash_qio_mode.o
CC build/bootloader_support/src/bootloader_flash.o
CC build/bootloader_support/src/bootloader_efuse_esp32.o
CC build/bootloader_support/src/idf/bootloader_sha.o
CC build/bootloader_support/src/idf/secure_boot_signatures.o
AR build/bootloader_support/libbootloader_support.a
CC build/cbor/tinycbor/src/cborencoder_close_container_checked.o
CC build/cbor/tinycbor/src/cborpretty_stdio.o
CC build/cbor/tinycbor/src/cbortojson.o
CC build/cbor/tinycbor/src/cborpretty.o
CC build/cbor/tinycbor/src/cborerrorstrings.o
CC build/cbor/tinycbor/src/cborencoder.o
CC build/cbor/tinycbor/src/cborparser_dup_string.o
CC build/cbor/tinycbor/src/open_memstream.o
CC build/cbor/tinycbor/src/cborvalidation.o
CC build/cbor/tinycbor/src/cborparser.o
AR build/cbor/libcbor.a
CC build/console/linenoise/linenoise.o
CC build/console/argtable3/argtable3.o
CC build/console/commands.o
CC build/console/split_argv.o
AR build/console/libconsole.a
CXX build/cxx/cxx_exception_stubs.o
CXX build/cxx/cxx_guards.o
AR build/cxx/libcxx.a
CC build/driver/adc.o
CC build/driver/rmt.o
CC build/driver/i2c.o
CC build/driver/rtc_io.o
CC build/driver/spi_slave.o
CC build/driver/can.o
CC build/driver/sdmmc_transaction.o
CC build/driver/mcpwm.o
CC build/driver/dac.o
CC build/driver/sdmmc_host.o
CC build/driver/sdspi_crc.o
CC build/driver/pcnt.o
CC build/driver/timer.o
CC build/driver/gpio.o
CC build/driver/sdspi_host.o
CC build/driver/uart.o
CC build/driver/ledc.o
CC build/driver/periph_ctrl.o
CC build/driver/i2s.o
CC build/driver/sdio_slave.o
CC build/driver/touch_sensor_common.o
CC build/driver/sdspi_transaction.o
CC build/driver/sigmadelta.o
CC build/driver/spi_master.o
CC build/driver/rtc_module.o
CC build/driver/spi_common.o
CC build/driver/esp32/touch_sensor.o
AR build/driver/libdriver.a
CC build/efuse/esp32/esp_efuse_table.o
CC build/efuse/src/esp_efuse_api.o
CC build/efuse/src/esp_efuse_fields.o
CC build/efuse/src/esp_efuse_utility.o
CC build/efuse/src/esp32/esp_efuse_fields.o
CC build/efuse/src/esp32/esp_efuse_utility.o
CC build/efuse/src/esp32/esp_efuse_api.o
AR build/efuse/libefuse.a
CC build/esp-tls/esp_tls.o
CC build/esp-tls/esp_tls_mbedtls.o
AR build/esp-tls/libesp-tls.a
CC build/esp32/int_wdt.o
CC build/esp32/brownout.o
CC build/esp32/esp_himem.o
CC build/esp32/dport_access.o
CC build/esp32/hw_random.o
CC build/esp32/pm_esp32.o
CC build/esp32/system_api_esp32.o
CC build/esp32/intr_alloc.o
CC build/esp32/cache_err_int.o
CC build/esp32/spiram.o
CC build/esp32/clk.o
CC build/esp32/spiram_psram.o
CC build/esp32/esp_timer_esp32.o
CC build/esp32/pm_trace.o
CC build/esp32/crosscore_int.o
CC build/esp32/cache_sram_mmu.o
CC build/esp32/cpu_start.o
CC build/esp32/sleep_modes.o
CC build/esp32/task_wdt.o
CC build/esp32/reset_reason.o
CC build/esp32/panic.o
AS build/esp32/dport_panic_highint_hdl.o
AR build/esp32/libesp32.a
CC build/esp_adc_cal/esp_adc_cal.o
AR build/esp_adc_cal/libesp_adc_cal.a
CC build/esp_common/src/esp_timer.o
CC build/esp_common/src/stack_check.o
CC build/esp_common/src/esp_err_to_name.o
CC build/esp_common/src/pm_locks.o
CC build/esp_common/src/ipc.o
CC build/esp_common/src/ets_timer_legacy.o
CC build/esp_common/src/freertos_hooks.o
CC build/esp_common/src/mac_addr.o
CC build/esp_common/src/system_api.o
CC build/esp_common/src/dbg_stubs.o
AR build/esp_common/libesp_common.a
CC build/esp_eth/src/esp_eth_netif_glue.o
CC build/esp_eth/src/esp_eth_phy_dm9051.o
CC build/esp_eth/src/esp_eth_phy_dp83848.o
CC build/esp_eth/src/esp_eth_mac_dm9051.o
CC build/esp_eth/src/esp_eth.o
CC build/esp_eth/src/esp_eth_phy_rtl8201.o
CC build/esp_eth/src/esp_eth_mac_esp32.o
CC build/esp_eth/src/esp_eth_phy_ip101.o
CC build/esp_eth/src/esp_eth_phy_lan8720.o
CC build/esp_eth/src/esp_eth_phy.o
AR build/esp_eth/libesp_eth.a
CC build/esp_event/esp_event_private.o
CC build/esp_event/event_loop_legacy.o
CC build/esp_event/esp_event.o
CC build/esp_event/event_send.o
CC build/esp_event/default_event_loop.o
AR build/esp_event/libesp_event.a
CC build/esp_gdbstub/src/gdbstub.o
CC build/esp_gdbstub/src/packet.o
CC build/esp_gdbstub/esp32/gdbstub_esp32.o
CC build/esp_gdbstub/xtensa/gdbstub_xtensa.o
AR build/esp_gdbstub/libesp_gdbstub.a
CC build/esp_http_client/esp_http_client.o
CC build/esp_http_client/lib/http_utils.o
CC build/esp_http_client/lib/http_auth.o
CC build/esp_http_client/lib/http_header.o
AR build/esp_http_client/libesp_http_client.a
CC build/esp_http_server/src/httpd_sess.o
CC build/esp_http_server/src/httpd_parse.o
CC build/esp_http_server/src/httpd_uri.o
CC build/esp_http_server/src/httpd_txrx.o
CC build/esp_http_server/src/httpd_main.o
CC build/esp_http_server/src/util/ctrl_sock.o
AR build/esp_http_server/libesp_http_server.a
CC build/esp_https_ota/src/esp_https_ota.o
AR build/esp_https_ota/libesp_https_ota.a
CC build/esp_local_ctrl/src/esp_local_ctrl.o
CC build/esp_local_ctrl/src/esp_local_ctrl_handler.o
CC build/esp_local_ctrl/proto-c/esp_local_ctrl.pb-c.o
AR build/esp_local_ctrl/libesp_local_ctrl.a
CC build/esp_netif/esp_netif_handlers.o
CC build/esp_netif/esp_netif_objects.o
CC build/esp_netif/esp_netif_defaults.o
CC build/esp_netif/lwip/esp_netif_lwip_defaults.o
CC build/esp_netif/lwip/esp_netif_lwip.o
CC build/esp_netif/lwip/esp_netif_sta_list.o
CC build/esp_netif/lwip/esp_netif_lwip_ppp.o
CC build/esp_netif/loopback/esp_netif_loopback.o
AR build/esp_netif/libesp_netif.a
CC build/esp_ringbuf/ringbuf.o
AR build/esp_ringbuf/libesp_ringbuf.a
AR build/esp_rom/libesp_rom.a
CC build/esp_serial_slave_link/essl.o
CC build/esp_serial_slave_link/essl_sdio.o
AR build/esp_serial_slave_link/libesp_serial_slave_link.a
CC build/esp_websocket_client/esp_websocket_client.o
AR build/esp_websocket_client/libesp_websocket_client.a
CC build/esp_wifi/src/wifi_init.o
CC build/esp_wifi/src/wifi_netif.o
CC build/esp_wifi/src/coexist.o
CC build/esp_wifi/src/smartconfig_ack.o
CC build/esp_wifi/src/mesh_event.o
CC build/esp_wifi/src/phy_init.o
CC build/esp_wifi/src/wifi_default.o
CC build/esp_wifi/src/smartconfig.o
CC build/esp_wifi/src/lib_printf.o
CC build/esp_wifi/esp32/esp_adapter.o
AR build/esp_wifi/libesp_wifi.a
CC build/espcoredump/src/core_dump_elf.o
CC build/espcoredump/src/core_dump_uart.o
CC build/espcoredump/src/core_dump_common.o
CC build/espcoredump/src/core_dump_flash.o
CC build/espcoredump/src/core_dump_port.o
AR build/espcoredump/libespcoredump.a
CC build/fatfs/diskio/diskio.o
CC build/fatfs/diskio/diskio_sdmmc.o
CC build/fatfs/diskio/diskio_rawflash.o
CC build/fatfs/diskio/diskio_wl.o
CC build/fatfs/vfs/vfs_fat.o
CC build/fatfs/vfs/vfs_fat_spiflash.o
CC build/fatfs/vfs/vfs_fat_sdmmc.o
CC build/fatfs/port/freertos/ffsystem.o
CC build/fatfs/src/ffunicode.o
CC build/fatfs/src/ff.o
AR build/fatfs/libfatfs.a
CC build/freertos/xtensa_overlay_os_hook.o
CC build/freertos/FreeRTOS-openocd.o
CC build/freertos/timers.o
CC build/freertos/tasks.o
CC build/freertos/event_groups.o
CC build/freertos/port.o
CC build/freertos/xtensa_init.o
CC build/freertos/list.o
CC build/freertos/croutine.o
CC build/freertos/queue.o
CC build/freertos/xtensa_intr.o
AS build/freertos/portasm.o
AS build/freertos/xtensa_vector_defaults.o
AS build/freertos/xtensa_vectors.o
AS build/freertos/xtensa_context.o
AS build/freertos/xtensa_intr_asm.o
AR build/freertos/libfreertos.a
CC build/heap/heap_caps_init.o
CC build/heap/heap_caps.o
CC build/heap/multi_heap.o
AR build/heap/libheap.a
AR build/idf_test/libidf_test.a
CC build/json/cJSON/cJSON.o
CC build/json/cJSON/cJSON_Utils.o
AR build/json/libjson.a
CC build/log/log_buffers.o
CC build/log/log_freertos.o
CC build/log/log.o
AR build/log/liblog.a
CC build/lwip/apps/dhcpserver/dhcpserver.o
CC build/lwip/apps/ping/ping_sock.o
CC build/lwip/apps/ping/esp_ping.o
CC build/lwip/apps/ping/ping.o
CC build/lwip/apps/sntp/sntp.o
CC build/lwip/lwip/src/api/sockets.o
CC build/lwip/lwip/src/api/api_msg.o
CC build/lwip/lwip/src/api/err.o
CC build/lwip/lwip/src/api/if_api.o
CC build/lwip/lwip/src/api/netbuf.o
CC build/lwip/lwip/src/api/tcpip.o
CC build/lwip/lwip/src/api/netifapi.o
CC build/lwip/lwip/src/api/api_lib.o
CC build/lwip/lwip/src/api/netdb.o
CC build/lwip/lwip/src/apps/sntp/sntp.o
CC build/lwip/lwip/src/apps/netbiosns/netbiosns.o
CC build/lwip/lwip/src/core/tcp_out.o
CC build/lwip/lwip/src/core/udp.o
CC build/lwip/lwip/src/core/altcp_tcp.o
CC build/lwip/lwip/src/core/def.o
CC build/lwip/lwip/src/core/altcp.o
CC build/lwip/lwip/src/core/stats.o
CC build/lwip/lwip/src/core/netif.o
CC build/lwip/lwip/src/core/pbuf.o
CC build/lwip/lwip/src/core/tcp_in.o
CC build/lwip/lwip/src/core/raw.o
CC build/lwip/lwip/src/core/ip.o
CC build/lwip/lwip/src/core/dns.o
CC build/lwip/lwip/src/core/altcp_alloc.o
CC build/lwip/lwip/src/core/timeouts.o
CC build/lwip/lwip/src/core/tcp.o
CC build/lwip/lwip/src/core/sys.o
CC build/lwip/lwip/src/core/memp.o
CC build/lwip/lwip/src/core/init.o
CC build/lwip/lwip/src/core/inet_chksum.o
CC build/lwip/lwip/src/core/mem.o
CC build/lwip/lwip/src/core/ipv4/icmp.o
CC build/lwip/lwip/src/core/ipv4/autoip.o
CC build/lwip/lwip/src/core/ipv4/ip4.o
CC build/lwip/lwip/src/core/ipv4/igmp.o
CC build/lwip/lwip/src/core/ipv4/ip4_addr.o
CC build/lwip/lwip/src/core/ipv4/etharp.o
CC build/lwip/lwip/src/core/ipv4/dhcp.o
CC build/lwip/lwip/src/core/ipv4/ip4_frag.o
CC build/lwip/lwip/src/core/ipv6/icmp6.o
CC build/lwip/lwip/src/core/ipv6/ethip6.o
CC build/lwip/lwip/src/core/ipv6/mld6.o
CC build/lwip/lwip/src/core/ipv6/nd6.o
CC build/lwip/lwip/src/core/ipv6/ip6.o
CC build/lwip/lwip/src/core/ipv6/ip6_addr.o
CC build/lwip/lwip/src/core/ipv6/inet6.o
CC build/lwip/lwip/src/core/ipv6/dhcp6.o
CC build/lwip/lwip/src/core/ipv6/ip6_frag.o
CC build/lwip/lwip/src/netif/bridgeif.o
CC build/lwip/lwip/src/netif/lowpan6_common.o
CC build/lwip/lwip/src/netif/lowpan6_ble.o
CC build/lwip/lwip/src/netif/lowpan6.o
CC build/lwip/lwip/src/netif/zepif.o
CC build/lwip/lwip/src/netif/bridgeif_fdb.o
CC build/lwip/lwip/src/netif/ethernet.o
CC build/lwip/lwip/src/netif/slipif.o
CC build/lwip/port/esp32/vfs_lwip.o
CC build/lwip/port/esp32/freertos/sys_arch.o
CC build/lwip/port/esp32/netif/ethernetif.o
CC build/lwip/port/esp32/netif/dhcp_state.o
CC build/lwip/port/esp32/netif/wlanif.o
CC build/lwip/port/esp32/debug/lwip_debug.o
AR build/lwip/liblwip.a
CC build/main/opcua_esp32.o
C:/msys32/home/toshi/esp/examples/opcua-esp32/main/opcua_esp32.c: In function 'wifi_scan':
C:/msys32/home/toshi/esp/examples/opcua-esp32/main/opcua_esp32.c:127:5: warning: 'esp_event_loop_init' is deprecated [-Wdeprecated-declarations]
     ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL));
     ^~~~~~~~~~~~~~~
In file included from C:/msys32/home/toshi/esp/esp-idf/components/esp_event/include/esp_event.h:26,
                 from C:/msys32/home/toshi/esp/esp-idf/components/esp_wifi/include/esp_wifi.h:64,
                 from C:/msys32/home/toshi/esp/examples/opcua-esp32/main/opcua_esp32.c:9:
C:/msys32/home/toshi/esp/esp-idf/components/esp_event/include/esp_event_legacy.h:227:11: note: declared here
 esp_err_t esp_event_loop_init(system_event_cb_t cb, void *ctx) __attribute__ ((deprecated));
           ^~~~~~~~~~~~~~~~~~~
AR build/main/libmain.a
CC build/mbedtls/mbedtls/library/poly1305.o
CC build/mbedtls/mbedtls/library/platform_util.o
CC build/mbedtls/mbedtls/library/havege.o
CC build/mbedtls/mbedtls/library/ssl_cookie.o
CC build/mbedtls/mbedtls/library/md5.o
CC build/mbedtls/mbedtls/library/certs.o
CC build/mbedtls/mbedtls/library/ssl_ciphersuites.o
CC build/mbedtls/mbedtls/library/camellia.o
CC build/mbedtls/mbedtls/library/x509_crl.o
CC build/mbedtls/mbedtls/library/threading.o
CC build/mbedtls/mbedtls/library/aesni.o
CC build/mbedtls/mbedtls/library/bignum.o
CC build/mbedtls/mbedtls/library/arc4.o
CC build/mbedtls/mbedtls/library/cipher_wrap.o
CC build/mbedtls/mbedtls/library/rsa_internal.o
CC build/mbedtls/mbedtls/library/aes.o
CC build/mbedtls/mbedtls/library/xtea.o
CC build/mbedtls/mbedtls/library/base64.o
CC build/mbedtls/mbedtls/library/sha512.o
CC build/mbedtls/mbedtls/library/pkcs11.o
CC build/mbedtls/mbedtls/library/ecdsa.o
CC build/mbedtls/mbedtls/library/asn1write.o
CC build/mbedtls/mbedtls/library/oid.o
CC build/mbedtls/mbedtls/library/ecjpake.o
CC build/mbedtls/mbedtls/library/ssl_tls.o
CC build/mbedtls/mbedtls/library/debug.o
CC build/mbedtls/mbedtls/library/aria.o
CC build/mbedtls/mbedtls/library/ecdh.o
CC build/mbedtls/mbedtls/library/x509_crt.o
CC build/mbedtls/mbedtls/library/ssl_srv.o
CC build/mbedtls/mbedtls/library/sha1.o
CC build/mbedtls/mbedtls/library/chacha20.o
CC build/mbedtls/mbedtls/library/md2.o
CC build/mbedtls/mbedtls/library/x509_create.o
CC build/mbedtls/mbedtls/library/cmac.o
CC build/mbedtls/mbedtls/library/gcm.o
CC build/mbedtls/mbedtls/library/version.o
CC build/mbedtls/mbedtls/library/pem.o
CC build/mbedtls/mbedtls/library/padlock.o
CC build/mbedtls/mbedtls/library/asn1parse.o
CC build/mbedtls/mbedtls/library/timing.o
CC build/mbedtls/mbedtls/library/ssl_cli.o
CC build/mbedtls/mbedtls/library/pkwrite.o
CC build/mbedtls/mbedtls/library/ssl_cache.o
CC build/mbedtls/mbedtls/library/sha256.o
CC build/mbedtls/mbedtls/library/md_wrap.o
CC build/mbedtls/mbedtls/library/entropy.o
CC build/mbedtls/mbedtls/library/hkdf.o
CC build/mbedtls/mbedtls/library/rsa.o
CC build/mbedtls/mbedtls/library/ripemd160.o
CC build/mbedtls/mbedtls/library/nist_kw.o
CC build/mbedtls/mbedtls/library/pkcs5.o
CC build/mbedtls/mbedtls/library/version_features.o
CC build/mbedtls/mbedtls/library/cipher.o
CC build/mbedtls/mbedtls/library/entropy_poll.o
CC build/mbedtls/mbedtls/library/dhm.o
CC build/mbedtls/mbedtls/library/error.o
CC build/mbedtls/mbedtls/library/ssl_ticket.o
CC build/mbedtls/mbedtls/library/x509.o
CC build/mbedtls/mbedtls/library/blowfish.o
CC build/mbedtls/mbedtls/library/chachapoly.o
CC build/mbedtls/mbedtls/library/ecp.o
CC build/mbedtls/mbedtls/library/md4.o
CC build/mbedtls/mbedtls/library/x509_csr.o
CC build/mbedtls/mbedtls/library/pkparse.o
CC build/mbedtls/mbedtls/library/md.o
CC build/mbedtls/mbedtls/library/ccm.o
CC build/mbedtls/mbedtls/library/pkcs12.o
CC build/mbedtls/mbedtls/library/ecp_curves.o
CC build/mbedtls/mbedtls/library/pk_wrap.o
CC build/mbedtls/mbedtls/library/x509write_crt.o
CC build/mbedtls/mbedtls/library/ctr_drbg.o
CC build/mbedtls/mbedtls/library/platform.o
CC build/mbedtls/mbedtls/library/pk.o
CC build/mbedtls/mbedtls/library/x509write_csr.o
CC build/mbedtls/mbedtls/library/des.o
CC build/mbedtls/mbedtls/library/hmac_drbg.o
CC build/mbedtls/mbedtls/library/memory_buffer_alloc.o
CC build/mbedtls/port/esp_sha512.o
CC build/mbedtls/port/esp_mem.o
CC build/mbedtls/port/esp_hardware.o
CC build/mbedtls/port/net_sockets.o
CC build/mbedtls/port/esp_sha.o
CC build/mbedtls/port/esp_sha256.o
CC build/mbedtls/port/esp_timing.o
CC build/mbedtls/port/esp_sha1.o
CC build/mbedtls/port/mbedtls_debug.o
CC build/mbedtls/port/esp32/aes.o
CC build/mbedtls/port/esp32/sha.o
CC build/mbedtls/port/esp32/esp_bignum.o
AR build/mbedtls/libmbedtls.a
CC build/mdns/mdns.o
CC build/mdns/mdns_networking.o
CC build/mdns/mdns_console.o
AR build/mdns/libmdns.a
CC build/newlib/select.o
CC build/newlib/pthread.o
CC build/newlib/random.o
CC build/newlib/pwrite.o
CC build/newlib/locks.o
CC build/newlib/pread.o
CC build/newlib/utime.o
CC build/newlib/poll.o
CC build/newlib/syscall_table.o
CC build/newlib/syscalls.o
CC build/newlib/termios.o
CC build/newlib/reent_init.o
CC build/newlib/time.o
CC build/newlib/heap.o
AR build/newlib/libnewlib.a
CC build/nghttp/nghttp2/lib/nghttp2_map.o
CC build/nghttp/nghttp2/lib/nghttp2_queue.o
CC build/nghttp/nghttp2/lib/nghttp2_pq.o
CC build/nghttp/nghttp2/lib/nghttp2_submit.o
CC build/nghttp/nghttp2/lib/nghttp2_debug.o
CC build/nghttp/nghttp2/lib/nghttp2_hd_huffman_data.o
CC build/nghttp/nghttp2/lib/nghttp2_frame.o
CC build/nghttp/nghttp2/lib/nghttp2_helper.o
CC build/nghttp/nghttp2/lib/nghttp2_npn.o
CC build/nghttp/nghttp2/lib/nghttp2_option.o
CC build/nghttp/nghttp2/lib/nghttp2_buf.o
CC build/nghttp/nghttp2/lib/nghttp2_priority_spec.o
CC build/nghttp/nghttp2/lib/nghttp2_hd.o
CC build/nghttp/nghttp2/lib/nghttp2_stream.o
CC build/nghttp/nghttp2/lib/nghttp2_session.o
CC build/nghttp/nghttp2/lib/nghttp2_callbacks.o
CC build/nghttp/nghttp2/lib/nghttp2_rcbuf.o
CC build/nghttp/nghttp2/lib/nghttp2_hd_huffman.o
CC build/nghttp/nghttp2/lib/nghttp2_mem.o
CC build/nghttp/nghttp2/lib/nghttp2_version.o
CC build/nghttp/nghttp2/lib/nghttp2_outbound_item.o
CC build/nghttp/nghttp2/lib/nghttp2_http.o
CC build/nghttp/port/http_parser.o
AR build/nghttp/libnghttp.a
CXX build/nvs_flash/src/nvs_partition_manager.o
CXX build/nvs_flash/src/nvs_api.o
CXX build/nvs_flash/src/nvs_storage.o
CXX build/nvs_flash/src/nvs_handle_simple.o
CXX build/nvs_flash/src/nvs_pagemanager.o
CXX build/nvs_flash/src/nvs_handle_locked.o
CXX build/nvs_flash/src/nvs_item_hash_list.o
CXX build/nvs_flash/src/nvs_page.o
CXX build/nvs_flash/src/nvs_ops.o
CXX build/nvs_flash/src/nvs_types.o
CXX build/nvs_flash/src/nvs_cxx_api.o
AR build/nvs_flash/libnvs_flash.a
CC build/open62541lib/open62541.o
In file included from C:/msys32/home/toshi/esp/examples/opcua-esp32/components/open62541lib/open62541.c:28:
C:/msys32/home/toshi/esp/examples/opcua-esp32/components/open62541lib/include/open62541.h:117: warning: "UA_ARCHITECTURE_FREERTOSLWIP" redefined
 #define UA_ARCHITECTURE_FREERTOSLWIP

<command-line>: note: this is the location of the previous definition
C:/msys32/home/toshi/esp/examples/opcua-esp32/components/open62541lib/open62541.c:9978:9: note: #pragma message: No native IEEE 754 format detected. Use slow generic encoding.
 #pragma message "No native IEEE 754 format detected. Use slow generic encoding."
         ^~~~~~~
CC build/open62541lib/model.o
In file included from C:/msys32/home/toshi/esp/examples/opcua-esp32/components/open62541lib/model.c:1:
C:/msys32/home/toshi/esp/examples/opcua-esp32/components/open62541lib/include/open62541.h:117: warning: "UA_ARCHITECTURE_FREERTOSLWIP" redefined
 #define UA_ARCHITECTURE_FREERTOSLWIP

<command-line>: note: this is the location of the previous definition
CC build/open62541lib/DHT22.o
AR build/open62541lib/libopen62541lib.a
CC build/perfmon/xtensa_perfmon_apis.o
CC build/perfmon/xtensa_perfmon_access.o
CC build/perfmon/xtensa_perfmon_masks.o
AR build/perfmon/libperfmon.a
CC build/protobuf-c/protobuf-c/protobuf-c/protobuf-c.o
AR build/protobuf-c/libprotobuf-c.a
CC build/protocomm/src/common/protocomm.o
CC build/protocomm/src/security/security1.o
CC build/protocomm/src/security/security0.o
CC build/protocomm/proto-c/sec0.pb-c.o
CC build/protocomm/proto-c/constants.pb-c.o
CC build/protocomm/proto-c/session.pb-c.o
CC build/protocomm/proto-c/sec1.pb-c.o
CC build/protocomm/src/transports/protocomm_httpd.o
CC build/protocomm/src/transports/protocomm_console.o
AR build/protocomm/libprotocomm.a
CC build/pthread/pthread.o
CC build/pthread/pthread_cond_var.o
CC build/pthread/pthread_local_storage.o
AR build/pthread/libpthread.a
CC build/sdmmc/sdmmc_sd.o
CC build/sdmmc/sdmmc_cmd.o
CC build/sdmmc/sdmmc_mmc.o
CC build/sdmmc/sdmmc_common.o
CC build/sdmmc/sdmmc_io.o
CC build/sdmmc/sdmmc_init.o
AR build/sdmmc/libsdmmc.a
CC build/soc/esp32/emac_hal.o
CC build/soc/esp32/rtc_clk.o
CC build/soc/esp32/rtc_time.o
CC build/soc/esp32/rtc_sleep.o
CC build/soc/esp32/gpio_periph.o
CC build/soc/esp32/i2s_periph.o
CC build/soc/esp32/rtc_clk_init.o
CC build/soc/esp32/ledc_periph.o
CC build/soc/esp32/spi_periph.o
CC build/soc/esp32/rtc_init.o
CC build/soc/esp32/sdio_slave_periph.o
CC build/soc/esp32/rtc_periph.o
CC build/soc/esp32/uart_periph.o
CC build/soc/esp32/rtc_wdt.o
CC build/soc/esp32/sdmmc_periph.o
CC build/soc/esp32/adc_periph.o
CC build/soc/esp32/i2c_periph.o
CC build/soc/esp32/interrupts.o
CC build/soc/esp32/cpu_util.o
CC build/soc/esp32/touch_sensor_periph.o
CC build/soc/esp32/rtc_io_periph.o
CC build/soc/esp32/touch_sensor_hal.o
CC build/soc/esp32/rtc_pm.o
CC build/soc/esp32/soc_memory_layout.o
CC build/soc/esp32/dac_periph.o
CC build/soc/src/soc_include_legacy_warn.o
CC build/soc/src/compare_set.o
CC build/soc/src/memory_layout_utils.o
CC build/soc/src/lldesc.o
CC build/soc/src/hal/pcnt_hal.o
CC build/soc/src/hal/gpio_hal.o
CC build/soc/src/hal/spi_flash_hal_gpspi.o
CC build/soc/src/hal/ledc_hal.o
CC build/soc/src/hal/rmt_hal.o
CC build/soc/src/hal/ledc_hal_iram.o
CC build/soc/src/hal/i2s_hal.o
CC build/soc/src/hal/sdio_slave_hal.o
CC build/soc/src/hal/timer_hal.o
CC build/soc/src/hal/spi_hal_iram.o
CC build/soc/src/hal/touch_sensor_hal.o
CC build/soc/src/hal/uart_hal.o
CC build/soc/src/hal/sigmadelta_hal.o
CC build/soc/src/hal/spi_flash_hal.o
CC build/soc/src/hal/uart_hal_iram.o
CC build/soc/src/hal/spi_flash_hal_iram.o
CC build/soc/src/hal/adc_hal.o
CC build/soc/src/hal/i2c_hal.o
CC build/soc/src/hal/i2c_hal_iram.o
CC build/soc/src/hal/rtc_io_hal.o
CC build/soc/src/hal/spi_slave_hal.o
CC build/soc/src/hal/can_hal.o
CC build/soc/src/hal/mcpwm_hal.o
CC build/soc/src/hal/dac_hal.o
CC build/soc/src/hal/spi_slave_hal_iram.o
CC build/soc/src/hal/spi_hal.o
AR build/soc/libsoc.a
CC build/spi_flash/esp_flash_spi_init.o
CC build/spi_flash/memspi_host_driver.o
CC build/spi_flash/flash_ops.o
CC build/spi_flash/spi_flash_chip_issi.o
CC build/spi_flash/esp_flash_api.o
CC build/spi_flash/cache_utils.o
CC build/spi_flash/spi_flash_chip_gd.o
CC build/spi_flash/spi_flash_os_func_noos.o
CC build/spi_flash/spi_flash_chip_generic.o
CC build/spi_flash/partition.o
CC build/spi_flash/spi_flash_chip_drivers.o
CC build/spi_flash/flash_mmap.o
CC build/spi_flash/spi_flash_os_func_app.o
CC build/spi_flash/esp32/spi_flash_rom_patch.o
CC build/spi_flash/esp32/flash_ops_esp32.o
AR build/spi_flash/libspi_flash.a
CC build/spiffs/esp_spiffs.o
CC build/spiffs/spiffs_api.o
CC build/spiffs/spiffs/src/spiffs_hydrogen.o
CC build/spiffs/spiffs/src/spiffs_check.o
CC build/spiffs/spiffs/src/spiffs_nucleus.o
CC build/spiffs/spiffs/src/spiffs_gc.o
CC build/spiffs/spiffs/src/spiffs_cache.o
AR build/spiffs/libspiffs.a
CC build/tcp_transport/transport_tcp.o
CC build/tcp_transport/transport.o
CC build/tcp_transport/transport_ssl.o
CC build/tcp_transport/transport_utils.o
CC build/tcp_transport/transport_ws.o
AR build/tcp_transport/libtcp_transport.a
CC build/tcpip_adapter/tcpip_adapter_compat.o
AR build/tcpip_adapter/libtcpip_adapter.a
CC build/ulp/ulp_macro.o
CC build/ulp/ulp.o
AR build/ulp/libulp.a
CC build/unity/unity/src/unity.o
CC build/unity/unity_port_esp32.o
CC build/unity/unity_runner.o
AR build/unity/libunity.a
CC build/vfs/vfs.o
CC build/vfs/vfs_semihost.o
CC build/vfs/vfs_uart.o
AR build/vfs/libvfs.a
CXX build/wear_levelling/WL_Ext_Perf.o
CXX build/wear_levelling/Partition.o
CXX build/wear_levelling/SPI_Flash.o
CXX build/wear_levelling/WL_Ext_Safe.o
CXX build/wear_levelling/crc32.o
CXX build/wear_levelling/WL_Flash.o
CXX build/wear_levelling/wear_levelling.o
AR build/wear_levelling/libwear_levelling.a
CC build/wifi_provisioning/src/wifi_config.o
CC build/wifi_provisioning/src/handlers.o
CC build/wifi_provisioning/src/wifi_scan.o
CC build/wifi_provisioning/src/scheme_softap.o
CC build/wifi_provisioning/src/scheme_console.o
CC build/wifi_provisioning/src/manager.o
CC build/wifi_provisioning/proto-c/wifi_scan.pb-c.o
CC build/wifi_provisioning/proto-c/wifi_config.pb-c.o
CC build/wifi_provisioning/proto-c/wifi_constants.pb-c.o
AR build/wifi_provisioning/libwifi_provisioning.a
CC build/wpa_supplicant/port/os_xtensa.o
CC build/wpa_supplicant/src/ap/ap_config.o
CC build/wpa_supplicant/src/ap/wpa_auth.o
CC build/wpa_supplicant/src/ap/ieee802_1x.o
CC build/wpa_supplicant/src/ap/wpa_auth_ie.o
CC build/wpa_supplicant/src/common/wpa_common.o
CC build/wpa_supplicant/src/common/sae.o
CC build/wpa_supplicant/src/crypto/ms_funcs.o
CC build/wpa_supplicant/src/crypto/crypto_internal-modexp.o
CC build/wpa_supplicant/src/crypto/bignum.o
CC build/wpa_supplicant/src/crypto/sha1-pbkdf2.o
CC build/wpa_supplicant/src/crypto/aes-ccm.o
CC build/wpa_supplicant/src/crypto/aes-cbc.o
CC build/wpa_supplicant/src/crypto/md5.o
CC build/wpa_supplicant/src/crypto/rc4.o
CC build/wpa_supplicant/src/crypto/sha256.o
CC build/wpa_supplicant/src/crypto/dh_groups.o
CC build/wpa_supplicant/src/crypto/md4-internal.o
CC build/wpa_supplicant/src/crypto/sha1-internal.o
CC build/wpa_supplicant/src/crypto/aes-wrap.o
CC build/wpa_supplicant/src/crypto/crypto_mbedtls.o
CC build/wpa_supplicant/src/crypto/crypto_internal-cipher.o
CC build/wpa_supplicant/src/crypto/aes-omac1.o
CC build/wpa_supplicant/src/crypto/dh_group5.o
CC build/wpa_supplicant/src/crypto/crypto_ops.o
CC build/wpa_supplicant/src/crypto/des-internal.o
CC build/wpa_supplicant/src/crypto/crypto_internal-rsa.o
CC build/wpa_supplicant/src/crypto/ccmp.o
CC build/wpa_supplicant/src/crypto/aes-unwrap.o
CC build/wpa_supplicant/src/crypto/crypto_internal.o
CC build/wpa_supplicant/src/crypto/aes-internal-dec.o
CC build/wpa_supplicant/src/crypto/sha1.o
CC build/wpa_supplicant/src/crypto/aes-internal.o
CC build/wpa_supplicant/src/crypto/md5-internal.o
CC build/wpa_supplicant/src/crypto/sha256-internal.o
CC build/wpa_supplicant/src/crypto/aes-internal-enc.o
CC build/wpa_supplicant/src/eap_peer/eap_peap_common.o
CC build/wpa_supplicant/src/eap_peer/chap.o
CC build/wpa_supplicant/src/eap_peer/eap_mschapv2.o
CC build/wpa_supplicant/src/eap_peer/eap_peap.o
CC build/wpa_supplicant/src/eap_peer/eap_ttls.o
CC build/wpa_supplicant/src/eap_peer/eap_tls_common.o
CC build/wpa_supplicant/src/eap_peer/eap_tls.o
CC build/wpa_supplicant/src/eap_peer/mschapv2.o
CC build/wpa_supplicant/src/eap_peer/eap_common.o
CC build/wpa_supplicant/src/eap_peer/eap.o
CC build/wpa_supplicant/src/rsn_supp/wpa.o
CC build/wpa_supplicant/src/rsn_supp/wpa_ie.o
CC build/wpa_supplicant/src/rsn_supp/pmksa_cache.o
CC build/wpa_supplicant/src/tls/tls_internal.o
CC build/wpa_supplicant/src/tls/tlsv1_common.o
CC build/wpa_supplicant/src/tls/tlsv1_server_write.o
CC build/wpa_supplicant/src/tls/bignum.o
CC build/wpa_supplicant/src/tls/tlsv1_record.o
CC build/wpa_supplicant/src/tls/pkcs5.o
CC build/wpa_supplicant/src/tls/pkcs1.o
CC build/wpa_supplicant/src/tls/tlsv1_client_write.o
CC build/wpa_supplicant/src/tls/tlsv1_server_read.o
CC build/wpa_supplicant/src/tls/asn1.o
CC build/wpa_supplicant/src/tls/pkcs8.o
CC build/wpa_supplicant/src/tls/rsa.o
CC build/wpa_supplicant/src/tls/tlsv1_client.o
CC build/wpa_supplicant/src/tls/tlsv1_client_read.o
CC build/wpa_supplicant/src/tls/tlsv1_cred.o
CC build/wpa_supplicant/src/tls/x509v3.o
CC build/wpa_supplicant/src/tls/tlsv1_server.o
CC build/wpa_supplicant/src/utils/uuid.o
CC build/wpa_supplicant/src/utils/wpabuf.o
CC build/wpa_supplicant/src/utils/ext_password.o
CC build/wpa_supplicant/src/utils/base64.o
CC build/wpa_supplicant/src/utils/common.o
CC build/wpa_supplicant/src/utils/wpa_debug.o
CC build/wpa_supplicant/src/esp_supplicant/esp_wpa_main.o
CC build/wpa_supplicant/src/esp_supplicant/esp_wpa2.o
CC build/wpa_supplicant/src/esp_supplicant/esp_wpa3.o
CC build/wpa_supplicant/src/esp_supplicant/esp_hostap.o
CC build/wpa_supplicant/src/esp_supplicant/esp_wps.o
CC build/wpa_supplicant/src/esp_supplicant/esp_wpas_glue.o
CC build/wpa_supplicant/src/wps/wps_enrollee.o
CC build/wpa_supplicant/src/wps/wps_attr_build.o
CC build/wpa_supplicant/src/wps/wps_registrar.o
CC build/wpa_supplicant/src/wps/wps_common.o
CC build/wpa_supplicant/src/wps/wps.o
CC build/wpa_supplicant/src/wps/wps_dev_attr.o
CC build/wpa_supplicant/src/wps/wps_attr_parse.o
CC build/wpa_supplicant/src/wps/wps_validate.o
CC build/wpa_supplicant/src/wps/wps_attr_process.o
AR build/wpa_supplicant/libwpa_supplicant.a
CC build/xtensa/trax.o
CC build/xtensa/expression_with_stack_xtensa.o
CC build/xtensa/debug_helpers.o
CC build/xtensa/stdatomic.o
CC build/xtensa/eri.o
AS build/xtensa/expression_with_stack_xtensa_asm.o
AS build/xtensa/debug_helpers_asm.o
AR build/xtensa/libxtensa.a
Generating esp32.project.ld
LD build/opcua_esp32.elf
esptool.py v3.0-dev
To flash all build output, run 'make flash' or:
python /home/toshi/esp/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /home/toshi/esp/examples/opcua-esp32/build/bootloader/bootloader.bin 0x10000 /home/toshi/esp/examples/opcua-esp32/build/opcua_esp32.bin 0x8000 /home/toshi/esp/examples/opcua-esp32/build/partitions_singleapp.bin
$
```

今回は無事にビルドに成功しました。
いろいろと回り道ましたが、Toolchain、ESP-IDF、OPC-UA全部最新だと何も考えずにビルド出来たっぽい。

### ESP-WROOM-32にOPC UA Serverを焼く

make flashを実行。

```
$ make flash
Toolchain path: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: esp-2019r2
Compiler version: 8.2.0
Python requirements from C:/msys32/home/toshi/esp/esp-idf/requirements.txt are satisfied.

App "opcua_esp32" version: 771b79f-dirty
Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000)...
esptool.py v3.0-dev
Serial port C:/msys32/dev/ttyUSB0
Traceback (most recent call last):
  File "C:/msys32/home/toshi/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 3418, in <module>
    _main()
  File "C:/msys32/home/toshi/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 3411, in _main
    main()
  File "C:/msys32/home/toshi/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 3075, in main
    esp = chip_class(each_port, initial_baud, args.trace)
  File "C:/msys32/home/toshi/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 261, in __init__
    self._port = serial.serial_for_url(port)
  File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/__init__.py", line 88, in serial_for_url
    instance.open()
  File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/serialwin32.py", line 62, in open
    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'C:/msys32/dev/ttyUSB0': WindowsError(2, '\x8ew\x92\xe8\x82\xb3\x82\xea\x82\xbd\x83t\x83@\x83C\x83\x8b\x82\xaa\x8c\xa9\x82\xc2\x82\xa9\x82\xe8\x82\xdc\x82\xb9\x82\xf1\x81B')
make: *** [/home/toshi/esp/esp-idf/components/esptool_py/Makefile.projbuild:92: flash] エラー 1
```
今度はポートが認識できていないのかなー。

### シリアルポートの設定

make menuconfigでシリアルポートを設定する。
menuconfigが起動したら『Serial Flasher config』を選択する。
![menu1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/28184/159161ba-9989-37fd-6acd-0eed2e135914.png)

一番上の『Default serial port』を選択する。
![menu2.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/28184/090b8648-60dc-6167-10e3-e3e1af8f7e75.png)

使用するSerial Portを設定する。

![menu3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/28184/c8cd09fb-a922-26e0-1407-2537719e1db7.png)

今回はSerial portはCOM6に繋がっているようなのでttyS5(ttyS6じゃないところに注意！）を設定する。

![port.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/28184/b6748601-20a3-f955-8a21-f701ef7763ee.png)

コマンドラインからも確認できます。

```
$ ls /dev/ttyS*
/dev/ttyS2  /dev/ttyS5
```

シリアルが設定できたので『make flash』コマンドを実行してみる。

```
$ make flash
Toolchain path: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: esp-2019r2
Compiler version: 8.2.0
Python requirements from C:/msys32/home/toshi/esp/esp-idf/requirements.txt are satisfied.
App "opcua_esp32" version: 771b79f-dirty
CC build/bootloader/bootloader_support/src/bootloader_random.o
CC build/bootloader/bootloader_support/src/flash_encrypt.o
CC build/bootloader/bootloader_support/src/esp_image_format.o
CC build/bootloader/bootloader_support/src/flash_partitions.o
CC build/bootloader/bootloader_support/src/bootloader_flash_config_esp32.o
CC build/bootloader/bootloader_support/src/bootloader_clock.o
CC build/bootloader/bootloader_support/src/bootloader_common.o
CC build/bootloader/bootloader_support/src/bootloader_utility.o
CC build/bootloader/bootloader_support/src/bootloader_init.o
CC build/bootloader/bootloader_support/src/flash_qio_mode.o
CC build/bootloader/bootloader_support/src/bootloader_flash.o
CC build/bootloader/bootloader_support/src/bootloader_efuse_esp32.o
CC build/bootloader/bootloader_support/src/esp32/flash_encrypt.o
CC build/bootloader/bootloader_support/src/esp32/bootloader_esp32.o
CC build/bootloader/bootloader_support/src/esp32/bootloader_sha.o
CC build/bootloader/bootloader_support/src/esp32/secure_boot.o
CC build/bootloader/bootloader_support/src/esp32/secure_boot_signatures.o
AR build/bootloader/bootloader_support/libbootloader_support.a
CC build/bootloader/log/log_buffers.o
CC build/bootloader/log/log.o
AR build/bootloader/log/liblog.a
CC build/bootloader/spi_flash/esp32/spi_flash_rom_patch.o
AR build/bootloader/spi_flash/libspi_flash.a
CC build/bootloader/soc/esp32/emac_hal.o
CC build/bootloader/soc/esp32/rtc_clk.o
CC build/bootloader/soc/esp32/rtc_time.o
CC build/bootloader/soc/esp32/rtc_sleep.o
CC build/bootloader/soc/esp32/rtc_clk_init.o
CC build/bootloader/soc/esp32/spi_periph.o
CC build/bootloader/soc/esp32/rtc_init.o
CC build/bootloader/soc/esp32/cpu_util.o
CC build/bootloader/soc/esp32/touch_sensor_hal.o
CC build/bootloader/soc/src/soc_include_legacy_warn.o
CC build/bootloader/soc/src/compare_set.o
CC build/bootloader/soc/src/memory_layout_utils.o
CC build/bootloader/soc/src/lldesc.o
CC build/bootloader/soc/src/hal/gpio_hal.o
CC build/bootloader/soc/src/hal/spi_flash_hal_gpspi.o
CC build/bootloader/soc/src/hal/ledc_hal.o
CC build/bootloader/soc/src/hal/ledc_hal_iram.o
CC build/bootloader/soc/src/hal/i2s_hal.o
CC build/bootloader/soc/src/hal/sdio_slave_hal.o
CC build/bootloader/soc/src/hal/timer_hal.o
CC build/bootloader/soc/src/hal/spi_hal_iram.o
CC build/bootloader/soc/src/hal/touch_sensor_hal.o
CC build/bootloader/soc/src/hal/spi_flash_hal.o
CC build/bootloader/soc/src/hal/spi_flash_hal_iram.o
CC build/bootloader/soc/src/hal/spi_slave_hal.o
CC build/bootloader/soc/src/hal/can_hal.o
CC build/bootloader/soc/src/hal/mcpwm_hal.o
CC build/bootloader/soc/src/hal/dac_hal.o
CC build/bootloader/soc/src/hal/spi_slave_hal_iram.o
CC build/bootloader/soc/src/hal/spi_hal.o
AR build/bootloader/soc/libsoc.a
CC build/bootloader/main/bootloader_start.o
AR build/bootloader/main/libmain.a
CC build/bootloader/efuse/esp32/esp_efuse_table.o
CC build/bootloader/efuse/src/esp_efuse_api.o
CC build/bootloader/efuse/src/esp_efuse_fields.o
CC build/bootloader/efuse/src/esp_efuse_utility.o
CC build/bootloader/efuse/src/esp32/esp_efuse_fields.o
CC build/bootloader/efuse/src/esp32/esp_efuse_utility.o
CC build/bootloader/efuse/src/esp32/esp_efuse_api.o
AR build/bootloader/efuse/libefuse.a
LD build/bootloader/bootloader.elf
esptool.py v3.0-dev
Python requirements from C:/msys32/home/toshi/esp/esp-idf/requirements.txt are satisfied.
Building partitions from /home/toshi/esp/esp-idf/components/partition_table/partitions_singleapp.csv...

CC build/app_trace/heap_trace_tohost.o
CC build/app_trace/app_trace.o
CC build/app_trace/host_file_io.o
CC build/app_trace/app_trace_util.o
CC build/app_trace/gcov/gcov_rtio.o
AR build/app_trace/libapp_trace.a
App "opcua_esp32" version: 771b79f-dirty
CC build/app_update/esp_app_desc.o
CC build/app_update/esp_ota_ops.o
AR build/app_update/libapp_update.a
CC build/bootloader_support/src/bootloader_random.o
CC build/bootloader_support/src/flash_encrypt.o
CC build/bootloader_support/src/esp_image_format.o
CC build/bootloader_support/src/flash_partitions.o
CC build/bootloader_support/src/bootloader_flash_config_esp32.o
CC build/bootloader_support/src/bootloader_clock.o
CC build/bootloader_support/src/bootloader_common.o
CC build/bootloader_support/src/bootloader_utility.o
CC build/bootloader_support/src/flash_qio_mode.o
CC build/bootloader_support/src/bootloader_flash.o
CC build/bootloader_support/src/bootloader_efuse_esp32.o
CC build/bootloader_support/src/idf/bootloader_sha.o
CC build/bootloader_support/src/idf/secure_boot_signatures.o
AR build/bootloader_support/libbootloader_support.a
CC build/cbor/tinycbor/src/cborencoder_close_container_checked.o
CC build/cbor/tinycbor/src/cborpretty_stdio.o
CC build/cbor/tinycbor/src/cbortojson.o
CC build/cbor/tinycbor/src/cborpretty.o
CC build/cbor/tinycbor/src/cborerrorstrings.o
CC build/cbor/tinycbor/src/cborencoder.o
CC build/cbor/tinycbor/src/cborparser_dup_string.o
CC build/cbor/tinycbor/src/open_memstream.o
CC build/cbor/tinycbor/src/cborvalidation.o
CC build/cbor/tinycbor/src/cborparser.o
AR build/cbor/libcbor.a
CC build/console/commands.o
AR build/console/libconsole.a
CXX build/cxx/cxx_exception_stubs.o
CXX build/cxx/cxx_guards.o
AR build/cxx/libcxx.a
CC build/driver/adc.o
CC build/driver/rmt.o
CC build/driver/i2c.o
CC build/driver/rtc_io.o
CC build/driver/spi_slave.o
CC build/driver/can.o
CC build/driver/sdmmc_transaction.o
CC build/driver/mcpwm.o
CC build/driver/dac.o
CC build/driver/sdmmc_host.o
CC build/driver/pcnt.o
CC build/driver/timer.o
CC build/driver/gpio.o
CC build/driver/sdspi_host.o
CC build/driver/uart.o
CC build/driver/ledc.o
CC build/driver/periph_ctrl.o
CC build/driver/i2s.o
CC build/driver/sdio_slave.o
CC build/driver/touch_sensor_common.o
CC build/driver/sdspi_transaction.o
CC build/driver/sigmadelta.o
CC build/driver/spi_master.o
CC build/driver/rtc_module.o
CC build/driver/spi_common.o
CC build/driver/esp32/touch_sensor.o
AR build/driver/libdriver.a
CC build/efuse/esp32/esp_efuse_table.o
CC build/efuse/src/esp_efuse_api.o
CC build/efuse/src/esp_efuse_fields.o
CC build/efuse/src/esp_efuse_utility.o
CC build/efuse/src/esp32/esp_efuse_fields.o
CC build/efuse/src/esp32/esp_efuse_utility.o
CC build/efuse/src/esp32/esp_efuse_api.o
AR build/efuse/libefuse.a
CC build/esp-tls/esp_tls.o
CC build/esp-tls/esp_tls_mbedtls.o
AR build/esp-tls/libesp-tls.a
CC build/esp32/int_wdt.o
CC build/esp32/brownout.o
CC build/esp32/esp_himem.o
CC build/esp32/dport_access.o
CC build/esp32/hw_random.o
CC build/esp32/pm_esp32.o
CC build/esp32/system_api_esp32.o
CC build/esp32/intr_alloc.o
CC build/esp32/cache_err_int.o
CC build/esp32/spiram.o
CC build/esp32/clk.o
CC build/esp32/spiram_psram.o
CC build/esp32/esp_timer_esp32.o
CC build/esp32/pm_trace.o
CC build/esp32/crosscore_int.o
CC build/esp32/cache_sram_mmu.o
CC build/esp32/cpu_start.o
CC build/esp32/sleep_modes.o
CC build/esp32/task_wdt.o
CC build/esp32/reset_reason.o
CC build/esp32/panic.o
AS build/esp32/dport_panic_highint_hdl.o
AR build/esp32/libesp32.a
CC build/esp_adc_cal/esp_adc_cal.o
AR build/esp_adc_cal/libesp_adc_cal.a
CC build/esp_common/src/esp_timer.o
CC build/esp_common/src/stack_check.o
CC build/esp_common/src/esp_err_to_name.o
CC build/esp_common/src/pm_locks.o
CC build/esp_common/src/ipc.o
CC build/esp_common/src/ets_timer_legacy.o
CC build/esp_common/src/freertos_hooks.o
CC build/esp_common/src/mac_addr.o
CC build/esp_common/src/system_api.o
CC build/esp_common/src/dbg_stubs.o
AR build/esp_common/libesp_common.a
CC build/esp_eth/src/esp_eth_netif_glue.o
CC build/esp_eth/src/esp_eth_phy_dm9051.o
CC build/esp_eth/src/esp_eth_phy_dp83848.o
CC build/esp_eth/src/esp_eth_mac_dm9051.o
CC build/esp_eth/src/esp_eth.o
CC build/esp_eth/src/esp_eth_phy_rtl8201.o
CC build/esp_eth/src/esp_eth_mac_esp32.o
CC build/esp_eth/src/esp_eth_phy_ip101.o
CC build/esp_eth/src/esp_eth_phy_lan8720.o
CC build/esp_eth/src/esp_eth_phy.o
AR build/esp_eth/libesp_eth.a
CC build/esp_event/esp_event_private.o
CC build/esp_event/event_loop_legacy.o
CC build/esp_event/esp_event.o
CC build/esp_event/event_send.o
CC build/esp_event/default_event_loop.o
AR build/esp_event/libesp_event.a
CC build/esp_gdbstub/src/gdbstub.o
CC build/esp_gdbstub/src/packet.o
CC build/esp_gdbstub/esp32/gdbstub_esp32.o
CC build/esp_gdbstub/xtensa/gdbstub_xtensa.o
AR build/esp_gdbstub/libesp_gdbstub.a
CC build/esp_http_client/esp_http_client.o
CC build/esp_http_client/lib/http_utils.o
CC build/esp_http_client/lib/http_auth.o
CC build/esp_http_client/lib/http_header.o
AR build/esp_http_client/libesp_http_client.a
CC build/esp_http_server/src/httpd_sess.o
CC build/esp_http_server/src/httpd_parse.o
CC build/esp_http_server/src/httpd_uri.o
CC build/esp_http_server/src/httpd_txrx.o
CC build/esp_http_server/src/httpd_main.o
CC build/esp_http_server/src/util/ctrl_sock.o
AR build/esp_http_server/libesp_http_server.a
CC build/esp_https_ota/src/esp_https_ota.o
AR build/esp_https_ota/libesp_https_ota.a
CC build/esp_local_ctrl/src/esp_local_ctrl.o
CC build/esp_local_ctrl/src/esp_local_ctrl_handler.o
CC build/esp_local_ctrl/proto-c/esp_local_ctrl.pb-c.o
AR build/esp_local_ctrl/libesp_local_ctrl.a
CC build/esp_netif/esp_netif_handlers.o
CC build/esp_netif/esp_netif_objects.o
CC build/esp_netif/esp_netif_defaults.o
CC build/esp_netif/lwip/esp_netif_lwip_defaults.o
CC build/esp_netif/lwip/esp_netif_lwip.o
CC build/esp_netif/lwip/esp_netif_sta_list.o
CC build/esp_netif/lwip/esp_netif_lwip_ppp.o
CC build/esp_netif/loopback/esp_netif_loopback.o
AR build/esp_netif/libesp_netif.a
CC build/esp_ringbuf/ringbuf.o
AR build/esp_ringbuf/libesp_ringbuf.a
CC build/esp_serial_slave_link/essl.o
CC build/esp_serial_slave_link/essl_sdio.o
AR build/esp_serial_slave_link/libesp_serial_slave_link.a
CC build/esp_websocket_client/esp_websocket_client.o
AR build/esp_websocket_client/libesp_websocket_client.a
CC build/esp_wifi/src/wifi_init.o
CC build/esp_wifi/src/wifi_netif.o
CC build/esp_wifi/src/coexist.o
CC build/esp_wifi/src/smartconfig_ack.o
CC build/esp_wifi/src/mesh_event.o
CC build/esp_wifi/src/phy_init.o
CC build/esp_wifi/src/wifi_default.o
CC build/esp_wifi/src/smartconfig.o
CC build/esp_wifi/src/lib_printf.o
CC build/esp_wifi/esp32/esp_adapter.o
AR build/esp_wifi/libesp_wifi.a
CC build/espcoredump/src/core_dump_elf.o
CC build/espcoredump/src/core_dump_uart.o
CC build/espcoredump/src/core_dump_common.o
CC build/espcoredump/src/core_dump_flash.o
CC build/espcoredump/src/core_dump_port.o
AR build/espcoredump/libespcoredump.a
CC build/fatfs/diskio/diskio.o
CC build/fatfs/diskio/diskio_sdmmc.o
CC build/fatfs/diskio/diskio_rawflash.o
CC build/fatfs/diskio/diskio_wl.o
CC build/fatfs/vfs/vfs_fat.o
CC build/fatfs/vfs/vfs_fat_spiflash.o
CC build/fatfs/vfs/vfs_fat_sdmmc.o
CC build/fatfs/port/freertos/ffsystem.o
CC build/fatfs/src/ffunicode.o
CC build/fatfs/src/ff.o
AR build/fatfs/libfatfs.a
CC build/freertos/xtensa_overlay_os_hook.o
CC build/freertos/FreeRTOS-openocd.o
CC build/freertos/timers.o
CC build/freertos/tasks.o
CC build/freertos/event_groups.o
CC build/freertos/port.o
CC build/freertos/xtensa_init.o
CC build/freertos/list.o
CC build/freertos/croutine.o
CC build/freertos/queue.o
CC build/freertos/xtensa_intr.o
AS build/freertos/portasm.o
AS build/freertos/xtensa_vector_defaults.o
AS build/freertos/xtensa_vectors.o
AS build/freertos/xtensa_context.o
AS build/freertos/xtensa_intr_asm.o
AR build/freertos/libfreertos.a
CC build/heap/heap_caps_init.o
CC build/heap/heap_caps.o
CC build/heap/multi_heap.o
AR build/heap/libheap.a
CC build/log/log_buffers.o
CC build/log/log_freertos.o
CC build/log/log.o
AR build/log/liblog.a
CC build/lwip/apps/dhcpserver/dhcpserver.o
CC build/lwip/apps/ping/ping_sock.o
CC build/lwip/apps/ping/esp_ping.o
CC build/lwip/apps/ping/ping.o
CC build/lwip/apps/sntp/sntp.o
CC build/lwip/lwip/src/api/sockets.o
CC build/lwip/lwip/src/api/api_msg.o
CC build/lwip/lwip/src/api/err.o
CC build/lwip/lwip/src/api/if_api.o
CC build/lwip/lwip/src/api/netbuf.o
CC build/lwip/lwip/src/api/tcpip.o
CC build/lwip/lwip/src/api/netifapi.o
CC build/lwip/lwip/src/api/api_lib.o
CC build/lwip/lwip/src/api/netdb.o
CC build/lwip/lwip/src/apps/sntp/sntp.o
CC build/lwip/lwip/src/apps/netbiosns/netbiosns.o
CC build/lwip/lwip/src/core/tcp_out.o
CC build/lwip/lwip/src/core/udp.o
CC build/lwip/lwip/src/core/altcp_tcp.o
CC build/lwip/lwip/src/core/def.o
CC build/lwip/lwip/src/core/altcp.o
CC build/lwip/lwip/src/core/stats.o
CC build/lwip/lwip/src/core/netif.o
CC build/lwip/lwip/src/core/pbuf.o
CC build/lwip/lwip/src/core/tcp_in.o
CC build/lwip/lwip/src/core/raw.o
CC build/lwip/lwip/src/core/ip.o
CC build/lwip/lwip/src/core/dns.o
CC build/lwip/lwip/src/core/altcp_alloc.o
CC build/lwip/lwip/src/core/timeouts.o
CC build/lwip/lwip/src/core/tcp.o
CC build/lwip/lwip/src/core/sys.o
CC build/lwip/lwip/src/core/memp.o
CC build/lwip/lwip/src/core/init.o
CC build/lwip/lwip/src/core/inet_chksum.o
CC build/lwip/lwip/src/core/mem.o
CC build/lwip/lwip/src/core/ipv4/icmp.o
CC build/lwip/lwip/src/core/ipv4/autoip.o
CC build/lwip/lwip/src/core/ipv4/ip4.o
CC build/lwip/lwip/src/core/ipv4/igmp.o
CC build/lwip/lwip/src/core/ipv4/ip4_addr.o
CC build/lwip/lwip/src/core/ipv4/etharp.o
CC build/lwip/lwip/src/core/ipv4/dhcp.o
CC build/lwip/lwip/src/core/ipv4/ip4_frag.o
CC build/lwip/lwip/src/core/ipv6/icmp6.o
CC build/lwip/lwip/src/core/ipv6/ethip6.o
CC build/lwip/lwip/src/core/ipv6/mld6.o
CC build/lwip/lwip/src/core/ipv6/nd6.o
CC build/lwip/lwip/src/core/ipv6/ip6.o
CC build/lwip/lwip/src/core/ipv6/ip6_addr.o
CC build/lwip/lwip/src/core/ipv6/inet6.o
CC build/lwip/lwip/src/core/ipv6/dhcp6.o
CC build/lwip/lwip/src/core/ipv6/ip6_frag.o
CC build/lwip/lwip/src/netif/bridgeif.o
CC build/lwip/lwip/src/netif/lowpan6_common.o
CC build/lwip/lwip/src/netif/lowpan6_ble.o
CC build/lwip/lwip/src/netif/lowpan6.o
CC build/lwip/lwip/src/netif/zepif.o
CC build/lwip/lwip/src/netif/bridgeif_fdb.o
CC build/lwip/lwip/src/netif/ethernet.o
CC build/lwip/lwip/src/netif/slipif.o
CC build/lwip/port/esp32/vfs_lwip.o
CC build/lwip/port/esp32/freertos/sys_arch.o
CC build/lwip/port/esp32/netif/ethernetif.o
CC build/lwip/port/esp32/netif/dhcp_state.o
CC build/lwip/port/esp32/netif/wlanif.o
CC build/lwip/port/esp32/debug/lwip_debug.o
AR build/lwip/liblwip.a
CC build/main/opcua_esp32.o
C:/msys32/home/toshi/esp/examples/opcua-esp32/main/opcua_esp32.c: In function 'wifi_scan':
C:/msys32/home/toshi/esp/examples/opcua-esp32/main/opcua_esp32.c:127:5: warning: 'esp_event_loop_init' is deprecated [-Wdeprecated-declarations]
     ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL));
     ^~~~~~~~~~~~~~~
In file included from C:/msys32/home/toshi/esp/esp-idf/components/esp_event/include/esp_event.h:26,
                 from C:/msys32/home/toshi/esp/esp-idf/components/esp_wifi/include/esp_wifi.h:64,
                 from C:/msys32/home/toshi/esp/examples/opcua-esp32/main/opcua_esp32.c:9:
C:/msys32/home/toshi/esp/esp-idf/components/esp_event/include/esp_event_legacy.h:227:11: note: declared here
 esp_err_t esp_event_loop_init(system_event_cb_t cb, void *ctx) __attribute__ ((deprecated));
           ^~~~~~~~~~~~~~~~~~~
AR build/main/libmain.a
CC build/mbedtls/mbedtls/library/poly1305.o
CC build/mbedtls/mbedtls/library/platform_util.o
CC build/mbedtls/mbedtls/library/havege.o
CC build/mbedtls/mbedtls/library/ssl_cookie.o
CC build/mbedtls/mbedtls/library/md5.o
CC build/mbedtls/mbedtls/library/certs.o
CC build/mbedtls/mbedtls/library/ssl_ciphersuites.o
CC build/mbedtls/mbedtls/library/camellia.o
CC build/mbedtls/mbedtls/library/x509_crl.o
CC build/mbedtls/mbedtls/library/threading.o
CC build/mbedtls/mbedtls/library/aesni.o
CC build/mbedtls/mbedtls/library/bignum.o
CC build/mbedtls/mbedtls/library/arc4.o
CC build/mbedtls/mbedtls/library/cipher_wrap.o
CC build/mbedtls/mbedtls/library/rsa_internal.o
CC build/mbedtls/mbedtls/library/aes.o
CC build/mbedtls/mbedtls/library/xtea.o
CC build/mbedtls/mbedtls/library/base64.o
CC build/mbedtls/mbedtls/library/sha512.o
CC build/mbedtls/mbedtls/library/pkcs11.o
CC build/mbedtls/mbedtls/library/ecdsa.o
CC build/mbedtls/mbedtls/library/asn1write.o
CC build/mbedtls/mbedtls/library/oid.o
CC build/mbedtls/mbedtls/library/ecjpake.o
CC build/mbedtls/mbedtls/library/ssl_tls.o
CC build/mbedtls/mbedtls/library/debug.o
CC build/mbedtls/mbedtls/library/aria.o
CC build/mbedtls/mbedtls/library/ecdh.o
CC build/mbedtls/mbedtls/library/x509_crt.o
CC build/mbedtls/mbedtls/library/ssl_srv.o
CC build/mbedtls/mbedtls/library/sha1.o
CC build/mbedtls/mbedtls/library/chacha20.o
CC build/mbedtls/mbedtls/library/md2.o
CC build/mbedtls/mbedtls/library/x509_create.o
CC build/mbedtls/mbedtls/library/cmac.o
CC build/mbedtls/mbedtls/library/gcm.o
CC build/mbedtls/mbedtls/library/version.o
CC build/mbedtls/mbedtls/library/pem.o
CC build/mbedtls/mbedtls/library/padlock.o
CC build/mbedtls/mbedtls/library/asn1parse.o
CC build/mbedtls/mbedtls/library/timing.o
CC build/mbedtls/mbedtls/library/ssl_cli.o
CC build/mbedtls/mbedtls/library/pkwrite.o
CC build/mbedtls/mbedtls/library/ssl_cache.o
CC build/mbedtls/mbedtls/library/sha256.o
CC build/mbedtls/mbedtls/library/md_wrap.o
CC build/mbedtls/mbedtls/library/entropy.o
CC build/mbedtls/mbedtls/library/hkdf.o
CC build/mbedtls/mbedtls/library/rsa.o
CC build/mbedtls/mbedtls/library/ripemd160.o
CC build/mbedtls/mbedtls/library/nist_kw.o
CC build/mbedtls/mbedtls/library/pkcs5.o
CC build/mbedtls/mbedtls/library/version_features.o
CC build/mbedtls/mbedtls/library/cipher.o
CC build/mbedtls/mbedtls/library/entropy_poll.o
CC build/mbedtls/mbedtls/library/dhm.o
CC build/mbedtls/mbedtls/library/error.o
CC build/mbedtls/mbedtls/library/ssl_ticket.o
CC build/mbedtls/mbedtls/library/x509.o
CC build/mbedtls/mbedtls/library/blowfish.o
CC build/mbedtls/mbedtls/library/chachapoly.o
CC build/mbedtls/mbedtls/library/ecp.o
CC build/mbedtls/mbedtls/library/md4.o
CC build/mbedtls/mbedtls/library/x509_csr.o
CC build/mbedtls/mbedtls/library/pkparse.o
CC build/mbedtls/mbedtls/library/md.o
CC build/mbedtls/mbedtls/library/ccm.o
CC build/mbedtls/mbedtls/library/pkcs12.o
CC build/mbedtls/mbedtls/library/ecp_curves.o
CC build/mbedtls/mbedtls/library/pk_wrap.o
CC build/mbedtls/mbedtls/library/x509write_crt.o
CC build/mbedtls/mbedtls/library/ctr_drbg.o
CC build/mbedtls/mbedtls/library/platform.o
CC build/mbedtls/mbedtls/library/pk.o
CC build/mbedtls/mbedtls/library/x509write_csr.o
CC build/mbedtls/mbedtls/library/des.o
CC build/mbedtls/mbedtls/library/hmac_drbg.o
CC build/mbedtls/mbedtls/library/memory_buffer_alloc.o
CC build/mbedtls/port/esp_sha512.o
CC build/mbedtls/port/esp_mem.o
CC build/mbedtls/port/esp_hardware.o
CC build/mbedtls/port/net_sockets.o
CC build/mbedtls/port/esp_sha.o
CC build/mbedtls/port/esp_sha256.o
CC build/mbedtls/port/esp_timing.o
CC build/mbedtls/port/esp_sha1.o
CC build/mbedtls/port/mbedtls_debug.o
CC build/mbedtls/port/esp32/aes.o
CC build/mbedtls/port/esp32/sha.o
CC build/mbedtls/port/esp32/esp_bignum.o
AR build/mbedtls/libmbedtls.a
CC build/mdns/mdns.o
CC build/mdns/mdns_networking.o
CC build/mdns/mdns_console.o
AR build/mdns/libmdns.a
CC build/newlib/select.o
CC build/newlib/pthread.o
CC build/newlib/random.o
CC build/newlib/pwrite.o
CC build/newlib/locks.o
CC build/newlib/pread.o
CC build/newlib/utime.o
CC build/newlib/poll.o
CC build/newlib/syscall_table.o
CC build/newlib/termios.o
CC build/newlib/reent_init.o
CC build/newlib/time.o
AR build/newlib/libnewlib.a
CC build/nghttp/nghttp2/lib/nghttp2_queue.o
CC build/nghttp/nghttp2/lib/nghttp2_pq.o
CC build/nghttp/nghttp2/lib/nghttp2_submit.o
CC build/nghttp/nghttp2/lib/nghttp2_frame.o
CC build/nghttp/nghttp2/lib/nghttp2_helper.o
CC build/nghttp/nghttp2/lib/nghttp2_hd.o
CC build/nghttp/nghttp2/lib/nghttp2_stream.o
CC build/nghttp/nghttp2/lib/nghttp2_session.o
CC build/nghttp/nghttp2/lib/nghttp2_rcbuf.o
CC build/nghttp/nghttp2/lib/nghttp2_hd_huffman.o
CC build/nghttp/nghttp2/lib/nghttp2_outbound_item.o
CC build/nghttp/nghttp2/lib/nghttp2_http.o
CC build/nghttp/port/http_parser.o
AR build/nghttp/libnghttp.a
CXX build/nvs_flash/src/nvs_partition_manager.o
CXX build/nvs_flash/src/nvs_api.o
CXX build/nvs_flash/src/nvs_storage.o
CXX build/nvs_flash/src/nvs_handle_simple.o
CXX build/nvs_flash/src/nvs_item_hash_list.o
CXX build/nvs_flash/src/nvs_page.o
CXX build/nvs_flash/src/nvs_ops.o
AR build/nvs_flash/libnvs_flash.a
CC build/open62541lib/open62541.o
In file included from C:/msys32/home/toshi/esp/examples/opcua-esp32/components/open62541lib/open62541.c:28:
C:/msys32/home/toshi/esp/examples/opcua-esp32/components/open62541lib/include/open62541.h:117: warning: "UA_ARCHITECTURE_FREERTOSLWIP" redefined
 #define UA_ARCHITECTURE_FREERTOSLWIP

<command-line>: note: this is the location of the previous definition
C:/msys32/home/toshi/esp/examples/opcua-esp32/components/open62541lib/open62541.c:9978:9: note: #pragma message: No native IEEE 754 format detected. Use slow generic encoding.
 #pragma message "No native IEEE 754 format detected. Use slow generic encoding."
         ^~~~~~~
CC build/open62541lib/model.o
In file included from C:/msys32/home/toshi/esp/examples/opcua-esp32/components/open62541lib/model.c:1:
C:/msys32/home/toshi/esp/examples/opcua-esp32/components/open62541lib/include/open62541.h:117: warning: "UA_ARCHITECTURE_FREERTOSLWIP" redefined
 #define UA_ARCHITECTURE_FREERTOSLWIP

<command-line>: note: this is the location of the previous definition
CC build/open62541lib/DHT22.o
AR build/open62541lib/libopen62541lib.a
CC build/perfmon/xtensa_perfmon_apis.o
CC build/perfmon/xtensa_perfmon_access.o
AR build/perfmon/libperfmon.a
CC build/protobuf-c/protobuf-c/protobuf-c/protobuf-c.o
AR build/protobuf-c/libprotobuf-c.a
CC build/protocomm/src/common/protocomm.o
CC build/protocomm/src/security/security1.o
CC build/protocomm/src/security/security0.o
CC build/protocomm/proto-c/sec0.pb-c.o
CC build/protocomm/proto-c/constants.pb-c.o
CC build/protocomm/proto-c/session.pb-c.o
CC build/protocomm/proto-c/sec1.pb-c.o
CC build/protocomm/src/transports/protocomm_httpd.o
CC build/protocomm/src/transports/protocomm_console.o
AR build/protocomm/libprotocomm.a
CC build/pthread/pthread.o
CC build/pthread/pthread_cond_var.o
CC build/pthread/pthread_local_storage.o
AR build/pthread/libpthread.a
CC build/sdmmc/sdmmc_sd.o
CC build/sdmmc/sdmmc_cmd.o
CC build/sdmmc/sdmmc_mmc.o
CC build/sdmmc/sdmmc_common.o
CC build/sdmmc/sdmmc_io.o
CC build/sdmmc/sdmmc_init.o
AR build/sdmmc/libsdmmc.a
CC build/soc/esp32/emac_hal.o
CC build/soc/esp32/rtc_clk.o
CC build/soc/esp32/rtc_time.o
CC build/soc/esp32/rtc_sleep.o
CC build/soc/esp32/gpio_periph.o
CC build/soc/esp32/i2s_periph.o
CC build/soc/esp32/rtc_clk_init.o
CC build/soc/esp32/ledc_periph.o
CC build/soc/esp32/spi_periph.o
CC build/soc/esp32/rtc_init.o
CC build/soc/esp32/sdio_slave_periph.o
CC build/soc/esp32/uart_periph.o
CC build/soc/esp32/rtc_wdt.o
CC build/soc/esp32/sdmmc_periph.o
CC build/soc/esp32/adc_periph.o
CC build/soc/esp32/i2c_periph.o
CC build/soc/esp32/interrupts.o
CC build/soc/esp32/cpu_util.o
CC build/soc/esp32/touch_sensor_periph.o
CC build/soc/esp32/rtc_io_periph.o
CC build/soc/esp32/touch_sensor_hal.o
CC build/soc/esp32/rtc_pm.o
CC build/soc/esp32/soc_memory_layout.o
CC build/soc/esp32/dac_periph.o
CC build/soc/src/soc_include_legacy_warn.o
CC build/soc/src/compare_set.o
CC build/soc/src/memory_layout_utils.o
CC build/soc/src/lldesc.o
CC build/soc/src/hal/pcnt_hal.o
CC build/soc/src/hal/gpio_hal.o
CC build/soc/src/hal/spi_flash_hal_gpspi.o
CC build/soc/src/hal/ledc_hal.o
CC build/soc/src/hal/ledc_hal_iram.o
CC build/soc/src/hal/i2s_hal.o
CC build/soc/src/hal/sdio_slave_hal.o
CC build/soc/src/hal/timer_hal.o
CC build/soc/src/hal/spi_hal_iram.o
CC build/soc/src/hal/touch_sensor_hal.o
CC build/soc/src/hal/uart_hal.o
CC build/soc/src/hal/sigmadelta_hal.o
CC build/soc/src/hal/spi_flash_hal.o
CC build/soc/src/hal/uart_hal_iram.o
CC build/soc/src/hal/spi_flash_hal_iram.o
CC build/soc/src/hal/adc_hal.o
CC build/soc/src/hal/i2c_hal.o
CC build/soc/src/hal/i2c_hal_iram.o
CC build/soc/src/hal/rtc_io_hal.o
CC build/soc/src/hal/spi_slave_hal.o
CC build/soc/src/hal/can_hal.o
CC build/soc/src/hal/mcpwm_hal.o
CC build/soc/src/hal/dac_hal.o
CC build/soc/src/hal/spi_slave_hal_iram.o
CC build/soc/src/hal/spi_hal.o
AR build/soc/libsoc.a
CC build/spi_flash/esp_flash_spi_init.o
CC build/spi_flash/memspi_host_driver.o
CC build/spi_flash/flash_ops.o
CC build/spi_flash/spi_flash_chip_issi.o
CC build/spi_flash/esp_flash_api.o
CC build/spi_flash/cache_utils.o
CC build/spi_flash/spi_flash_chip_gd.o
CC build/spi_flash/spi_flash_os_func_noos.o
CC build/spi_flash/spi_flash_chip_generic.o
CC build/spi_flash/partition.o
CC build/spi_flash/spi_flash_chip_drivers.o
CC build/spi_flash/flash_mmap.o
CC build/spi_flash/spi_flash_os_func_app.o
CC build/spi_flash/esp32/spi_flash_rom_patch.o
CC build/spi_flash/esp32/flash_ops_esp32.o
AR build/spi_flash/libspi_flash.a
CC build/spiffs/esp_spiffs.o
CC build/spiffs/spiffs_api.o
CC build/spiffs/spiffs/src/spiffs_hydrogen.o
CC build/spiffs/spiffs/src/spiffs_check.o
CC build/spiffs/spiffs/src/spiffs_nucleus.o
CC build/spiffs/spiffs/src/spiffs_gc.o
CC build/spiffs/spiffs/src/spiffs_cache.o
AR build/spiffs/libspiffs.a
CC build/tcp_transport/transport_tcp.o
CC build/tcp_transport/transport.o
CC build/tcp_transport/transport_ssl.o
CC build/tcp_transport/transport_utils.o
CC build/tcp_transport/transport_ws.o
AR build/tcp_transport/libtcp_transport.a
CC build/tcpip_adapter/tcpip_adapter_compat.o
AR build/tcpip_adapter/libtcpip_adapter.a
CC build/ulp/ulp_macro.o
CC build/ulp/ulp.o
AR build/ulp/libulp.a
CC build/unity/unity/src/unity.o
CC build/unity/unity_port_esp32.o
CC build/unity/unity_runner.o
AR build/unity/libunity.a
CC build/vfs/vfs.o
CC build/vfs/vfs_semihost.o
CC build/vfs/vfs_uart.o
AR build/vfs/libvfs.a
CXX build/wear_levelling/WL_Ext_Perf.o
CXX build/wear_levelling/Partition.o
CXX build/wear_levelling/SPI_Flash.o
CXX build/wear_levelling/WL_Ext_Safe.o
CXX build/wear_levelling/WL_Flash.o
CXX build/wear_levelling/wear_levelling.o
AR build/wear_levelling/libwear_levelling.a
CC build/wifi_provisioning/src/wifi_config.o
CC build/wifi_provisioning/src/handlers.o
CC build/wifi_provisioning/src/wifi_scan.o
CC build/wifi_provisioning/src/scheme_softap.o
CC build/wifi_provisioning/src/scheme_console.o
CC build/wifi_provisioning/src/manager.o
CC build/wifi_provisioning/proto-c/wifi_scan.pb-c.o
CC build/wifi_provisioning/proto-c/wifi_config.pb-c.o
CC build/wifi_provisioning/proto-c/wifi_constants.pb-c.o
AR build/wifi_provisioning/libwifi_provisioning.a
CC build/wpa_supplicant/port/os_xtensa.o
CC build/wpa_supplicant/src/ap/ap_config.o
CC build/wpa_supplicant/src/ap/wpa_auth.o
CC build/wpa_supplicant/src/ap/ieee802_1x.o
CC build/wpa_supplicant/src/ap/wpa_auth_ie.o
CC build/wpa_supplicant/src/common/wpa_common.o
CC build/wpa_supplicant/src/common/sae.o
CC build/wpa_supplicant/src/crypto/ms_funcs.o
CC build/wpa_supplicant/src/crypto/crypto_internal-modexp.o
CC build/wpa_supplicant/src/crypto/bignum.o
CC build/wpa_supplicant/src/crypto/sha1-pbkdf2.o
CC build/wpa_supplicant/src/crypto/aes-ccm.o
CC build/wpa_supplicant/src/crypto/aes-cbc.o
CC build/wpa_supplicant/src/crypto/md5.o
CC build/wpa_supplicant/src/crypto/rc4.o
CC build/wpa_supplicant/src/crypto/sha256.o
CC build/wpa_supplicant/src/crypto/dh_groups.o
CC build/wpa_supplicant/src/crypto/md4-internal.o
CC build/wpa_supplicant/src/crypto/sha1-internal.o
CC build/wpa_supplicant/src/crypto/aes-wrap.o
CC build/wpa_supplicant/src/crypto/crypto_mbedtls.o
CC build/wpa_supplicant/src/crypto/crypto_internal-cipher.o
CC build/wpa_supplicant/src/crypto/aes-omac1.o
CC build/wpa_supplicant/src/crypto/dh_group5.o
CC build/wpa_supplicant/src/crypto/crypto_ops.o
CC build/wpa_supplicant/src/crypto/des-internal.o
CC build/wpa_supplicant/src/crypto/crypto_internal-rsa.o
CC build/wpa_supplicant/src/crypto/ccmp.o
CC build/wpa_supplicant/src/crypto/aes-unwrap.o
CC build/wpa_supplicant/src/crypto/crypto_internal.o
CC build/wpa_supplicant/src/crypto/aes-internal-dec.o
CC build/wpa_supplicant/src/crypto/sha1.o
CC build/wpa_supplicant/src/crypto/aes-internal.o
CC build/wpa_supplicant/src/crypto/md5-internal.o
CC build/wpa_supplicant/src/crypto/sha256-internal.o
CC build/wpa_supplicant/src/crypto/aes-internal-enc.o
CC build/wpa_supplicant/src/eap_peer/eap_peap_common.o
CC build/wpa_supplicant/src/eap_peer/eap_mschapv2.o
CC build/wpa_supplicant/src/eap_peer/eap_peap.o
CC build/wpa_supplicant/src/eap_peer/eap_ttls.o
CC build/wpa_supplicant/src/eap_peer/eap_tls_common.o
CC build/wpa_supplicant/src/eap_peer/eap_tls.o
CC build/wpa_supplicant/src/eap_peer/mschapv2.o
CC build/wpa_supplicant/src/eap_peer/eap_common.o
CC build/wpa_supplicant/src/eap_peer/eap.o
CC build/wpa_supplicant/src/rsn_supp/wpa.o
CC build/wpa_supplicant/src/rsn_supp/wpa_ie.o
CC build/wpa_supplicant/src/rsn_supp/pmksa_cache.o
CC build/wpa_supplicant/src/tls/tls_internal.o
CC build/wpa_supplicant/src/tls/tlsv1_common.o
CC build/wpa_supplicant/src/tls/tlsv1_server_write.o
CC build/wpa_supplicant/src/tls/bignum.o
CC build/wpa_supplicant/src/tls/tlsv1_record.o
CC build/wpa_supplicant/src/tls/pkcs5.o
CC build/wpa_supplicant/src/tls/pkcs1.o
CC build/wpa_supplicant/src/tls/tlsv1_client_write.o
CC build/wpa_supplicant/src/tls/tlsv1_server_read.o
CC build/wpa_supplicant/src/tls/asn1.o
CC build/wpa_supplicant/src/tls/pkcs8.o
CC build/wpa_supplicant/src/tls/rsa.o
CC build/wpa_supplicant/src/tls/tlsv1_client.o
CC build/wpa_supplicant/src/tls/tlsv1_client_read.o
CC build/wpa_supplicant/src/tls/tlsv1_cred.o
CC build/wpa_supplicant/src/tls/x509v3.o
CC build/wpa_supplicant/src/tls/tlsv1_server.o
CC build/wpa_supplicant/src/utils/uuid.o
CC build/wpa_supplicant/src/utils/wpabuf.o
CC build/wpa_supplicant/src/utils/ext_password.o
CC build/wpa_supplicant/src/utils/base64.o
CC build/wpa_supplicant/src/utils/common.o
CC build/wpa_supplicant/src/utils/wpa_debug.o
CC build/wpa_supplicant/src/esp_supplicant/esp_wpa_main.o
CC build/wpa_supplicant/src/esp_supplicant/esp_wpa2.o
CC build/wpa_supplicant/src/esp_supplicant/esp_wpa3.o
CC build/wpa_supplicant/src/esp_supplicant/esp_hostap.o
CC build/wpa_supplicant/src/esp_supplicant/esp_wps.o
CC build/wpa_supplicant/src/esp_supplicant/esp_wpas_glue.o
CC build/wpa_supplicant/src/wps/wps_enrollee.o
CC build/wpa_supplicant/src/wps/wps_attr_build.o
CC build/wpa_supplicant/src/wps/wps_registrar.o
CC build/wpa_supplicant/src/wps/wps_common.o
CC build/wpa_supplicant/src/wps/wps.o
CC build/wpa_supplicant/src/wps/wps_dev_attr.o
CC build/wpa_supplicant/src/wps/wps_attr_parse.o
CC build/wpa_supplicant/src/wps/wps_validate.o
CC build/wpa_supplicant/src/wps/wps_attr_process.o
AR build/wpa_supplicant/libwpa_supplicant.a
CC build/xtensa/trax.o
CC build/xtensa/expression_with_stack_xtensa.o
CC build/xtensa/debug_helpers.o
CC build/xtensa/stdatomic.o
AR build/xtensa/libxtensa.a
Generating esp32.project.ld
LD build/opcua_esp32.elf
esptool.py v3.0-dev
Flashing binaries to serial port /dev/ttyS5 (app at offset 0x10000)...
esptool.py v3.0-dev
Serial port /??/COM6
Traceback (most recent call last):
  File "C:/msys32/home/toshi/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 3418, in <module>
    _main()
  File "C:/msys32/home/toshi/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 3411, in _main
    main()
  File "C:/msys32/home/toshi/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 3075, in main
    esp = chip_class(each_port, initial_baud, args.trace)
  File "C:/msys32/home/toshi/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 261, in __init__
    self._port = serial.serial_for_url(port)
  File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/__init__.py", line 88, in serial_for_url
    instance.open()
  File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/serialwin32.py", line 62, in open
    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port '/??/COM6': WindowsError(3, '\x8ew\x92\xe8\x82\xb3\x82\xea\x82\xbd\x83p\x83X\x82\xaa\x8c\xa9\x82\xc2\x82\xa9\x82\xe8\x82\xdc\x82\xb9\x82\xf1\x81B')
make: *** [/home/toshi/esp/esp-idf/components/esptool_py/Makefile.projbuild:92: flash] エラー 1

```
いちおうCOM6になっているようなのですが、エラーが出て中断...。

（つづく）