e-puck2 radio module development and e-puck2 programmer development: Difference between pages

From GCtronic wiki
(Difference between pages)
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
Line 1: Line 1:
[{{fullurl:e-puck2}} e-puck2 main wiki]<br/>
[{{fullurl:e-puck2}} e-puck2 main wiki]<br/>


=Introduction=
=Get the source code=
Espressif provides the [https://github.com/espressif/esp-idf Espressif IoT Development Framework] (ESP-IDF for short), that is a framework for developing applications based on the Espressif ESP32 chip. The firmwares developed for the e-puck2 radio module are based on this framework.<br/>
 
The software development framework provided by Espressif is intended for rapidly developing Internet of Things (IoT) applications, with Wi-Fi, Bluetooth, flexible power management and other advanced system features.<br/>
=Configuring the Programmer's settings=
Users can develop applications in Windows, Linux and MacOS based on ESP-IDF.<br/>
The on-board programmer of the e-puck2 is based on the [https://github.com/blacksphere/blackmagic/wiki Blackmagic probe open source project] firmware. <br>
The <code>C programming</code> language is used to develop code for the radio module of the e-puck2 robot and the ESP-IDF includes the FreeRTOS real time operating system.
Some functionalities has been added on top of the original project to be able to control some functions of the robot, for example the power on or power off.
 
To access to the available commands of the programmer, it is needed to connect to the programmer with a GDB console. <br>
To do so, you have to type the following command in a terminal window with the com port used by the '''e-puck2 GDB Server'' port of your e-puck2 :
<pre>
arm-none-eabi-gdb
target extended-remote your_gdb_com_port
</pre>
 
Once connected to the programmer with GDB, you can type
<pre>monitor help</pre> or <pre>mon help</pre> to print the available commands of the programmer.


=Development environment=
One command in particular is useful, which is mon select_mode. It is used to select in which mode the '''e-puck2 Serial Monitor''' com port will work.<br>
In order to build the firmware you need to install the toolchain, refer to [http://esp-idf.readthedocs.io/en/latest/get-started/#setup-toolchain http://esp-idf.readthedocs.io/en/latest/get-started/#setup-toolchain].<br/>
mode 1 = the serial monitor is connected to the UART port of the main processor<br>
Once installed you can issue the command <code>make flash</code> from the directory <code>Projects\ESP32_E-Puck_2</code> to build the firmware.<br/>
mode 2 = the serial monitor is connected to the UART of the ESP32<br>
For more information have a look at [http://esp-idf.readthedocs.io/en/latest/get-started/#build-and-flash http://esp-idf.readthedocs.io/en/latest/get-started/#build-and-flash].<br/>
mode 3 = the serial monitor works as a Aseba CAN to USB translator<br>


=Get the source code=
The choice made for the mode is the only setting that is stored in a flash zone of the programmer, which means the choice is remembered, even if the robot is completely turned off.
The radio module firmware source code can be downloaded with the command:<br/>
 
<code>git clone --recursive https://github.com/e-puck2/esp-idf.git</code><br/>
Note : in mode 1 and 3, GDB can be used over the bluetooth connection of the e-puck2. But is is much slower than with USB and it doesn't work with Windows due to GDB limitations on this OS.


==WiFi==
By being connected with GDB, you can also use the standard GDB command to program and debug the main processor of the e-puck2.
The radio module wifi firmware source code can be downloaded with the command:<br/>
<code>git clone -b wifi --recursive https://github.com/e-puck2/esp-idf.git</code><br/>

Revision as of 13:34, 17 December 2018

e-puck2 main wiki

Get the source code

Configuring the Programmer's settings

The on-board programmer of the e-puck2 is based on the Blackmagic probe open source project firmware.
Some functionalities has been added on top of the original project to be able to control some functions of the robot, for example the power on or power off.

To access to the available commands of the programmer, it is needed to connect to the programmer with a GDB console.
To do so, you have to type the following command in a terminal window with the com port used by the 'e-puck2 GDB Server port of your e-puck2 :

arm-none-eabi-gdb 
target extended-remote your_gdb_com_port

Once connected to the programmer with GDB, you can type

monitor help

or

mon help

to print the available commands of the programmer.

One command in particular is useful, which is mon select_mode. It is used to select in which mode the e-puck2 Serial Monitor com port will work.
mode 1 = the serial monitor is connected to the UART port of the main processor
mode 2 = the serial monitor is connected to the UART of the ESP32
mode 3 = the serial monitor works as a Aseba CAN to USB translator

The choice made for the mode is the only setting that is stored in a flash zone of the programmer, which means the choice is remembered, even if the robot is completely turned off.

Note : in mode 1 and 3, GDB can be used over the bluetooth connection of the e-puck2. But is is much slower than with USB and it doesn't work with Windows due to GDB limitations on this OS.

By being connected with GDB, you can also use the standard GDB command to program and debug the main processor of the e-puck2.