Blinky on the S3A7 IoT Fast Prototyping Kit

synergy
s3a7

#1

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.

Prerequisites:
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.

https://synergygallery.renesas.com/ssp/archive#read

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.

http://renesas-blog.mediumone.com/how-to-flash-the-s3a7-board/

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.


My First Tutorial - UPDATED
Updated 4 LED Blinky on S3A7 Fast Prototyping Board
Learn IoT MeetUp - June 5 in San Jose
SK-S3A7 Tutorials
My First Tutorial - UPDATED
Learn IoT MeetUp - Apr 19 in San Jose
#2

Wow!! Thanks so much. This will be a great help to the community. Your tutorial is a critical piece in the learning process for people with only the S3A7 IoT Fast Prototyping Kit. I’ve added it to the learning flow that we recommend all people follow. I also promoted it out on Twitter. I’m going to get a cup of coffee and get my LEDs to blink right after that.


#3

Going through this great tutorial now. Notice you mentioned schematics for S3A7. It’s below along with the Bill Of Materials.

BOM S3A7 Fast Prototyping Kit.xlsx (14.7 KB)

Schematic S3A7 Fast Prototyping Kit.PDF (1.0 MB)

Additional information available in the

IoT Fast Prototyping Kit S3A7 User’s Manual (1.3 MB)

DK-S3A7

Development Kit DK-S3A7 v2.0 Users’ Manual (2.1 MB)


Medium One screenshot for board a bit hard to see.


#4

Here’s a action video shot of Blinky on the S3A7 IoT Fast Prototyping Kit. Thought it needed a video to show the full glory of Blinky.


#5

I am sad that I can only “like” this once.


#6

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.


#7

Dan, do you want to edit the post itself with some of this same info? Insert it right at the top, maybe?


#8

Hi Jesse,

Putting that right at the top is what I had hoped to do. I don’t think the option to edit is still available. Let me know if it is possible, and I’ll take care of it. Also, I remember you mentioned a step by step guide to the S3A7 that you and Craig developed. It referred to this post, and I think it would be good to update it with the new tutorials. They are a better fit.

Thanks, Dan


#9

Dan,

I’ve added it directly into the post. I’m also promoting you to moderator status, so you can go in and edit as needed, no time limit. Please make sure I added what you wanted.

Also, thanks for pointing out the step-by-step guides. I’ll update them.

Jesse

PS. Good luck tomorrow!


#10

Thanks for posting the change. I think people are best served by following the newer versions.

Dan