[M467] Use Arduino IDE Controlling Wi-Fi Module on the NuMaker-IoT-M467 Board

Post Reply
morgandu
Posts: 45
Joined: 28 Apr 2017, 22:47

10 Apr 2024, 16:54

[For further inquiries, please e-mail to shchen2@nuvoton.com]
[Visit https://www.nuvoton.com/iot_startup for more IoT solutions]


On the NuMaker development board, there is a ESP-12F Wi-Fi module; however, the NuMaker UNO package in the Arduino IDE does not provide relevant control for this module. If you wish to control this module within the Arduino IDE, how should you proceed?

Please refer to the attachment, which adds a UART object to support the ESP-12F Wi-Fi module on the NuMaker-IoT-M467 development board.

nuvoton-m460-uart-for-arduino-ide.zip
(9.23 KiB) Downloaded 30 times

Download the attachment and extract it to the following directory:
C:\User\YOUR-ACCOUNT\AppData\Local\Arduino15\packages\nuvoton\hardware\nuvoton\2.3.2\cores\nuvoton

This attachment is based on the NuMaker UNO package version 2.3.2. The modified files are as follows:
  • HardwareSerial.cpp
  • HardwareSerial.h
  • Ping_M460_arduino.cpp
  • Ping_M460_arduino.h
Originally, there was a definition for the Serial object (corresponding to Arduino D0/D1), Serial1 object (corresponding to Nu-Link2 ICE UART, i.e., interoperability with Nu-Link2's VCOM). After the update, a new Serial2 object is added, corresponding to the Wi-Fi module on the NuMaker-IoT-M467. You can compare the original four files with the updated files in the attachment to clearly see the changes made.

After the update, you can create a simple UART pass-through Arduino program to test the Wi-Fi.

Code: Select all

void setup() {
  Serial1.begin(115200);  // for ICE UART
  Serial2.begin(115200);  // for Wi-Fi UART
}

void loop() {
  if (Serial1.peek() > 0)
  {
    Serial2.write(Serial1.read());
  }
  if (Serial2.peek() > 0)
  {
    Serial1.write(Serial2.read());
  }
}
In the Arduino IDE Serial Monitor, enter the command "AT+GMR". This command requests the ESP-12F to output the firmware version information. Since Wi-Fi commands end with CR and LF characters, remember to select 'Both NL & CR' and set the baud rate to 115200.

pass-through-test-arduino-ide.png
pass-through-test-arduino-ide.png (18.13 KiB) Viewed 1278 times

Enjoy it. ;)

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests