Installing PADI to Arduino IDE

Installing PADI to Arduino IDE

Daniil Zhuk
The PADI IoT Stamp module is a newly emerging alternative to the already well-known ESP8266, with much more interesting features.

Due to the “freshness” of the device and relatively small technical support for developers, currently there are only a few ways to control the module — via standard firmware with AT command support (which forces you to use an external controller), through manually written low-level firmware, which requires serious skills programming, or through the Arduino environment using advanced software from developers.

Today we consider the latter method as the most convenient and easy to use.

To implement the project from this article, we need the following components:
  • PADI IoT Stamp - WiFi module based on RTL8710AF
  • PADI Breadboard Adapter - Breadboard Adapter
  • Resistors kit
  • 400-point breadboard
  • Jumper wires kit

The system on the chip at the heart of the PADI module - RTL8710AF - is built based on the Cortex-M3 core, respectively, for its firmware, you need to use a debugger compatible with this core. The supported software we will install includes ST-Link (V1 and V2), J-Link from Segger, ULINK and Bus Pirate.

If you have experience with OpenOCD, you can add any other suitable and supported programmer to the configuration file. The author used the ST-Link V2.

First of all, you need to install software from the manufacturer - it supports boards on the same system on a chip, but uses an inconvenient programming method that is compatible with mbed. The add-in of the user GitHub gtalusan only allows programming through common debuggers.

To install, open the Arduino IDE (version 1.6.7 and up),

File -> Settings:

We insert the following line into the “Additional links for the board manager”:

https://github.com/Ameba8195/Arduino/raw/master/release/package_realtek.com_ameba_index.json 

Click OK, go to Tools -> Fee -> Card Manager:

In the search bar, look for “ameba” and install the latest version of Realtek Ameba Boards (at the time of writing - 2.0.2):

Please note that the package weighs about 200 MB, you must have the necessary amount of disk C space and enough traffic! Next, you need to install the extension itself from gtalusan - for this, you need to add a second link to the additional fees. To do this, you need to click on the button near the line for input, after which a full window for entering will open:

Here we enter the link:

https://github.com/gtalusan/PADIIoTStamp/raw/master/release/package_padiiotstamp_index.json

And then through the manager install another package:

It weighs much less - about 5 MB.

After installing the board pack, you need to install third-party software for the firmware - OpenOCD. This is a cross-platform debugging complex and we will use it only for a fraction - for downloading the firmware.

The latest releases can be found here: https://github.com/gnu-mcu-eclipse/openocd/releases. Select and download the version suitable for your OS.

We installed the software for Windows 8 x64, respectively, the installer gnu-MCU-eclipse-openocd-0.10.0-2-20170622-1535-dev-win64-setup.exe was downloaded.

When installing OpenOCD, it is desirable to install it in a directory with a simple path - in the future, we will have to prescribe this path in the settings. However, from the standard location in Program Files, the complex works just as well.

After installation, it remains to register the path to the programming software. The author of the patch installed it on Mac OS, so OpenOCD is located at / usr / local / bin. In our case, it is located in C: Program Filesopenocdbinopenocd.exe - yours may differ slightly depending on the version or the location selected during installation.

The path that needs to be edited is in the platform.txt file - but not in the Arduino IDE installation folder, but the user's AppData folder.

We have it located in the C: Users username AppDataLocalArduino15packagespadi IoT stamphardwareameba.0.4.

For editing, it is desirable to use an advanced editor with support for UNIX-line completion, for example, Notepad ++.

The parameter to be edited is immediately noticeable - this is / usr / local / bin. Please note that your path must be specified with the file name at the end, otherwise the program will not work.

Once completed, save the file and be sure to restart the Arduino IDE! It reads information from the configuration files only at the time of launch, so without restarting this environment will look for OpenOCD along the old path and fall into error.

Unfortunately, the author’s instructions are simple and performed 100% only when using Mac or Linux, and on Windows there are certain problems with the paths. So, when downloading firmware to a board, access to a binary file goes to the address with single backslashes as delimiters, and Windows cuts them when it is accessed.

As a result, the environment is trying to find the file ram_all.bin on our system at C: UsersAppDataLocalArduino15packagesrealtetoolsameba_tools.0.8ram_all.bin - some characters are recognized as escape sequences due to a backslash, the slashes themselves are cut off.

To prevent this from happening, you need to manually enter the correct address using double backslashes. To do this, in platforms.txt you need to replace {runtime.tools.ameba_tools.path} /ram_all.bin 0 with the real path to the ram_all.bin file. We had it at the address C: Users User name AppDataLocalArduino15packagesrealtektoolsameba_tools1.0.9ram_al.bin, which we write in place of the variable:

Things are easy - connect PADI to the programmer! For more convenient work, we soldered the module to the PADI Breadboard Adapter.

In total, you should connect 5 wires - power supply (+3.3 V, we took from the programmer.

Note that on the original ST-Link, the target controller must be soldered separately, so there is no power supply on its connector, and the 3.3 V contact only serves to check the voltage of the target device), ground (+3.3 V, we took from the programmer), ground (GND) , CHIP_EN (pulled up by a resistor of 10 kΩ to 3.3 V), SWD (GE3) and SCK (GE4).

CHIP_EN can not be connected, but in an environment with a high level of electromagnetic interference, the module can be turned off.

After all the operations are done, the empty project is successfully compiled and poured into the module!

 

 If something goes wrong with you, check whether you have exactly saved all the files after editing and restart the environment as an administrator!

Add a comment

* Comments must be approved before being displayed.