Author's Note: If you have the S3A7 IoT Fast Prototyping Kit, I strongly recommend skipping this version of Blinky and following either one or both of the following tutorials. They use the correct board support package (BSP) for our board. This tutorial is fine, but it is based on pre-loaded content that comes with a different board.
The tutorials below are built entirely from scratch, and they introduce timers and interrupts.
In this tutorial you will use Renesas e2 studio to build a simple project that blinks LEDs on the S3A7 IoT Fast Prototyping board. Since there is not yet a 'Blinky' template for this board, you will use the template for an older S3A7 development kit board (S3A7-DK). It turns out that the LEDs on the Fast Prototyping board are connected to the same i/o pins as the older board with one exception which I'll detail at the end.
This is all based on the general 'Blinky' tutorial in the Renesas Synergy Software Package (SSP v. 1.2.0) User's Manual available here: https://www.renesas.com/en-us/products/synergy/design-resource-library.html. I posted this tutorial because it contains a bit more detail relevant specifically to the IoT Fast Prototyping board.
S3A7 IoT Fast Prototyping Kit including the J-Link debugger
Renesas e2 studio version 5.3.1.002 (the latest as of 3/30/2017)
Renesas Synergy Software Package SSP v 1.2.0 (the latest as of 3/30/2017)
Segger J-Flash Lite 6.14a or later (older versions probably work, too)
Step 1) Download and install e2 Studio if you have not already done so.
You will need to set up a free Renesas account to access e2 Studio: https://synergygallery.renesas.com/isde
Installation instructions: https://synergygallery.renesas.com/isde/support#read
Step 2) Download and install SSP v 1.2.0.
You will need a separate free Renesas Synergy account to access the SSP software and instructions.
Step 3) Install the J-Link software and learn how to flash the S3A7 by following this tutorial.
Step 4) Start e2 studio.
My installation looks like this:
Step 5) In a clean workspace, create a new Synergy C project.
Step 6) Name your project and select the GCC ARM Embedded tool chain.
You will probably have a blank where the license file should be. To find the license file, navigate to your \e2_studio\ directory, and from there, follow the path in the example below.
Step 7) Select the device and tools according to the screen shot below.
Note that the IoT Fast Prototyping board that we have is not listed as an option. “S3A7 DK” is close enough to make this work. I have not detected any damage due to multiple outputs driving the same node, but it is theoretically possible since I don't have detailed schematics for both boards.
Step 8) Choose the 'Blinky' template and then click 'Finish.'
Step 9) Allow e2 studio to open the Synergy Configuration perspective.
Step 10) Make sure the source code in the project explorer looks like this.
Step 11) Press the 'Generate Project Content' button.
Step 12) Build the project.
Step 13) Flash the board with the new .srec file.
The file 'Blinky.srec' is located in the 'Debug' directory as shown below. Follow the instructions in the tutorial listed in step 3 above to flash the board. Once that is done, and you reset the board, LEDs 1,2,3 will flash at 1Hz.
Note that LED 0 remains unlit. According to the C source code and the Synergy pin configuration (see below) for the old S3A7 DK board, Port 7, pins 1,2,3,4 are used to drive LEDs.
According to the schematic for our Fast Prototyping board, however, LEDs are driven by Port 7 pins 0,1,2,3. Since we're using the code/configuration for the old board, we only get LEDs 1,2,3 blinking. Thankfully, there doesn't appear to be anything on the new board connected to Port 7 pin 4. To be absolutely safe, you should probably disable Port 7 pin 4, although that might cause e2 studio to complain. I didn't bother, and my board seems fine. It is very easy to enable P7pin0 and configure it like the others. In Part 2 of this tutorial which I hope to write up soon, I'll enable the pin and change the code to make the 4th LED light. The schematic below is from the user manual for the S3A7 Fast Prototyping Kit.
Final Step) Change the blink frequency in code and verify that the blink frequency actually changes after re-flashing the board with the new .srec file.
Open the file 'hal_entry.c' in the c/c++ perspective.
Change the frequency as indicated below. The original source file set the frequency at 2Hz. For some reason that I can't yet explain, the LEDs on my board flash at 1Hz with this setting. When I double the frequency to 4Hz in code, the LED frequency doubles to 2Hz. After re-building the project with the change, you'll need to flash the board with the new .srec file as in step 13 above.
Next Steps: I plan to configure Port 7, Pin 0 as a CMOS output to match that of the other 3 LED i/o pins. I'll also disable Port 7, Pin 4 just to be safe. Finally, I'll modify the C code to get LED 0 blinking. I'm still new to e2 Studio, so although I can see where I think the code should be changed, the program won't let me do it. As soon as I figure it all out, I'll post it.