The EE-04 is a programmer with an embedded EE-02 module, that uses SEGGER firmware. When connecting the EE-04 to the computer via USB the programmer will appear as an external drive named JLINK. Programming the EE-02 is simply done by dropping a compiled image onto the mounted drive.
You don’t need any additional hardware in order to program the EE-04.
You will find the following items in your kit:
- EE-04 module.
- 868MHz whip antenna.
- 2 x 15 pin headers.
- EE-04 pinout diagram.
Soldering the two 15 pin connectors to your EE-04 is optional, but this will enable easier prototyping. You will have to connect the antenna to the u-fl connector. There are two u-fl connectors on the board. One for 433MHz and one for 868MHz. Connect the 868 antanna to the u-fl conector closest to the middle of the board.
Connect the development kit to your computer, using a USB Micro-B cable. Observe that:
- The power LED indicator in the development kit lights up.
- An external disk, named “JLINK” appears.
In order to program the EE-02 via the EE-04, you will have to select a toolchain. This section will describe installing and setting up Apache Mynewt. You also have the option to use the nRF52 development kit from Nordic Semiconductor. This is described in the EE-0x Firmware section.
- Follow the steps descirbed in the “Native Installation” section. This will guide you through the process of installing the tools you need to develop Mynewt OS applications on MAC OS, Linux and Windows.
- Follow the steps described in the “Creating Your First MyNewt Project” section - until you reach the section “Testing the Project Packages”.
- You will now have a new skeleton application called “blinky”, but we will have to define the EE-02 as a build target before we can compile it.
- In order to get access to the BSP (Board Support Package) for the EE-04, we will have to use the 0-dev version of mynewt instead of 0.9.999. The version dependency can be changed in your project.yml file. Open this file in an editor and change the line “vers: 0.9.999” to “vers: 0-dev”.
- Open a shell and navigate to the “myproj” folder. Then execute the following command:
$ newt upgrade
- We will now have access to more BSPs, including ours, which is called “telee02. This is what we will target.
- First, we have to create a bootloader build target. Execute the following commands in a shell (still from the myproj folder)
$ newt target create ee04_boot $ newt target set ee04_boot app=@apache-mynewt-core/apps/boot $ newt target set ee04_boot bsp=@apache-mynewt-core/hw/bsp/telee02 $ newt target set ee04_boot build_profile=optimized
- Secondly, we have to define a build target for our blinky application. Execute the following commands in the shell.
$ newt target create ee04_blinky $ newt target set ee04_blinky app=apps/blinky $ newt target set ee04_blinky bsp=@apache-mynewt-core/hw/bsp/telee02 $ newt target set ee04_blinky build_profile=debug
We now have our toolchain and build targets set up. We are now ready to build and deploy our bootloader and our blinky application.
Make sure you have the SEGGER JLink tools installed on your computer. Mynewt uses these to deploy the images to the board. You can download the SEGGER tools here.
(This is a one time operation per board)
Connect the EE-04, via USB, if you haven’t dones so already. Open a shell, navigate to the “myproj” folder and execute the following steps:
$ newt build ee04_boot $ newt load ee04_boot
These three steps have to be repeated each time you want to deploy a new version. It will save you some typing if you add these command to a shell script.
$ newt build ee04_blinky $ newt create-image ee04_blinky 1.0.0 $ newt load ee04_blinky
You will now have running code on your EE-04. Let’s hook it up to check that it works. You will need the following:
- A LED.
- A series resistor. Keep in mind that the drive voltage is 3.3V and that we should keep the current draw well below 20 mA.
- A breadboard. (You can also solder the resistor in series with the LED and use the headers on the EE-04)
If you haven’t done so already, start with soldering the two 15 pin headers to the EE-04 PCB.
Hook up the longest lead of the LED to PO.17. Connect the other lead to one side of the resistor and hook up the last lead of the resistor to GND.
A note regarding GPIO pins: The development kit exposes all GPIO pins from the EE-02 in addition to GND/VDD/regulated 5V. The GPIO pins are not 5V tolerant. It is also important to observe the limits for GPIO drive / sink voltage for a given voltage. Further information is given in GPIO Electrical Specification Three of the exposed pins (ANT, RXTX and SXRST) are reserved for the LoRa module. If these pins are used as general IO pins, the LoRa module will not function.
You can print debug statements via UART or RTT. The default output is UART. You can try this out by adding the following code to main.c:
line 30: #include "console/console.h" line 67: console_printf("Yay !\n");
Build ee04_blinky once more, create image and load. Now you can start a serial port terminal application of choice. Connect to the USB serial port using 115200 baud, 8 data bits, no parity, 1 stop bit.
It will now log “Yay!” each time the LED changes state.
If you have JLinkExe and JLinkRTTClient (from SEGGER) installed, you wil have to change the
syscfg.defs: CONSOLE_UART: description: 'Set console output to UART' value: 0 CONSOLE_RTT: description: 'Set console output to RTT' value: 1
Connect JLINK by executing the following command in a shell:
$ JLinkExe -if swd -speed 4000 -device nrf52 -autoconnect 1
Start JLinkRTTClient by executing the following command in another shell:
The output in JLinkRTTCLient will look something like this:
JLink can be downloaded from the SEGGER website
If JLink is up and running, you may experience timeouts when executing newt load. If this is the case, close the JLink session and load the image again.
Programming external devices
You can easily program external EE-02 modules on custom boards via the DEBUG-out connector. Remember to power both devices before programming. Connect the cable from the DEBUG connector, and the EE-04 will program the external board instead of the embedded EE-02. Programming an external device is an identical process to programming the EE-02 embedded on the EE-04.
Resources for creating your own devices
If you are designing your own board around the EE-02 module, you will have to connect the module’s SWDIO, SWDCLK, GND, VCC and RESET pins to the EE-02. The easiest way to do this is to add a DEBUG_IN connector on your board.
Having issues? If you can’t get something working you may check the GitHub issues page for the EE-04.