In this instalment I’m going to cover downloading, installing and setting up the development software:
I’m aiming these posts at those who are not familiar with MCU development to give them a feel of what they will go through. I know not everyone will be interested in reading this in detail so I’ll provide a brief summary of the points:
- The IDE, e2Studio is based on Eclipse CDT which is a great decision as it is widely used and supported. Installation is quick and easy with a choice of compilers. Access to plugins is of course available as they have made no breaking, proprietary changes to the IDE that I can see.
- Renesas provide a host of helpers and utilities for building software for the MCU. I used one in a sample program which was impressive. I can’t imagine anyone would want to build applications without them.
- Getting a sample program working took a bit of effort, due to a mistake on my part, compounded by information not being as easily found on their website as it might be. I think this is a case of getting used to their Information Architecture! The information provided isn’t wholly up to date but can be readily utilised by anyone with a good grounding in software engineering problem solving. I think genuine newcomers to this world will struggle as there isn’t any step-by-step handholding, you do need to apply what you are presented with to your specific environment.
The current version is V7.6.0 released on October 8th 2019 and is available for Linux Ubuntu 18.04 LTS Desktop 64-bit, and Windows 10/8.1/7 32- and 64-bit, although only supported on Windows 10. It purports to cover all aspects of development:
- Sample code
- MCU configuration with a Smart Configurator
- Eclipse CDT editing for C/C++ with a choice of compiler
- Debugging (GDB) and debug emulation (of hardware debuggers)
- Smart Utilities - Code generators and Quick and Effective tool solutions
- Plug-ins through the standard Eclipse mechanisms
The e2Studio product page goes through a number of these features in more detail and provides access to user manuals and getting started videos. As noted above, and as expected, MacOS isn’t a supported environment for e2Studio so I shall be using a Windows VM. I have no information or knowledge of whether or not it would run under WINE or CrossOver. It may be possible to use a MacOS version of Eclipse with GNU compilers and debuggers but I’d be surprise if any of the extended Renesas development features work. It seems fairly typical that MacOS isn’t supported and I assume there’s little call for it from their customers. 4D Systems only release their Workbench IDE for the 4Duino under Windows and that won’t run under Wine.
The compilers supported by e2Studio for the RX family are:
- CC-RX from Renesas. This is a licensed product, available for evaluation.
- GNURX - open source compiler
- IAR - a third-party tool vendor. This is a licensed product.
The Smart Utilities for e2Studio, RX family are:
- Code Generator
- Smart Configurator: a utility for combining software, supporting middleware, driver code and pin setting
- Smart Manual: a tool to find hardware manuals or information on registers
- Smart Browser: a tool to find and display the latest hardware manuals and sample code
- Assistant for Optimisation: a tool to help in optimising executable code through compiler and linker options.
The Quick and Effective (QE) solutions for e2Studio, RX family are:
- BLE (Bluetooth Low Energy)
- TCP/IP (M3S-T4-Tiny software library)
- Display (LCD functions)
- Current Consumption
- Capacitive Touch
The QE tools are designed to help in the development and debugging of parts of the application related to the tool. They are embedded in the e2Studio IDE.
E2Studio looks like a comprehensive IDE and toolstack for development. The Getting Started guide is 50 pages long and covers Installation, Project generation, build and compile, and help. I’ll comment on its usefulness at the end of this post rather than try and describe it here.
For reference, I am running Parallels V15.1.2 with Windows 10 Pro Version 1903. 2 processors and 8GB ram allocated.
The download is 1.35GB and requires your Renesas account. Installation really does not like directory names with spaces or special characters, even temp directories and user directories.
I won’t walk through the Install Shield windows but some major points are:
- It requires Microsoft Visual C++ 2015-2019 Runtime Environment, which it installs itself.
- You have to select the family(-ies) of MCU that will be used - specific components are installed for the selected families.
- There are a whole host of optional components that can be installed - a snapshot:
I don’t know what if any are actually required but I could guess. I won’t need HEW4 support, nor RTOS, but in any case, I just accepted them all.
- A compiler must be chosen - options given are CCRX (various versions) and GCC for Renesas RX (various versions.) I’m going with CCRX v3.01 (it selects v2.08.00 by default) and hoping that it does in fact work under evaluation. If not, I’ll have to switch to GCC [footnote: it does work so far]
Installation proceeded without incident. On launch, the compiler must be registered to the IDE and you have the option to send usage data to Renesas before being presented with the Welcome screen:
(You have to smile at “Review the IDE’s most fiercely contested preferences”. Are developers still that bad, really??)
e2Studio First Steps
IDEs are complicated beasts with many options and features. I’m not going to go through each of them you’ll be glad to know but what I am going to do is browse around the tool, documentation and tutorials and report my findings based on what I learn and what I have past experience with. This will be as I create my application in line with my road test application, but first I will walk through a tutorial to see how well provided for beginners are. I would expect enough of a walkthrough to get me to the starting gate with developing for this MCU.
As previously mentioned, the IDE is based on Eclipse CDT which is a popular and widely used IDE. If you aren’t familiar with Eclipse, it has a built in help (e2Studio help) which will guide you through the tool step-by-step - the annotation in the screen shot above shows how to access. There is also a tutorial for the RX family available in this help or from the tutorial option on the welcome screen.
I’m following the tutorial, so File>New>C/C++ project. This starts a series of wizards to initialise a project with skeleton code based on templates. Templates available won’t all work as they depend on choices made during installation, however for our purposes we want to use the CCRX template:
Give it a name and move on. When creating a project, you will need to specify the toolchain (essentially, the compiler, in this case the CCRX compiler) and the Target Device. This is the specific MCU and you need the reference code from the board:
In this case, R5F565NEDDFB. A breakdown of this code is provided here and Page 23, and tells us that this is:
- R5 - Renesas MCU
- F - Flash ROM
- 5 - ignored
- 65N - Product group, RX65N
- E - 2MB Rom; 640KB RAM; 32KB Data Flash Size
- D - Encryption: yes; SDHI/SDSI: no; Dual Bank Support: No (? - must be different to the firmware dual banks)
- D - Temperature: -40C to 85C
- FB - Package: LFQFP; Pin count: 144: Pin Pitch: 0.50mm
Moving on through the wizard, there are other options to select (not relevant) before the final ‘Finish’ option is selected. This creates the skeleton project and sets the C/C++ Perspective:
The tutorial works with a sample project - Blinky - for a RX71M board and I need one for the RX65N board - fortunately, a version of blinky is available here. I’m a little confused here as I will be importing a project, and I’m not sure if this is importing into the one I just created OR that was just to show how projects are created and this is a brand new one - let’s see.
It gives a new project - well, it was useful to go through the first wizard as selecting the right device requires a bit of detective work. The big test of course, is will it build as imported - I’ve annotated the relevant build selections?
Nope - no path to Make. Took a while to figure out but, actually, it would seem that the toolchain configured for the project is an older version of CCRX so the configuration needs updating:
Once that change is made, the project compiles cleanly (well, with 4 warnings.) Now, configure the debugger: Run>Debug Configurations and select the option under the Renesas GDB property:
This is slightly different to that specified in the tutorial which I think assumes you will be using a hardware debugger - the Envision Board has the E2Lite on board and must be powered from the USB connector.
The board now needs to be in programmer/debug mode. From the User Guide this requires setting switches:
Position 1 should be down, towards ON; although confusingly worded, if Position 2 is also ON then the board can be reset from the debugger without having to disconnect/reconnect the board, at least that's what I think it means! Once switches are set, then the board can be connected to the PC and Debug pressed.
And….errors. Board mismatch - the error is reporting that it is using an E1 debug device rather than the E2Lite. After a bit of to-and-fro, I worked out that the configuration of the project isn’t quite right: the SCFG file needs editing, the Envision board downloaded and selected:
This program has two run states: if started without the user switched pressed, the led will blink automatically under timer interrupt; if started with the switch pressed the led will only blink whilst the switch is pressed (switch interrupt.) The reset feature from the debugger can be used to test both states. However, that of course assumes the program works, which it doesn’t.
What I failed to realise is that whilst the program is for the RX65N, it’s for a Target Board which isn’t a generic thing but a specific thing! So whilst it will compile, it won’t Make because of the differences between the Target Board and Envision Board. I should have realised earlier but didn’t and in my defence I’m finding the structure of documentation on the Renesas web site harder to navigate than it ought to be. For example, I picked that sample application up from the product page of the R5F565NEDDFB but of course the Sample Code link for that product gives all sample code and you have to do the filtering for what will/won’t work for yourself. This is a question of getting used to how the site is laid out so as to approach it the right way.
It’s not been wasted effort as the underlying activities to get it configured and built and ready for the debugger are common and I decided to leave it in this post so that anyone who follows after can at least see some of the pitfalls inexperience with the platform can bring. I may also use the code and re-purpose it for the Envision board as a later activity because that ought to be possible.
I have found an alternative sample program to use: QE for Display [RX]. This uses one of the Quick and Effective tool solutions to drive the display. I will not go through the same level of detail as above as the underlying activities should be very similar.
Work through any issues: I found the directory naming structure in the zip file downloaded to be unacceptable so needed renaming; I still had to change the Board and the Toolchain configuration. However, it does build and Make and it will launch with the debugger, pausing at the PowerON_Reset_PC function - press the resume button:
It will pause at main so press resume again. A nice blue panel is displayed:
This is where the fun begins with QE for Display. Launch it:
You may need to drag it out of the tabbed panel at the bottom to get its own window. The Maker/Type must be set to EastRising for the Envision board.
It’s possible then to play with the QE parameters and see the LCD change in real time. It is much easier to follow the application note that comes with the program as settings need to be made based on the LCD panel. For example this is how the TCON/LCD setting window should look for the Envision board:
Here’s a video showing on-the-fly changing of brightness and loading of an image:
It makes great sense to use an existing open-source to base your IDE on as it is widely supported and has a range of plugins. Just to contrast this, 4D Systems provide their own IDE, Workbench, which is proprietary and is little more than a fancy text editor with very few typical IDE features - for example, there is no way of looking at definitions of functions/methods and auto-complete is hardly worthy of the name. It is not a joy to use!
The Getting Started guide I mentioned earlier is useful to a degree but I found the help embedded in the IDE itself more useful. It’s worth skimming through though to gain an overview of the tool.
It took a little while to get a sample program up-and-running and it does require delving into the configuration to get them working given the specifics of my install. I would think that anyone with limited problem solving ability will struggle with this, it’s not for the very inexperienced. I can’t blame Renesas for this as it would take a lot of work to keep these samples, application notes and help information up to date with changes; there has to be some onus on a user to get to grips with it. At the end of the day, this is my first usage of Eclipse, my first usage of E2Studio, and not-quite-my-first usage of a MCU and development/evaluation board and the information provided has been sufficient to work through issues and get a program running under the debugger. I’ll probably try to cement this understanding by modifying the blinky program I tried to get working first.
On the basis of what I’ve seen so far, the provided tools and helpers are impressive - it’s clear Renesas have put a lot of effort into supporting their MCUs.
I will need to spend some time playing with the development tools and software examples so I understand how best to go about building the application I want. I won’t be doing that with detailed posts, but I will make shorter posts on specific areas of interest.
I will update this entry to provide links to further instalments as I create them:
Part Three: Development Software (this post)