Jump to content

Recommended Posts

Hello everyone..


I am beginner with Energia. I have Tiva C series launchpad which features TM4C123G series microcontroller. Now this microcontroller has 8 UARTs. I have tested basic serial communication using energia and it works perfectly fine.


Now i want to use UART module 3 of this microcontroller which is pin no 13 and 14 (PC6 and PC7). So how can i do this using Energia..??


Thank you.

Link to post
Share on other sites

It looks like via the code in HardwareSerial.cpp that the constructor for the Serial class is overloaded.



HardwareSerial::HardwareSerial(unsigned long module)


If you don't pass a "module", it defaults to 0.  Pass the module that is associated with the configuration you want.  Starting on line 92 looks like all the configurations:

static const unsigned long g_ulUARTConfig[8][2] =


   //TODO:Add functionality for PinConfigure with variable uartModule

This is a least how it looks like you are supposed to do it.  I've not tried it, but it'd be worth a shot.

Link to post
Share on other sites


Seems to have a problem with UART3: if this is really what you need then maybe you will be forced to make some modifications/configurations to the library, since up to now there are UART 0, 1, 2, and you need #3.

Look to this thread:


Someone else needed UART7 ...

You may need to use PinMux utility from TI to correctly configure the UART3 pins (write your own and then check/verify with PinMux).


Link to post
Share on other sites

Reading your reply I am not sure if you got it to work or not. SeralX.xxx will work on both Tiva and Stellaris. 

Did you get it to work on Stellaris and Tiva or are you still seeing issues with this?

I've personally tested Serial, Serial1, Serial3 and Serial7 on the stellaris without issue. Simple sketch that read data from one UART and wrote it to the other (I did it 3 times, Serial on all versions writing to 1 3 or 7). Putty connected to COM5 on windows (being an FTDI cable connected to the stellaris headers for above UARTs) and the energia serial monitor on COM8 for the stellaris. All data typed into putty was received in energia, all data sent from energia was displayed in putty. All testing was at 9600 baud.



I havent done any testing of i2c or SPI, only used i2c once actually and that was between 2 arduino nano's.



Rather off topic but I am a huge fan of energia, arduino like environment on the rather powerful stellaris (and in a few days when it arrives the MSP430) is extremely useful. I actually had countless errors with installing code composer studio (I think from university firewall rather than anything else) and dont have a decent enough internet connection at home to install it there, Energia saves the day while allowing me to continue using an environment I am familiar with.

Link to post
Share on other sites

Hello guys..

i have compiled successfully with following method.. Where x is module number..

for eg..

Serial2.begin(9600); // for UART module 2
Serial3.begin(9600); // for UART module 3

I have not tested this on hardware.. I will test it on hardware within couple of days..and will post result here..

Link to post
Share on other sites
  • 11 months later...


I’m in the process of porting over a tested F5529 sketch to Tiva.

Serial1.available() originally worked correctly as my Bluetooth connection, but does nothing now on the Tiva. As the same pins (3&4) and  mother PCB is used, am at a loss. Does appear another Tiva setting is required.

Link to post
Share on other sites

As I'm getting nowhere I tried the following LM4FH5QR code (github.com/energia/Energia/issues/165) but it locked up the printout.

   HardwareSerial serial

   HardwareSerial serial1

   void setup(){







Is HardwareSerial supported by Tiva?

Link to post
Share on other sites
  • 2 years later...
On 1/15/2015 at 6:08 AM, OzGrant said:


Posted this problem on 43oh and solved by using PC4&5

see http://forum.43oh.com/forum/28-energia/


Does this mean that the solution to this problem has been posted?  If so, where? 

I am trying to link together four tiva launchpads (TM4C123...) and have them communicate using Serial2, Serial3 and Serial4.  I want to use an array of serials to simplify the code but I cant get the modules selected.  When I try serial[j].selectModule(module[j]); I get the error message "class HardwareSerial has no member named selectModule".  Any ideas?  Thanks,  Jack

Link to post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...